How to default the URL to not display the default lang
in the permalink?
#5075
-
I'm building a multilingual website (mostly Asian languages). However, the default language is English. How can I configure HEXO to not require the default lang ( My For example:
My
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@lorezyra
|
Beta Was this translation helpful? Give feedback.
-
As suggested by @yoshinorin, I looked at the site code and it appears that the HEXOJS website uses a custom helper for this: The helper extends the 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 |
Beta Was this translation helpful? Give feedback.
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 withlang
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