Giter Site home page Giter Site logo

Comments (17)

davydotcom avatar davydotcom commented on August 16, 2024

Im not sure this is necessary. As, when you may share your page on facebook, I believe facebook makes a full load request to get these opengraph tags. So as long as they get changed on a full page reload, I do not believe turbolinks needs to change these.

from turbolinks-classic.

davydotcom avatar davydotcom commented on August 16, 2024

But it does bring up a point of customizing what may get loaded from a turbolinks request. and what we store in the cache. @dhh, would it potentially be a good idea to pass the pageCache object as a parameter to the triggered page:change and page:load events so the received document can be scanned for any custom headers a user may need?

from turbolinks-classic.

fred avatar fred commented on August 16, 2024

@davydotcom Very good point. I did not think about that, indeed Facebook/twitter/googleplus will all get a full reloaded page to get fresh headers.

I guess its not really necessary to have this feature after all.

from turbolinks-classic.

dhh avatar dhh commented on August 16, 2024

We don't have a good use case for this, so let's not bother at this time.

from turbolinks-classic.

hgani avatar hgani commented on August 16, 2024

Hi,

How about for SEO purposes? As a search engine crawler follows the links on our website, we want the meta tags to be refreshed to reflect the currently crawled page

Cheers

from turbolinks-classic.

jehughes avatar jehughes commented on August 16, 2024

@hgani I'm finding that as long as I set meta tags before including turbolinks in the <head> section, they update fine on each page.

from turbolinks-classic.

hgani avatar hgani commented on August 16, 2024

@jehughes thanks for the response

Do you mean something like this?

<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>

Is this a documented behaviour? For some reason, I missed this.

Cheers

from turbolinks-classic.

jehughes avatar jehughes commented on August 16, 2024

@hgani Yes, exactly. If it's in the docs, I missed it as well :) I saw the comment at the bottom of this blog post that got me pointed in this direction.

Here's a gist of the code I ended up with.

from turbolinks-classic.

hgani avatar hgani commented on August 16, 2024

@jehughes Cool, thanks ... It's good to know SEO is not sacrificed when using Turbolinks :)

from turbolinks-classic.

maxgronlund avatar maxgronlund commented on August 16, 2024

Ok I tested and tripple tested,

Facebook has a scraper where you can type in the url for the page you want to test:
https://developers.facebook.com/tools/debug

1: Try to input. a url for a page where i injected the metatags using jquery
2: nothing found

3: inspected the page I can se the meta tags, I used jquery to inject them after the page loaded
4: at the bottom of the https://developers.facebook.com/tools/debug page there is a little link
'Scraper URL' If I expand that there is no meta tags

Conclusion Facebook don't execute javascripts ha ha. foolish me

inserting meta tags before including turbolinks dont work for me, so I'm not quite done

from turbolinks-classic.

arkmediastudio avatar arkmediastudio commented on August 16, 2024

Hi
I am using share-button https://github.com/carrot/share-button and i have problem with meta tags not being updated. For facebook it works but for twitter and google+ it is not working, it gets the meta tags of the page with had a full reload. So can we please have an option to atleast update the below three common meta tags when using turbolinks?. Turn that off by default and if some wants it they can turn it on?.

meta[property="og:title"]
meta[property="og:image"]
meta[property="og:description"]

from turbolinks-classic.

arkmediastudio avatar arkmediastudio commented on August 16, 2024

@reed what do you think about my comment above?. Does this use case justify the need to add the ability to get the meta tags to be updated when using turbolinks?.

Thank You

from turbolinks-classic.

reed avatar reed commented on August 16, 2024

In the past, I've been alright with adding support for meta tag management, so I think it's @dhh you should be asking.

from turbolinks-classic.

arkmediastudio avatar arkmediastudio commented on August 16, 2024

Yes. @dhh

from turbolinks-classic.

philklei avatar philklei commented on August 16, 2024

I extend the current turbolinks js ;)

https://github.com/philklei/turbolinks

from turbolinks-classic.

ncri avatar ncri commented on August 16, 2024

Adding the meta tags above including Turbolinks does not work for me. The tags don't update....

from turbolinks-classic.

quindici avatar quindici commented on August 16, 2024

@dhh. You are right that when scraper discover a page it would fire a full page load request. However lots of sharing service does extract the meta tag and pass the card related information to social media directly. When Facebook get this urls for the first time, it would just cached what's given so the scraper does not work. Something flexibility to allow meta tags to be updated is very much needed.

from turbolinks-classic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.