diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-03-31 09:22:51 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-04-07 16:25:08 +0100 |
commit | ed82c3899e566bad738af7633c8246a05a4d373e (patch) | |
tree | 12e36c0fd5b6fc5db3156a2eaecbe2ff93d16792 | |
parent | 17b5a0027c8fe80bc9eef390c6a9d8e8c4f3cb25 (diff) |
Add notes about linking to oter pages
The Spanish translations use {{ page.baseurl }}/original/english/path so
that we don't have to change every url when we import a page after
translation.
-rw-r--r-- | README.md | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -76,3 +76,18 @@ node_modules/.bin/bower install Then use bower to install a new library and add it to the `Gruntfile.js`. +## Linking to other pages + +Use `page.baseurl` to link to another page inside the repository. + + <a href="{{ page.baseurl }}/english/path/to/page">Some Page</a> + +`page.baseurl` captures the current locale and inserts it in to the path if the +user is not in the default locale (`EN`). Only use `site.baseurl` for linking +to pages or assets that do not have a translation. + +_NOTE:_ `page.baseurl` does not include a trailing slash, so you must add this +after the liquid tags (`}}/`). On the other hand, `site.baseurl` _is_ a slash, +which is why you see the next part of the path hard up against the liquid tags +(`}}assets`). + |