facebookarchive / instant-articles-builder

Instant Articles Rules Editor
https://facebook.github.io/instant-articles-builder
Other
125 stars 67 forks source link

Preview load problem #175

Closed eythel closed 3 years ago

eythel commented 3 years ago

Steps required to reproduce the problem

  1. Paste url in "go" section
  2. Try to select "title", "author" or any other option on the Template column
  3. It selects these elements

Expected Result

Actual Result

Environment Info

VERSION: 0.2.2 URL: https://www.cubanet.org/destacados/la-habana-amenazan-con-desalojar-a-madre-que-se-colo-en-una-vivienda/ RULES:

{
  "generator_name": "facebook-instant-articles-builder",
  "generator_version": "0.2.2",
  "rules": [
    {
      "class": "TextNodeRule"
    },
    {
      "class": "BlockquoteRule",
      "selector": "blockquote"
    },
    {
      "class": "ParagraphRule",
      "selector": "p"
    },
    {
      "class": "H2Rule",
      "selector": "h2"
    },
    {
      "class": "H1Rule",
      "selector": "h1"
    },
    {
      "class": "ListElementRule",
      "selector": "ol, ul"
    },
    {
      "class": "ListItemRule",
      "selector": "li"
    },
    {
      "class": "AnchorRule",
      "selector": "a",
      "properties": {
        "anchor.href": {
          "attribute": "href",
          "selector": "a",
          "type": "string"
        }
      }
    },
    {
      "class": "ItalicRule",
      "selector": "i"
    },
    {
      "class": "EmphasizedRule",
      "selector": "em"
    },
    {
      "class": "BoldRule",
      "selector": "b, strong"
    },
    {
      "class": "ImageRule",
      "selector": "img",
      "properties": {
        "image.url": {
          "attribute": "src",
          "selector": "img",
          "type": "string"
        },
        "image.caption": {
          "attribute": "src",
          "selector": "img",
          "type": "element"
        }
      }
    }
  ]
}
eythel commented 3 years ago
Captura de Pantalla 2021-04-14 a la(s) 18 44 08
pestevez commented 3 years ago

Hi @eythel - is this happening on Windows or in another OS?

pestevez commented 3 years ago

I think I found the problem. You are missing the "Article" element. I made a few changes, and while not perfect (it is missing the article published date and is picking up the video in the header as an image), it should be a good starting point:

{
    "generator_name": "facebook-instant-articles-builder",
    "generator_version": "0.2.2",
    "rules": [{
        "class": "TextNodeRule"
    }, {
        "class": "GlobalRule",
        "selector": "html",
        "properties": {
            "article.title": {
                "attribute": "content",
                "selector": "h1",
                "type": "element"
            },
            "author.name": {
                "selector": ".jeg_meta_author a",
                "type": "string"
            },
            "image.url": {
                "attribute": "poster",
                "selector": "div.jeg_feature_video_wrapper video",
                "type": "string"
            },
            "article.body": {
                "attribute": "content",
                "selector": ".content-inner",
                "type": "element"
            },
            "article.canonical": {
                "attribute": "href",
                "selector": "link[rel=canonical]",
                "type": "string"
            }
        }
    }, {
        "class": "BlockquoteRule",
        "selector": "blockquote"
    }, {
        "class": "ParagraphRule",
        "selector": "p"
    }, {
        "class": "H2Rule",
        "selector": "h2"
    }, {
        "class": "H1Rule",
        "selector": "h1"
    }, {
        "class": "ListElementRule",
        "selector": "ol, ul"
    }, {
        "class": "ListItemRule",
        "selector": "li"
    }, {
        "class": "AnchorRule",
        "selector": "a",
        "properties": {
            "anchor.href": {
                "attribute": "href",
                "selector": "a",
                "type": "string"
            }
        }
    }, {
        "class": "ItalicRule",
        "selector": "i"
    }, {
        "class": "EmphasizedRule",
        "selector": "em"
    }, {
        "class": "BoldRule",
        "selector": "b, strong"
    }, {
        "class": "ImageRule",
        "selector": "img",
        "properties": {
            "image.url": {
                "attribute": "src",
                "selector": "img",
                "type": "string"
            },
            "image.caption": {
                "attribute": "src",
                "selector": "img",
                "type": "element"
            }
        }
    }, {
        "class": "IgnoreRule",
        "selector": "img.rimg_cn,div.jeg_post_tags"
    }]
}

I am closing the issue now, compatriota, but feel free to reopen this one if it does not work.

eythel commented 3 years ago

Muchas gracias, compatriota :) It's happening on Mac. I'll check this and in case it doesn't work I'll contact you again.

El mié, 14 abr 2021 a las 21:49, Pablo Estevez @.***>) escribió:

Closed #175 https://github.com/facebook/instant-articles-builder/issues/175.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/instant-articles-builder/issues/175#event-4596776228, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATVZWO6EPHSI7S4TQ7DXEGDTIZH4NANCNFSM426LF4LQ .