This repository was archived by the owner on Jan 15, 2024. It is now read-only.
Add LocalizeLinks and custom permalinks for each lang#53
Merged
kurtsson merged 2 commits intokurtsson:masterfrom Nov 19, 2015
Merged
Add LocalizeLinks and custom permalinks for each lang#53kurtsson merged 2 commits intokurtsson:masterfrom
kurtsson merged 2 commits intokurtsson:masterfrom
Conversation
Contributor
Author
kurtsson
added a commit
that referenced
this pull request
Nov 19, 2015
Add LocalizeLinks and custom permalinks for each lang
Contributor
Author
|
Thanks, I will do a PR for the Readme ASAP |
Owner
|
Thanks @jasonlemay, I will push this fix as v. 1.3.0 |
kurtsson
added a commit
that referenced
this pull request
Nov 19, 2015
* Support for localized links and custom permalinks, thanks to [@jasonlemay](#53) * Support for excluding posts from translation, thanks to [ctruelson](#51)
Closed
|
I'm not sure if I understand correctly, where do I need to add the translated permalink? |
|
@rraallvv you would put that in the frontmatter, but unfortunately it doesn't seem to be working for me. Has anybody else ran into issues that they resolved? Maybe I'm making some stupid mistake, but when I use (in this example) |
|
@hanniabu Thanks. I migrated my website to WordPress since I was able to find a cheap VPS. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi folks,
Currently, the plugin returns
/my_pageand/lang/my_pagebut I needed to produce different urls depending on the language, like/teamand/fr/equipe. I added the functionality to do so by adding a variable in the front matter like this :When french (fr) pages (or any languages) will be generated, the site will look for
permalink_frand use it if it exists, otherwise it will fallback to the defaultpermalink. In this case, it would generate/team/index.htmland/fr/equipe/index.html.I also created a new function
translate_links, returning the correct link for a specified lang or, if not specified, for the current lang.To use that, pages need to have a unique namespace variable. This might not be the best solution, but as my first time with Ruby and Jekyll, this is what I came up with.
You can also create an easy lang switcher like so :
Waiting for your comments so we can make this live, as this would definitely be a nice feature to have.