mirror of
https://gitlab.com/fabinfra/fabinfra-theme.git
synced 2025-03-12 14:41:51 +01:00
Update: Project List
This commit is contained in:
parent
cd846d47de
commit
4c4122a921
@ -7,7 +7,7 @@
|
||||
{{ if eq "Posts" $.Title }}
|
||||
{{partial "list-item-post.html" .}}
|
||||
{{else}}
|
||||
{{ partial "list-item-project" . }}
|
||||
{{ partial "list-item-project.html" . }}
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
|
@ -1,38 +1,11 @@
|
||||
{{ partial "header" . }}
|
||||
|
||||
<main>
|
||||
|
||||
{{ partial "list-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) }}
|
||||
|
||||
{{ if $related }}
|
||||
|
||||
<h4 class="page-header">Related</h4>
|
||||
|
||||
{{ range $related }} {{ partial "list-item" . }} {{ end }}
|
||||
|
||||
{{ if eq "Posts" $.Title }}
|
||||
{{partial "post.html" .}}
|
||||
{{else}}
|
||||
{{ partial "project" . }}
|
||||
{{end}}
|
||||
|
||||
{{ if and .Site.DisqusShortname (not .Params.disableComments) }}
|
||||
|
||||
<h4 class="page-header">Comments</h4>
|
||||
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.talkHost }}
|
||||
{{ partial "talk.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.coralHost }}
|
||||
{{ partial "coral.html" . }}
|
||||
{{ end }}
|
||||
|
||||
</main>
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
|
22
layouts/partials/header-post.html
Normal file
22
layouts/partials/header-post.html
Normal file
@ -0,0 +1,22 @@
|
||||
<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>
|
29
layouts/partials/header-project.html
Normal file
29
layouts/partials/header-project.html
Normal file
@ -0,0 +1,29 @@
|
||||
<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 .Params.link }} {{ $.Scratch.Set "link" . }} {{ end }}
|
||||
{{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }}
|
||||
|
||||
|
||||
<h4><a href="{{ .Scratch.Get "link" }}">{{ .Title }}</a></h4>
|
||||
<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>
|
@ -1,18 +1,4 @@
|
||||
<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 }}
|
||||
|
||||
<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 }}
|
||||
|
@ -1,17 +1,5 @@
|
||||
<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 }}
|
||||
<div class="list-item">
|
||||
{{ with .Permalink }} {{ $.Scratch.Set "link" . }} {{ end }}
|
||||
|
||||
{{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }}
|
||||
{{ with .ReadingTime }} {{ $.Scratch.Set "read_time" . }} {{ end }}
|
||||
@ -29,4 +17,5 @@
|
||||
<kbd class="item-tag"> {{ . }} </kbd>
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
</div>
|
23
layouts/partials/post.html
Normal file
23
layouts/partials/post.html
Normal file
@ -0,0 +1,23 @@
|
||||
{{ 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) }}
|
||||
|
||||
{{ if $related }}
|
||||
|
||||
<h4 class="page-header">Related</h4>
|
||||
|
||||
{{ range $related }} {{ partial "list-item" . }} {{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Site.DisqusShortname (not .Params.disableComments) }}
|
||||
|
||||
<h4 class="page-header">Comments</h4>
|
||||
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
|
||||
{{ end }}
|
||||
</div>
|
4
layouts/partials/project.html
Normal file
4
layouts/partials/project.html
Normal file
@ -0,0 +1,4 @@
|
||||
{{ partial "header-project" .}}
|
||||
<div class="item">
|
||||
<br> <div class="text-justify">{{ .Content }}</div>
|
||||
</div>
|
@ -202,3 +202,7 @@ img {
|
||||
background-color: var(--accent) !important;
|
||||
color: #f8f8f8 !important;
|
||||
}
|
||||
.list-item {
|
||||
padding-top: 5px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user