lxndrblz / anatole

Anatole is a minimalistic two-column theme for Hugo.
https://themes.gohugo.io/themes/anatole/
MIT License
650 stars 356 forks source link

Multilanguage for portfolio? #397

Open v-glb opened 1 year ago

v-glb commented 1 year ago

Is your feature request related to a problem? Please describe. Hi, I really love the theme so far!

I have a question regarding multilanguage feature: Can it also be applied to the portfolio page and if so, how? It seems like that it doesn't work for it, at least I have noticed on the example site that the language switch disappears when navigation to the portfolio and couldn't get it to work on my own site.

Describe the solution you'd like Since the portfolio is configured via /data/portfolio.yml, perhaps we can create a structure with multiple .yml files (like creating multiple contentDirs for each language) like so:

image

Any questions or more information needed, just ask.

Thanks in advance, Vadim

pgrepds commented 10 months ago

This should be relatively easy to implement.

As a local quick fix, do the following:

  1. Create a portfolio directory inside layouts.
  2. Copy layouts/portfolio/list.html from the GitHub repository of the theme to the directory created in the first step.

Then, replace the second line of list.html with

{{ $data := index .Site.Data .Site.Language.Lang }}
{{ range $index, $elemen:= $data.portfolio.portfolioitems }}

Be aware that this overrides the list.html implementation of the theme. Thus, for future updates you need to merge manually.