Fixed: Layout Structure

This commit is contained in:
TheJoKlLa 2020-06-26 14:48:14 +02:00
parent aa4fc48483
commit 1b4d111f5e
12 changed files with 104 additions and 178 deletions

View File

@ -2,18 +2,31 @@
<main>
<h2>{{ .Title }}</h2>
{{ range (.Paginator 10).Pages }}
{{ if eq "Posts" $.Title }}
{{partial "list-item-post.html" .}}
{{else}}
{{ partial "list-item-project.html" . }}
<div class="list-item">
<div class="list-logo">
<a href="{{ .Permalink }}">
<img src="{{ .Params.logo }}">
</a>
</div>
<div class="list-content">
<a href="{{ .Permalink }}">
<h4>{{ .Title }}</h4>
</a>
<h5>{{ .Description }}</h5>
{{ range.Params.categories }}
<a href="{{"/categories/"|relLangURL }}{{.|urlize}}">
<kbd class="item-cat"> {{ . }} </kbd>
</a>
{{ end }}
{{ range .Params.tags }}
<a href="{{"/tags/"|relLangURL }}{{.|urlize}}">
<kbd class="item-tag"> {{ . }} </kbd>
</a>
{{ end }}
</div>
</div>
{{ end }}
</main>
{{ partial "paginator" . }}
{{ partial "footer" . }}

View File

@ -1,11 +1,13 @@
{{ partial "header" . }}
<main>
{{ if eq "Posts" $.Title }}
{{partial "post.html" .}}
{{else}}
{{ partial "project" . }}
{{end}}
<div class="item-header">
<h2>{{ .Title }}</h2>
</div>
<div class="item">
<div class="text-justify">{{ .Content }}</div>
</div>
</main>
{{ partial "footer.html" . }}
{{ partial "footer" . }}

View File

@ -1,23 +0,0 @@
{{ partial "header" . }}
<main>
<div>
<h2>{{ .Title }}</h2>
<ul class="terms">
{{ range $key, $value := .Data.Terms }}
<li>
<a href='{{ (print "/" $.Data.Plural "/" $key) | relURL }}'>
{{ $key }}
</a>
({{ len $value }})
</li>
{{ end }}
</ul>
</div>
</main>
{{ partial "footer" . }}

View File

@ -1,22 +0,0 @@
<div class="item-header">
{{ .Date.Format (.Site.Params.dateFormat | default "") | $.Scratch.Set "pub_date" }}
{{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }}
{{ with .ReadingTime }} {{ $.Scratch.Set "read_time" . }} {{ end }}
<h4>{{ .Title }}</h4>
<h5>{{ $.Scratch.Get "pub_date" }} - {{ $.Scratch.Get "read_time" }} minutes</h5>
<h5>{{ $.Scratch.Get "subtitle" }}</h5>
{{ range.Params.categories }}
<a href="{{"/categories/"|relLangURL }}{{.|urlize}}">
<kbd class="item-cat"> {{ . }} </kbd>
</a>
{{ end }}
{{ range .Params.tags }}
<a href="{{"/tags/"|relLangURL }}{{.|urlize}}">
<kbd class="item-tag"> {{ . }} </kbd>
</a>
{{ end }}
</div>

View File

@ -1,30 +0,0 @@
<div class="item-header">
{{ $.Scratch.Set "link" .RelPermalink }}
{{ with .Params.repo }}
{{ $repoHost := default "gitlab" $.Params.repoHost }}
{{ if eq "github" $repoHost }}
{{ printf "https://github.com/%s/%s/" $.Site.Params.githubUsername . | $.Scratch.Set "link" }}
{{ else if eq "gitlab" $repoHost }}
{{ printf "https://gitlab.com/%s/%s/" $.Site.Params.gitlabUsername . | $.Scratch.Set "link" }}
{{ end }}
{{ end }}
{{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }}
<a href="{{ .Scratch.Get "link" }}">
<img class="logo" src="../{{ .Params.logo }}">
<h1>{{ .Title }}</h1>
</a>
<h4>{{ $.Scratch.Get "subtitle" }}</h4>
{{ range.Params.categories }}
<a href="{{"/categories/"|relLangURL }}{{.|urlize}}">
<kbd class="item-cat"> {{ . }} </kbd>
</a>
{{ end }}
{{ range .Params.tags }}
<a href="{{"/tags/"|relLangURL }}{{.|urlize}}">
<kbd class="item-tag"> {{ . }} </kbd>
</a>
{{ end }}
</div>

View File

