Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update markdown yaml headers to support titles and links for compatibility with the theme #138

Open
wants to merge 2 commits into
base: ja
Choose a base branch
from

Conversation

TomKellyGenetics
Copy link
Member

The main title is defined by title: in _config.yml so would need changes to the theme to allow this to be translated.

We can add titles to the index.html files to change these labels for the "Home" button.

Screen Shot 2020-11-16 at 18 56 52

@joelnitta
Copy link
Member

I'm confused... you say "main title is defined by title: in _config.yml" (where _config.yml is within each lesson submodule, I assume), but then why does this PR have only edits to the PO file?

@TomKellyGenetics
Copy link
Member Author

It's complicated. The "title" yaml field in the index.md markdown files changes the name of the webpage (as shown in the globe drop down menu). I can change this and the "permalink" fields in the submodules to display the webpages correctly but generating a fresh translation from the PO files would overwrite them.

So we can either:

  • translate the yaml headers in the markdown files in the PO file (tedious)

  • automate these changes with the wrapper.sh script (will need to consider different cases as source lessons are slightly different)

There are 2 issues here.

Main titles

I've tried changing them for each lesson but the blue text comes from the config.yml file in the main English lesson. You cannot add a config.yml to the translated submodules (this breaks the English lesson). Supporting different lesson titles requires changes to the carp-theme repo. David has some ideas on how to do this.

Links

A few pages didn't display. The main offender was getting back to the main index in English with the "Home" button. The changes to the theme to fix this required other changes in the translated lessons.

A permalink field is required to redirect to the right pages as the main English lesson and translated submodules have different HTML file/directory names which need to be different to be compatible with the theme:

carpentries-i18n/carp-theme#8
carpentries-i18n/carpentry-theme#12

See these changes for an example:
swcarpentry/python-novice-gapminder@e52835a
swcarpentry/python-novice-gapminder@gh-pages...carpentries-i18n:gh-pages
Headings here: https://github.com/carpentries-i18n/git-novice-es/

Based on these changes I've managed to fix the links and checked the webpages direct to the right page. I still need to change the wrapper script or the PO files to make sure updating doesn't overwrite this. Now that I know the changes needed, it shouldn't take long to restore it if we trigger GitHub Actions and break the links.

@TomKellyGenetics TomKellyGenetics changed the title Define lesson titles in file headers for locale index Update markdown yaml headers to support titles and links for compatibility with the theme Nov 22, 2020
@TomKellyGenetics
Copy link
Member Author

Related issue: #139

@TomKellyGenetics TomKellyGenetics added the technical For improvements to scripts and issues with webpages label Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical For improvements to scripts and issues with webpages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants