Multi-language, i18n (#177)

* language menu
* allow for subdir in baseURL
* Update netlify.toml and github actions to use Hugo 0.121.1
* Documented i18n approaches in exampleSite
* Attempted & Abandoned images from assets as recommended approach in content pages- it seems Hugo expects to access those only programmatically, not via markdown.

---------

Co-authored-by: Zdenek K <zdenek.kedaj@gmail.com>
This commit is contained in:
Ilja 2024-05-19 22:41:12 +02:00 committed by GitHub
parent a1772f49e4
commit 4191af692f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 337 additions and 32 deletions

View file

@ -0,0 +1,29 @@
---
title: "Über mich (shared folder)"
weight: 3
header_menu: true
---
This demonstates localized variants `about-me.de.md` placed along the primary language content, such as `content/en`. Both localisation approaches (separate folder, suffixes in the same folder) can be used and mixed.
#### Local content
When localised page variants are placed along, images of other languages can't be used directly. You would need to use `.de`-suffixed copy of the image: `![Jane Doe](en-happy-ethnic-woman-sitting-at-table-with-laptop-3769021.de.jpg)`
Consider using assets instead.
Images from local content location can't be pipeline-processed.
#### Static
Alternatively, images can be injected from `static/images`:
![Jane Doe](/images/static-happy-ethnic-woman-sitting-at-table-with-laptop-3769021.jpg)
Note the leading `/` is required in this case.
Images from static location can't be pipeline-processed and are always copied when publishing the site, even if not linked from any page.
#### Assets
Latest Hugo version supports injection from `assets` via natural Markdown notation, which empowers this approach for injecting images since pipeline processing (resizing etc) can be used. However, It only worked for me with the local test deployment, there were issues while deploying previews Netlify. Possible workaround would be to use custom shortcode to "touch" the image via [Resources.GetMatch](https://gohugo.io/functions/resources/getmatch/). I hope this gets fixed someday.
![Broken image from assets](images/asset-happy-ethnic-woman-sitting-at-table-with-laptop-3769021.jpg)
Historically, Linking image from `assets` folder worked only via Hugo-specific shortcode, there was [a discussion with suggestions](https://discourse.gohugo.io/t/how-to-show-images-on-post-pages-if-theyre-located-in-the-assets-folder/34276/14).
Note that using images form assets folder is the only way to apply pipeline processing, such as resizing, when building the site. Fore more details, read about [asset vs static difference](https://discourse.gohugo.io/t/difference-between-asset-and-static-folder/41203)
Assets are only published if linked from a content page.

View file

@ -0,0 +1,21 @@
---
title: "About Me"
weight: 3
header_menu: true
---
<!--
Neither embedded figure shortcode, nor Markdown hook were able to render image from asset.
You would have to .Resouces.GetMatch via custom shortcode.
![Jane Doe](/images/asset-happy-ethnic-woman-sitting-at-table-with-laptop-3769021.jpg)
-->
![Jane Doe](/images/static-happy-ethnic-woman-sitting-at-table-with-laptop-3769021.jpg)
See DE language for more examples of image management. There are multiple approaches.
##### Professional Experience
A lot, but let us get into the details with some lorem ipsum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat lectus et magna placerat tincidunt. Nullam sit amet lectus vitae elit mollis rhoncus non eget lorem. Ut tempor sed dui quis volutpat.
----
In ultrices, est at lobortis pretium, magna quam mollis neque, id viverra odio est sit amet lorem. Mauris efficitur nunc vel lectus porttitor, sit amet sodales quam eleifend. Duis et felis ut mauris dignissim efficitur. Aliquam non sem eros. Integer elit ante, bibendum id hendrerit vitae, vestibulum eget risus. Nunc efficitur nisl in iaculis vestibulum.

View file

@ -0,0 +1,9 @@
---
title: "Contact"
weight: 4
header_menu: true
---
{{<contact_list>}}
Let us get in touch!

View file

@ -0,0 +1,11 @@
---
title: "Credits"
weight: 99
header_menu: true
---
In this section we give credit to authors of resources used on this demo page.
- {{<extlink text="Chef-hat icons created by Cuputo - Flaticon" href="https://www.flaticon.com/free-icons/chef-hat" icon="fa fa-external-link">}}
- {{<extlink text="sprinkle-of-rock-salt-on-sliced-vegetables-3209239 - Pexels" href="https://www.pexels.com/video/sprinkle-of-rock-salt-on-sliced-vegetables-3209239/" icon="fa fa-external-link">}}
- {{<extlink text="Earth icon - Freepik" href="https://www.freepik.com/icon/earth_2072130" icon="fa fa-external-link">}}
- {{<extlink text="happy-ethnic-woman - Pexels" href="https://www.pexels.com/photo/happy-ethnic-woman-sitting-at-table-with-laptop-3769021/" icon="fa fa-external-link">}}

View file

@ -0,0 +1,6 @@
---
title: "GitHub"
weight: 99
header_menu: true
external: https://github.com/zjedi/hugo-scroll
---

View file

@ -0,0 +1,3 @@
---
headless: true
---

View file

@ -0,0 +1,16 @@
---
title: "Brief Legal Information"
weight: 98
header_menu_title: "Legal"
navigation_menu_title: "Legal stuff"
header_menu: true
detailed_page_path: /legal/
detailed_page_homepage_content: true
---
The file **legal-brief.md** creates an internal link on the cover page without the leading icon.
If the parameter `detailed_page_homepage_content` is set to false neither this section nor the navigation menu entry will be shown (but the link on the cover page will be).
If `detailed_page_homepage_content` is set to true or is missing at all, the link, navigation menu and the content will be rendered. In that case this section might contain less or just summarized information compared to the single page referenced by the parameter `detailed_page_path`.
Want to see more about the details? See [dedicated page](legal) with more details or hit the button 'Legal' on the cover page.

View file

@ -0,0 +1,7 @@
---
footer_menu_title: License
footer_menu: true
detailed_page_path: /license/
detailed_page_homepage_content: false
weight: 91
---

View file

@ -0,0 +1,14 @@
---
title: "Welcome"
weight: 1
---
`Hugo-Scroll` theme alternates colors of sections that are placed on single page.
The landing screen is meant to be visually striking.
Single-page approach is oriented towards small to medium content length, that won't overwhelm the user.
You can also delegate lengthier, less important or more sizeable content to [dedicated pages](services).
> The belly rules the mind. --- spanish proverb
By the way this welcome section won't show in the cover menu.

View file

@ -0,0 +1,30 @@
---
title: "The Services I Offer"
header_menu_title: "Services"
navigation_menu_title: "My Services"
weight: 2
header_menu: true
---
Feature notice: This section displays options to customize title:
- has a normal section title (`title` = "The Services I Offer"),
- custom welcome screen title (`header_menu_title` = "Services"),
- custom navigation menu title (`navigation_menu_title` = "My Services").
That is the important part, right? You want to know what I can do for you. This is why I put this right up there into the header menu of the website.
---
### Nutrition Coaching
This is not an easy task.
You will likely have to pay money for this.
### Chef Consulting
I can raise your table culture!
![Let us get started on a clean slate](images/woman-pouring-juice-on-glass-3184192.jpg)
Want to learn more about my services? See [dedicated page](services) with more details.