darktable-org / dtdocs

darktable user manual
GNU General Public License v3.0
74 stars 74 forks source link

Render every language into its own folder, including English/The epub build is broken #345

Closed paperdigits closed 2 years ago

paperdigits commented 3 years ago

@elstoc mentioned we should render English into its own subdirectory, e.g. en-us, fr-fr, etc etc.

Is this the only way to do this in Hugo? https://gohugo.io/content-management/multilingual/#configure-multilingual-multihost

paperdigits commented 3 years ago

Doing this should also allow us to package the epub relatively easily, no?

paperdigits commented 3 years ago

During the epub build, in the currently failed action, hugo is putting each language in its own folder, including English. I'm not sure when it started doing that, but the epub looks like it has no content, even though it made the .epub file.

elstoc commented 3 years ago

@paperdigits: for now, for the darktable.org builds of dtdocs we need to build epub and pdf documents without translations. The CI already does this so I would suggest running the same code that the CI does when building.

I think I've fixed the issue with the CI now.

paperdigits commented 2 years ago

The search is also broken for non-English languages. The correct index.json is created in each language, but we've hard-coded the URL and it points to the English index.json file.

Right now in app.js we have the following:

// Initialize lunrjs using our generated index file
function initLunr() {
    var request = new XMLHttpRequest();
    request.open('GET', '{{ "index.json" | absURL }}', true);

lunr.js supports multi-lingual files, as noted here: https://lunrjs.com/guides/language_support.html

elstoc commented 2 years ago

I fixed this yesterday and search now works for all languages on gh pages

paperdigits commented 2 years ago

I think for the epub, we'll just need to copy all the images into place after we build the HTML.

Something like this should work:

find /source -regextype posix-extended -regex '.*(gif|jpg)' \
    -exec cp --parents {} /dest \; -print
paperdigits commented 2 years ago

This works, it just needs to be looped:

cd content && find ./ -regextype posix-extended -regex '.*(gif|jpg|png|svg)' -exec cp --parents {} ../public-epub/de \; -print

github-actions[bot] commented 2 years ago

This issue has not had any activity in the past 60 days and will be closed in 365 days if not updated.

elstoc commented 2 years ago

This is done now