Commit a1356f01 authored by Nicolas Guichard's avatar Nicolas Guichard 😿
Browse files

Merge branch 'git-infos' into 'master'

Git infos

See merge request !2
parents 69f895bb ee89b237
Pipeline #5153 passed with stages
in 26 seconds
......@@ -3,6 +3,9 @@ image: registry.gitlab.com/pages/hugo:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- apk add --update --no-cache git
test:
script:
- hugo
......
......@@ -3,6 +3,7 @@ languageCode = "fr"
defaultContentLanguage="fr"
theme = "terminal"
paginate = 5
enableGitInfo = true
[params]
# dir name of your blog content (default is `content/posts`)
......
{{ define "main" }}
<div class="posts">
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
{{ $PageContext := . }}
{{ if .IsHome }}
{{ $PageContext = .Site }}
{{ end }}
{{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }}
{{ range $paginator.Pages }}
<div class="post on-list">
<div class="post-meta post-meta-orig">
{{ if .Params.Date }}
<span class="post-date">
{{ .Date.Format "02/01/2006" }}
</span>
{{ end }}
{{ with .Params.Author }}::
<span class="post-author">
{{ . }}
</span>
{{ end }}
</div>
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}">
{{- . -}}
</a>&nbsp;
{{ end }}
</span>
{{ end }}
{{ with .Params.Cover }}
<img src="{{ . | absURL }}" class="post-cover" />
{{ end }}
<div class="post-content">
{{ if .Params.showFullContent }}
{{ .Content | markdownify }}
{{ else if .Description }}
{{ .Description | markdownify }}
{{ else }}
{{ if .Truncated }}
{{ .Summary | markdownify }}
{{ end }}
{{ end }}
</div>
{{ if not .Params.showFullContent }}
<div>
<a class="read-more button"
href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
</div>
{{ end }}
</div>
{{ end }}
{{ partial "pagination.html" . }}
</div>
{{ end }}
{{ define "main" }}
<div class="post">
<div class="post-meta post-meta-orig">
{{ if .Params.Date }}
<span class="post-date">
{{ .Date.Format "02/01/2006" }}
</span>
{{ end }}
{{ with .Params.Author }}::
<span class="post-author">
{{ . }}
</span>
{{ end }}
</div>
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
{{ with .GitInfo }}
<div class="post-meta post-meta-git">
Dernière modification le
<span class="post-date">
{{ .AuthorDate.Format "02/01/2006" }}
</span>
::
#<a href="https://gitlab.ensimag.fr/ensilibre/ensilibre.pages.ensimag.fr/commit/{{ .Hash }}"
>{{ .AbbreviatedHash }}</a
>
</div>
{{ end }}
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
{{ with .Params.Cover }}
<img src="{{ . | absURL }}" class="post-cover" />
{{ end }}
<div class="post-content">
{{ .Content }}
</div>
{{ if or .NextInSection .PrevInSection }}
<div class="pagination">
<div class="pagination__title">
<span
class="pagination__title-h">{{ $.Site.Params.ReadOtherPosts }}</span>
<hr />
</div>
<div class="pagination__buttons">
{{ if .NextInSection }}
<span class="button previous">
<a href="{{ .NextInSection.Permalink }}">
<span class="button__icon"></span>
<span class="button__text">{{ .NextInSection.Title }}</span>
</a>
</span>
{{ end }}
{{ if .PrevInSection }}
<span class="button next">
<a href="{{ .PrevInSection.Permalink }}">
<span class="button__text">{{ .PrevInSection.Title }}</span>
<span class="button__icon"></span>
</a>
</span>
{{ end }}
</div>
</div>
{{ end }}
{{ partial "comments.html" . }}
</div>
{{ end }}
.post-meta-orig {
float: right;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment