Allow multilang data

This commit is contained in:
Melkor333 2021-07-28 18:24:15 +02:00
parent f44d5f6cb7
commit 1f697a41b1
10 changed files with 29 additions and 28 deletions

View file

@ -4,21 +4,22 @@
<body>
<div class="content">
<div class="content__left">
<h1 class="mainHeading">{{.Site.Data.content.BasicInfo.FirstName}} <span>{{.Site.Data.content.BasicInfo.LastName}}</span></h1>
{{ $data := or (index .Site.Data .Site.Language.Lang).content .Site.Data.content }}
<h1 class="mainHeading">{{ $data.BasicInfo.FirstName}} <span>{{ $data.BasicInfo.LastName}}</span></h1>
{{ partial "_profile.html" . }}
{{ partial "_experience.html" . }}
{{ partial "_education.html" . }}
{{ partial "_profile.html" $data }}
{{ partial "_experience.html" $data }}
{{ partial "_education.html" $data }}
</div>
<div class="content__right">
{{ partial "_avatar.html" . }}
{{ partial "_contacts.html" . }}
{{ partial "_skills.html" . }}
{{ partial "_languages.html" . }}
{{ partial "_diplomas.html" . }}
{{ partial "_interests.html" . }}
{{ partial "_avatar.html" $data }}
{{ partial "_contacts.html" $data }}
{{ partial "_skills.html" $data }}
{{ partial "_languages.html" $data }}
{{ partial "_diplomas.html" $data }}
{{ partial "_interests.html" $data }}
</div>
</div>
</body>

View file

@ -1,7 +1,7 @@
{{ if .Site.Data.content.BasicInfo.Photo }}
{{ if .BasicInfo.Photo }}
<div class="sideSection avatar">
<div class="avatar__container">
<img class="avatar__img" src="{{ .Site.Data.content.BasicInfo.Photo }}" alt="photo of me">
<img class="avatar__img" src="{{ .BasicInfo.Photo }}" alt="photo of me">
</div>
</div>
{{ end }}

View file

@ -1,7 +1,7 @@
{{ if .Site.Data.content.BasicInfo.Contacts }}
{{ if .BasicInfo.Contacts }}
<div class="sideSection contact">
<ul>
{{ range .Site.Data.content.BasicInfo.Contacts }}
{{ range .BasicInfo.Contacts }}
<li class="contact__item">
<i class="{{ .Icon }}"></i><span>{{ .Info | safeHTML }}</span>
</li>

View file

@ -1,11 +1,11 @@
{{ if .Site.Data.content.Diplomas }}
{{ if .Diplomas }}
<div class="sideSection">
<div class="sideSection__heading">
<h2 class="sideSection__title">{{ i18n "diplomas" }}</h2>
</div>
<div class="sideSection__content">
<ul>
{{ range .Site.Data.content.Diplomas }}
{{ range .Diplomas }}
<li>{{ . | safeHTML }}</li>
{{ end }}
</ul>

View file

@ -1,4 +1,4 @@
{{ if .Site.Data.content.Education }}
{{ if .Education }}
<div id="education" class="section">
<div class="section__heading">
<h2 class="section__title">
@ -6,7 +6,7 @@
</h2>
</div>
<div class="section__content">
{{ range .Site.Data.content.Education }}
{{ range .Education }}
<div class="education__item">
<h3 class="education__title">{{ .Course | safeHTML }}</h3>
<h4 class="education__place">{{ .Place | safeHTML }}</h4>

View file

@ -1,11 +1,11 @@
{{ if .Site.Data.content.Experience }}
{{ if .Experience }}
<div id="experience" class="section">
<div class="section__heading">
<h2 class="section__title">{{ i18n "experience" }}</h2>
</div>
<div class="section__content">
<div class="experience">
{{ range .Site.Data.content.Experience }}
{{ range .Experience }}
<div class="experience__item">
<div class="experience__header">
<h3 class="experience__company">

View file

@ -1,11 +1,11 @@
{{ if .Site.Data.content.Interests }}
{{ if .Interests }}
<div class="sideSection">
<div class="sideSection__heading">
<h2 class="sideSection__title">{{ i18n "interests" }}</h2>
</div>
<div class="sideSection__content">
<ul class="interests">
{{ range .Site.Data.content.Interests }}
{{ range .Interests }}
<li class="interests__item">{{ . | safeHTML }}</li>
{{ end }}
</ul>

View file

@ -1,11 +1,11 @@
{{ if .Site.Data.content.Languages }}
{{ if .Languages }}
<div class="sideSection">
<div class="sideSection__heading">
<h2 class="sideSection__title">{{ i18n "languages" }}</h2>
</div>
<div class="sideSection__content">
<ul class="language">
{{ range .Site.Data.content.Languages }}
{{ range .Languages }}
<li class="language__item">
<div class="language__name">{{ .Name | safeHTML }}</div>
<div class="language__level">{{ .Level | safeHTML }}</div>

View file

@ -1,10 +1,10 @@
{{ if .Site.Data.content.Profile }}
{{ if .Profile }}
<div id="profile" class="section">
<div class="section__heading">
<h2 class="section__title">{{ i18n "profile" }}</h2>
</div>
<div class="section__content">
<p>{{.Site.Data.content.Profile | safeHTML }}</p>
<p>{{ .Profile | safeHTML }}</p>
</div>
</div>
{{ end }}

View file

@ -1,4 +1,4 @@
{{ if .Site.Data.content.Skills }}
{{ if .Skills }}
<div class="sideSection">
<div class="sideSection__heading">
<h2 class="sideSection__title">{{ i18n "skills" }}</h2>
@ -6,7 +6,7 @@
<div class="sideSection__content">
<ul class="skills">
<li>
{{ range .Site.Data.content.Skills }}
{{ range .Skills }}
<ul class="skills__group">
<span>{{ .Family | safeHTML }}</span>
{{ range .Items }}