Comments (7)
Short, more later: so you know
http://www.yearofmoo.com/2012/11/angularjs-and-seo.html ?
from angular-translate.
I think we should ask the awesome @cburgdorf what he thinks about that. So,
Chris?
from angular-translate.
Ok, as my wife turned 30 just today, I'm faced with some time constraints. So here is the quick and dirty guide on what to do:
- setup grunt-html-snapshot to create snapshots of all pages of your site. Currently you need to list each page that should be saved (as it can be seen here: https://github.com/cburgdorf/couch-website/blob/master/Gruntfile.js#L16) With a future improvement of the grunt task, the task could spider the site itself to figure out all pages to take snapshots from. (Patches anyone?)
- Make sure 1.) is part of your release step and the snapshots are stored among all the other files that usually go into your
dist
folder. We currently save all snapshots into the root level of ourdist
folder so that we have files likesnapshot____de-de_about.html
directly placed next to theindex.html
file.
See: https://github.com/cburgdorf/couch-website/blob/release/snapshot____de-de_about.html
3.Then configure your webserver to spit out those templates according to the hashbang spec. E.g. www.mypage.com/#/foo will be requested from your server as www.mypage.com/?_escaped_fragment_=/foo. So just configure your webserver to hand out the correct snapshot when it sees such a request.
- Also add
<meta name="fragment" content="!">
so for pages that don't have a hashbang in it's URL but still depend on client side js to be functional. That's usually the root page of your side. With this meta tag we make sure that the google also requests www.mypage.com as www.mypage.com?/_escaped_fragment_= even so it has no hashbang itself.
Hope that helps.
from angular-translate.
Thanks for you input Chris!
from angular-translate.
Maybe I'm wrong, but it looks like there's nothing angular-translate can really do to help out there, right? Isn't it more an application-level thing, where the app has to figure out which language should be used and then tell angular-translate about it?
So my actual question, with the given construct and tips @cburgdorf gave us here, is it possible to generate these snapshots in different languages using angular-translate or not? And if not, is there anything you need from angular-translate to get this working? If so, lemme know so I can implement what you need and make it a feature in 1.0
release.
from angular-translate.
I must agree that I don't see how angular-translate
could help here. The different languages should be accessible via URL (e.g. mySite.com/en/foo vs mySite.com/de/foo) and then be saved via grunt-html-snapshot
individually (e.g. https://github.com/cburgdorf/couch-website/blob/master/Gruntfile.js#L16).
from angular-translate.
This is exactly what I thought too! So I will close this for now. We can reopen this one, if needed. @Skivvies nevertheless, keep us up-to-date with your experiences!
from angular-translate.
Related Issues (20)
- Use templated string as key HOT 1
- bower repo doesn't have latest release tag HOT 3
- De-cloaking broken in 2.18.2 HOT 4
- Default interpolationParams allows access to function constructor HOT 1
- translate dynamic content loaded with ajax HOT 1
- How to use UI router with angular translate? HOT 1
- [email protected] support HOT 5
- translate-sanitize-strategy HOT 4
- “SameSite” attribute warning HOT 1
- Not changing languages on ng-click
- Cookie “NG_TRANSLATE_LANG_KEY” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. HOT 9
- Two Languages at same time HOT 1
- IOS cordova When i upgrade the AngularJs to 1.8.2 the words will be missed which was been translated. HOT 1
- Using AngularJS Filters with Pluralization via MessageFormat HOT 1
- $translatePartialLoader.doesnot allow ë à á characters HOT 4
- $translate.instant with angular expression HOT 1
- Unexpected behavior registering translations with .translations() and using an async loader with .forceAsyncReload(true) HOT 3
- Partial loading can fail silently without any hints HOT 1
- $translateStaticFilesLoader should behave gracefully when one of translations cannot be loaded HOT 1
- Team awareness required: Future project state HOT 7
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 angular-translate.