getpelican / pelican-plugins

Collection of plugins for the Pelican static site generator
Other
1.38k stars 849 forks source link

Combining Pelican 3.7, Page hierarchy & i18n_websites - issue with internal links #939

Open Jibec opened 6 years ago

Jibec commented 6 years ago

Hi there,

I'm working on a prototype with Pelican, Page hierarchy & i18n_websites, but can't figure out why internal links in "locales != en" doesn't work...

Can someone have a look? https://github.com/Jibec/Simon When I'm in a French translated page, all links goes to English version, but I would like them to go to french version.

For links, I use filename: [User guide]({filename}/pages/user.md) I have this for PAGE_URL = '{slug}/' and PAGE_SAVE_AS = '{slug}/index.html' Even if I remove this config and page hierarchy, it still doesn't work :(

By the way, I'm trying to rewrite the documentation of this great open-source project: https://yunohost.org/#/docs_en so more languages gets support.

Thanks for your help, I tried IRC two times and didn't find any mailing list where to ask my question. I hope this is the right place.

justinmayer commented 6 years ago

@Jibec: Were you able to find a solution to your problem here?

Jibec commented 6 years ago

Nope, I choosed to play with Hugo and Grav instead of Pelican :/

justinmayer commented 6 years ago

Thanks for responding. Cheers.

Jibec commented 6 years ago

Well, if someone is willing to try to fix this issue, I'm ready to help by testing.

Using other static generator is not by choice, I'd rather keep using pelican.

justinmayer commented 6 years ago

I see. Perhaps @smartass101 might have thoughts on this question?

smartass101 commented 6 years ago

I didn't find any translated pages in your repo ... if that is the case then I think that what is happening is that the links go to the English versions, since you have the keep options on.

Jibec commented 6 years ago

This is an old work, I think you have to build translation, which require po4a and pybabel. I'll have a look at it and will come back with an explanation and a branch with translated content so you can have a look without building anything.

Jibec commented 6 years ago

So, I created a new branch: https://github.com/Jibec/Simon/tree/pelicanhelp

Run the server on localhost:8080

(virtualenv-pelican) [jb@localhost Simon]$ pip freeze Babel==2.5.0 blinker==1.4 docutils==0.14 feedgenerator==1.9 Jinja2==2.9.6 Markdown==2.6.9 MarkupSafe==1.0 pelican==3.7.1 Pygments==2.2.0 python-dateutil==2.6.1 pytz==2017.2 six==1.10.0 Unidecode==0.4.21

Thanks for your support