I just started with hugo and read a lot in the documentation which is really great.
But it is not really 100% clear for me how to structure a site.
What I would like to do is writing parts like About me, How it works, Contact, this blocks should be arranged on one single page always separated by a picture.
Ideally I have for each block a small .md file that holds the content (so it is easy to maintain and translate it).
You can say it should be a typical landing page. The navigation just point to each block with #about and so on.
If you change the link from / to /en/ you should get the complete page in English, the default language is German.
Besides this main page there will be some (1-3 subpages) hold like data protection (/datenschutz/).
Can anyone please recommend a structure how such a site should be build up with hugo. I really do not need a full example, but some tips, use the following folder structure and following types to build your own theme or use this theme to start from would really extremely help.
Thanks a lot for the links @pointyfar.
I read now all of them and started to play.
I organized now the site the following:
屉archetypes
屉assets
| 屉css
| âjs
屉content
| 屉de
| âen
屉data
屉layouts
屉resources
屉static
| âvideo
âthemes
屉bootstrap-bp-hugo-theme
| 屉.github
| 屉archetypes
| 屉assets
| | 屉css
| | âjs
| 屉i18n
| 屉images
| 屉layouts
| | 屉partials
| | 屉shortcodes
| | â_default
| âstatic
| 屉img
| | âflags
| 屉videos
| âwebfonts
This works really good, translation is working fine for template string using {{ i18n "Contact" }}.
My content has now a frontmatter like:
â
title: âWillkommenâ
date: 2020-03-14T015:00:02+01:00
type: âlandingâ
titleType: âleftâ # left, icon
showBreadcrumb: true
weight: 20
menu:
main:
name: âWillkommenâ
url: â#willkommenâ
weight: 20
pre: ââ
â
Similar approach for the english translation which is then located in en/ instead of de/.
But now I have problem filtering the data in the themes/ mytheme/layouts/index.html.
I do not know how to filter on type == âlandingâ, the language and order by weight.
I tried to do this:
{{ range where .Site.Pages.ByWeight âParams.typeâ âlandingâ}}
{{ printf â%#vâ . }}
{{ .Lang }}
{{ .Content }}
{{ end }}
But it does not work. It displays both languages. How can I only show .md files of type landing for the language the user currently is and sort this by weight?