Skip to content

How to default the URL to not display the default lang in the permalink? #5075

Discussion options

You must be logged in to vote

As suggested by @yoshinorin, I looked at the site code and it appears that the HEXOJS website uses a custom helper for this:

https://github.com/hexojs/site/blob/f5f445d5391c8ae51c8c773f90f94c39307e1715/scripts/helpers.js#L83-L88

The helper extends the canonical_url function with lang support.

So basically, this is not a native HEXO feature. You have to roll your own out. Also, I noted that custom routing is configured as well: https://github.com/hexojs/site/blob/master/netlify.toml . Additionally, the language dropdown tool is managed via Javascript: https://github.com/hexojs/site/blob/f5f445d5391c8ae51c8c773f90f94c39307e1715/themes/navy/source/js/lang_select.js

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@lorezyra
Comment options

Comment options

You must be logged in to vote
1 reply
@lorezyra
Comment options

Answer selected by lorezyra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants