Using yaml in data to organize home summary

This commit is contained in:
Hugo Martin 2020-08-04 22:50:11 +02:00 committed by Emruz Hossain
parent b927522a0f
commit e9af2f70d2
6 changed files with 16 additions and 10 deletions

View file

@ -0,0 +1,6 @@
summary:
- I am a Developer
- I am a Devops
- I love servers
- I work on open-source projects
- I love to work with some fun projects"

View file

@ -0,0 +1,6 @@
summary:
- Je suis un développeur
- Je suis un Devops
- J'aime les serveurs
- Je travaille sur des projets open-source
- J'aime travailler avec des projets amusants

View file

@ -8,9 +8,6 @@ other = "Home"
[resume]
other = "My resume"
[quotes]
other = "I am a Developer;I am a Devops;I love servers;I work on open-source projects;I love to work with some fun projects" # Split each quote with a ';'
[navigation]
other = "Navigation"

View file

@ -8,9 +8,6 @@ other = "Accueil"
[resume]
other = "Mon Curriculum vitæ"
[quotes]
other = "Je bidouille;Bref je code" # Split each quote with a ';'
[navigation]
other = "Naviguation"

View file

@ -58,13 +58,13 @@
<li class="nav-item">
{{ if .IsTranslated }}
<ul>
<div class="dropdown">
<div class="dropdown nav-item">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ .Site.Language.LanguageName }}
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
{{ range $.Site.Home.AllTranslations }}
<a class="dropdown-item" href="{{ .Permalink }}">
<a class="dropdown-item nav-link" href="{{ .Permalink }}">
<img class="flag" src="https://www.countryflags.io/{{ cond (eq .Site.Language.Lang "en") "gb" .Language }}/flat/32.png">
{{ .Language.LanguageName }}
</a>

View file

@ -28,8 +28,8 @@
<li>{{ . }}</li>
{{ end}}
{{ else }}
{{ range (split (i18n "quotes") ";") }}
<li>{{ . }}</li>
{{ range (index .Site.Data .Site.Language.Lang).home.summary }}
<li>{{ . }}</li>
{{ end}}
{{ end }}
</ul>