Fetch menus from YAML
This commit is contained in:
parent
7a4c8fd24b
commit
045c2e3495
@ -30,15 +30,6 @@ DefaultContentLanguage = "en"
|
|||||||
[languages.en.params]
|
[languages.en.params]
|
||||||
home = '/'
|
home = '/'
|
||||||
madeWith = '[Feito de pedra](/posts/sites-de-pedra)' # You can use markdown here if you want to link somewhere
|
madeWith = '[Feito de pedra](/posts/sites-de-pedra)' # You can use markdown here if you want to link somewhere
|
||||||
[languages.en.menu]
|
|
||||||
[[languages.en.menu.main]]
|
|
||||||
name = 'Home'
|
|
||||||
url = '/'
|
|
||||||
weight = 1
|
|
||||||
[[languages.en.menu.main]]
|
|
||||||
name = 'Blog'
|
|
||||||
url = '/blog'
|
|
||||||
weight = 2
|
|
||||||
[languages.pt]
|
[languages.pt]
|
||||||
title = "Site Exemplo"
|
title = "Site Exemplo"
|
||||||
languageName = "Português 🇧🇷"
|
languageName = "Português 🇧🇷"
|
||||||
@ -47,15 +38,6 @@ DefaultContentLanguage = "en"
|
|||||||
[languages.pt.params]
|
[languages.pt.params]
|
||||||
home = '/pt'
|
home = '/pt'
|
||||||
madeWith = '[Feito de pedra](/posts/sites-de-pedra)' # You can use markdown here if you want to link somewhere
|
madeWith = '[Feito de pedra](/posts/sites-de-pedra)' # You can use markdown here if you want to link somewhere
|
||||||
[languages.pt.menu]
|
|
||||||
[[languages.pt.menu.main]]
|
|
||||||
name = 'Home'
|
|
||||||
url = '/pt'
|
|
||||||
weight = 1
|
|
||||||
[[languages.pt.menu.main]]
|
|
||||||
name = 'Blog'
|
|
||||||
url = '/pt/blog'
|
|
||||||
weight = 2
|
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
# The "description" of your website. This is used in the meta data of your generated html.
|
# The "description" of your website. This is used in the meta data of your generated html.
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
title: "Início"
|
||||||
|
menu: "main"
|
||||||
|
weight: 1
|
||||||
|
---
|
||||||
|
|
||||||
# Um par divino
|
# Um par divino
|
||||||
|
|
||||||
There is a website obesity crisis. Bloated websites full of scripts, ads, and trackers are slowing your readers down every time they try to read your well-crafted content.
|
There is a website obesity crisis. Bloated websites full of scripts, ads, and trackers are slowing your readers down every time they try to read your well-crafted content.
|
||||||
|
5
exampleSite/content.pt/blog/_index.md
Normal file
5
exampleSite/content.pt/blog/_index.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
title: "Blog"
|
||||||
|
menu: "main"
|
||||||
|
weight: 2
|
||||||
|
---
|
@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
title: "Home"
|
||||||
|
menu: "main"
|
||||||
|
weight: 1
|
||||||
|
---
|
||||||
|
|
||||||
# A match made in heaven
|
# A match made in heaven
|
||||||
|
|
||||||
There is a website obesity crisis. Bloated websites full of scripts, ads, and trackers are slowing your readers down every time they try to read your well-crafted content.
|
There is a website obesity crisis. Bloated websites full of scripts, ads, and trackers are slowing your readers down every time they try to read your well-crafted content.
|
||||||
|
5
exampleSite/content/blog/_index.md
Normal file
5
exampleSite/content/blog/_index.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
title: "Blog"
|
||||||
|
menu: "main"
|
||||||
|
weight: 2
|
||||||
|
---
|
@ -1,4 +1,4 @@
|
|||||||
{{ range .Site.Menus.main }}
|
{{ range .Site.Menus.main.ByWeight }}
|
||||||
<a href="{{ .URL | absLangURL }}">{{ .Name }}</a>
|
<a href="{{ .URL | absLangURL }}">{{ .Name }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<a href="mailto:{{ .Site.Params.email }}?subject={{ i18n "email-subject" }}'{{ .Page.Title | default .Site.Title }}'">Email</a>
|
<a href="mailto:{{ .Site.Params.email }}?subject={{ i18n "email-subject" }}'{{ .Page.Title | default .Site.Title }}'">Email</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user