Comments (17)
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.
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.
@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.
We don't have a good use case for this, so let's not bother at this time.
from turbolinks-classic.
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.
@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.
@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.
@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.
@jehughes Cool, thanks ... It's good to know SEO is not sacrificed when using Turbolinks :)
from turbolinks-classic.
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.
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.
@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.
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.
Yes. @dhh
from turbolinks-classic.
I extend the current turbolinks js ;)
https://github.com/philklei/turbolinks
from turbolinks-classic.
Adding the meta tags above including Turbolinks does not work for me. The tags don't update....
from turbolinks-classic.
@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)
- Page does not always scroll to the top when DOM loads too fast
- SVG anchors not working with turbolinks
- Turbolinks.visit, partial replacement & relative urls (& IE11)
- Not correctly inferring protocol with SSL, unless force_ssl is set HOT 2
- Redirect and reload full page HOT 1
- JavaScript part of turbolinks on npm HOT 11
- Enable Turbolinks on a-tags after adding content over AJAX HOT 1
- File type blacklist instead of whitelist
- Scroll position of data-turbolinks-permanent elements lost on navigation. HOT 3
- Webpage without title, after turbolink has title of undefined HOT 1
- Problems with JS HOT 1
- Rails 5 deprecations
- Would you please tell me how to add your library or whether it's necessary to add this library?
- Sorry for duplicate
- Progress bar causing capybara tests to fail
- Documentation does not explain how to install current turbolinks-classic version HOT 1
- temporary inside permanent
- Clicking browser back button from an error page to a non-error page, retains the styles of the error page
- Turbolinks.enableProgressBar() returns undefined
- How to binding "page:load" cache-preview
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turbolinks-classic.