@ -1,21 +0,0 @@
<div class="list-item">
{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006") | $.Scratch.Set "pub_date" }}
{{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }}
{{ with .ReadingTime }} {{ $.Scratch.Set "read_time" . }} {{ end }}
<h4><a href="{{ .Scratch.Get "link" }}">{{ .Title }}</a></h4>
<h5>{{ $.Scratch.Get "pub_date" }} - {{ $.Scratch.Get "read_time" }} minutes</h5>
<h5>{{ $.Scratch.Get "subtitle" }}</h5>
{{ range.Params.categories }}
<a href="{{"/categories/"|relLangURL }}{{.|urlize}}">
<kbd class="item-cat"> {{ . }} </kbd>
</a>
{{ end }}
{{ range .Params.tags }}
<a href="{{"/tags/"|relLangURL }}{{.|urlize}}">
<kbd class="item-tag"> {{ . }} </kbd>
</a>
{{ end }}
</div>

View File

@ -1,23 +0,0 @@
<div class="list-item">
<div class="list-logo">
<a href="{{ .Permalink }}">
<img src="{{ .Params.logo }}">
</a>
</div>
<div class="list-content">
<a href="{{ .Permalink }}">
<h4>{{ .Title }}</h4>
</a>
<h5>{{ .Description }}</h5>
{{ range.Params.categories }}
<a href="{{"/categories/"|relLangURL }}{{.|urlize}}">
<kbd class="item-cat"> {{ . }} </kbd>
</a>
{{ end }}
{{ range .Params.tags }}
<a href="{{"/tags/"|relLangURL }}{{.|urlize}}">
<kbd class="item-tag"> {{ . }} </kbd>
</a>
{{ end }}
</div>
</div>

View File

@ -1,37 +0,0 @@
<div class="item">
{{ $.Scratch.Set "link" .RelPermalink }}
{{ with .Params.repo }}
{{ $repoHost := default "github" $.Params.repoHost }}
{{ if eq "github" $repoHost }}
{{ printf "https://github.com/%s/%s/" $.Site.Params.githubUsername . | $.Scratch.Set "link" }}
{{ else if eq "gitlab" $repoHost }}
{{ printf "https://gitlab.com/%s/%s/" $.Site.Params.gitlabUsername . | $.Scratch.Set "link" }}
{{ else if eq "bitbucket" $repoHost }}
{{ printf "https://bitbucket.org/%s/%s/" $.Site.Params.bitbucketUsername . | $.Scratch.Set "link" }}
{{ end }}
{{ end }}
{{ with .Params.link }} {{ $.Scratch.Set "link" . }} {{ end }}
{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006") | $.Scratch.Set "pub_date" }}
{{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }}
{{ with .ReadingTime }} {{ $.Scratch.Set "read_time" . }} {{ end }}
<h4><a href="{{ .Scratch.Get "link" }}">{{ .Title }}</a></h4>
<h5>{{ $.Scratch.Get "pub_date" }} - {{ $.Scratch.Get "read_time" }} minutes</h5>
<h5>{{ $.Scratch.Get "subtitle" }}</h5>
{{ range.Params.categories }}
<a href="{{"/categories/"|relLangURL }}{{.|urlize}}">
<kbd class="item-cat"> {{ . }} </kbd>
</a>
{{ end }}
{{ range .Params.tags }}
<a href="{{"/tags/"|relLangURL }}{{.|urlize}}">
<kbd class="item-tag"> {{ . }} </kbd>
</a>
{{ end }}
</div>

View File

@ -1,7 +1,6 @@
{{ partial "header-post" .}}
<div class="item">
<br> <div class="text-justify">{{ .Content }}</div>
<!-- related posts with the same tags -->
{{ $related := first 3 (where (where (where .Site.Pages.ByDate.Reverse ".Type" "==" "post") ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}

View File

@ -1,4 +0,0 @@
{{ partial "header-project" .}}
<div class="item">
<br> <div class="text-justify">{{ .Content }}</div>
</div>

View File

@ -0,0 +1,32 @@
{{ partial "header" . }}
<main>
<h2>{{ .Title }}</h2>
{{ range .Pages }}
<div class="list-item">
<div class="list-logo">
<a href="{{ .Permalink }}">
<img src="{{ .Params.logo }}">
</a>
</div>
<div class="list-content">
<a href="{{ .Permalink }}">
<h4>{{ .Title }}</h4>
</a>
<h5>{{ .Description }}</h5>
{{ range.Params.categories }}
<a href="{{"/categories/"|relLangURL }}{{.|urlize}}">
<kbd class="item-cat"> {{ . }} </kbd>
</a>
{{ end }}
{{ range .Params.tags }}
<a href="{{"/tags/"|relLangURL }}{{.|urlize}}">
<kbd class="item-tag"> {{ . }} </kbd>
</a>
{{ end }}
</div>
</div>
{{end}}
</main>
{{ partial "footer" . }}

View File

@ -0,0 +1,40 @@
{{ partial "header" . }}
<main>
<div class="item-header">
{{ $.Scratch.Set "link" .RelPermalink }}
{{ with .Params.repo }}
{{ $repoHost := default "gitlab" $.Params.repoHost }}
{{ if eq "github" $repoHost }}
{{ printf "https://github.com/%s/%s/" $.Site.Params.githubUsername . | $.Scratch.Set "link" }}
{{ else if eq "gitlab" $repoHost }}
{{ printf "https://gitlab.com/%s/%s/" $.Site.Params.gitlabUsername . | $.Scratch.Set "link" }}
{{ end }}
{{ end }}
{{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }}
<a href="{{ .Scratch.Get "link" }}">
<img class="logo" src="../{{ .Params.logo }}">
<h1>{{ .Title }}</h1>
</a>
<h4>{{ $.Scratch.Get "subtitle" }}</h4>
{{ range.Params.categories }}
<a href="{{"/categories/"|relLangURL }}{{.|urlize}}">
<kbd class="item-cat"> {{ . }} </kbd>
</a>
{{ end }}
{{ range .Params.tags }}
<a href="{{"/tags/"|relLangURL }}{{.|urlize}}">
<kbd class="item-tag"> {{ . }} </kbd>
</a>
{{ end }}
</div>
<div class="item">
<br> <div class="text-justify">{{ .Content }}</div>
</div>
</main>
{{ partial "footer" . }}