hugo-toha/layouts/partials/sections/home.html
Hugo MARTIN 46b21e028c
Translations and i18n (#60)
* Managing i18n

* Fix absolute path

* Config files

* Home link manage langage

* Fixing footer i18n

* Implemented i18n on newsletter

* Implemented two languages in example

* Removed old section directory

* Using yaml in data to organize home summary

* Fully working for old versions without i18n

* Integrating language menu CSS

* Fix language dropdown CSS

* Refactor translation codes

* Remove duplicate code

* Fix URL issues

* Move customMenus and other site related config into data section

* Fix error during language toggle

* Only show the available translation for the posts

* Handle navbar brand URL properly

* Fix responsiveness

Co-authored-by: Hugo MARTIN <hugo.martin.69@gmail.com>
Co-authored-by: hossainemruz <emruz@appscode.com>
2020-10-03 09:59:28 +06:00

55 lines
1.7 KiB
HTML

{{ $author:= .Site.Data.author }}
{{ if (index .Site.Data .Site.Language.Lang).author }}
{{ $author = (index .Site.Data .Site.Language.Lang).author }}
{{ end }}
{{ $name:="Jane Doe" }}
{{ if $author.nickname }}
{{ $name = $author.nickname }}
{{ else if $author.name }}
{{ $name = $author.name }}
{{ end }}
{{ $sections:= .Site.Data.sections }}
{{ if (index .Site.Data .Site.Language.Lang).sections }}
{{ $sections = (index .Site.Data .Site.Language.Lang).sections }}
{{ end }}
{{ $backgroundImage:= "assets/images/default-background.jpg" }}
{{ if .Site.Params.background }}
{{ $backgroundImage = .Site.Params.background }}
{{ end }}
{{ $authorImage:= "assets/images/default-avatar.png" }}
{{ if $author.image }}
{{ $authorImage = $author.image }}
{{ end }}
<div class="container-fluid home" id="home">
<div
class="background container-fluid"
style="background-image: url('{{ $backgroundImage | absURL }}');"
></div>
<div class="container content text-center">
<img src="{{ $authorImage | absURL }}"
class="rounded-circle mx-auto d-block img-fluid"
/>
<h1 class="greeting"> {{ $author.greeting }} {{ $name }}</h1>
<div class="typing-carousel">
<span id="ityped" class="ityped"></span>
<span class="ityped-cursor"></span>
</div>
<ul id="typing-carousel-data">
{{ if $author.summary }}
{{ range $author.summary }}
<li>{{ . }}</li>
{{ end}}
{{ end }}
</ul>
{{ if $sections }}
{{ range first 1 (where (sort $sections "section.weight") ".section.enable" true) }}
<a href="#{{ replace (lower .section.name) " " "-" }}"><i class="arrow bounce fa fa-chevron-down"></i></a>
{{ end }}
{{ end }}
</div>
</div>