Initial checkin
This commit is contained in:
2
layouts/partials/main/blog-meta.html
Normal file
2
layouts/partials/main/blog-meta.html
Normal file
@@ -0,0 +1,2 @@
|
||||
{{ $last := sub (len .Params.contributors) 1 }}
|
||||
<p><small>Posted{{ if .Params.categories -}} in {{ range $index, $category := .Params.categories -}}{{ if gt $index 0 -}}, {{ end -}}<a class="stretched-link position-relative link-muted" href="{{ "/categories/" | absURL }}{{ . | urlize }}/">{{ . }}</a>{{ end -}}{{ end -}} on {{ .PublishDate.Format "January 2, 2006" }} by {{ if .Params.contributors -}}{{ range $index, $contributor := .Params.contributors }}{{ if gt $index 0 }}{{ if eq $index $last }} and {{ else }}, {{ end }}{{ end }}<a class="stretched-link position-relative" href="{{ "/contributors/" | relURL }}{{ . | urlize }}/">{{ . }}</a>{{ end -}}{{ end -}} ‐ <strong>{{ .ReadingTime -}} min read</strong></small><p>
|
4
layouts/partials/main/breadcrumb.html
Normal file
4
layouts/partials/main/breadcrumb.html
Normal file
@@ -0,0 +1,4 @@
|
||||
{{ with .Parent -}}
|
||||
{{ partial "main/breadcrumb.html" . -}}
|
||||
<li class="breadcrumb-item"><a href="{{ .RelPermalink }}">{{ if .IsHome }}Home{{ else if eq .CurrentSection .FirstSection }}{{ .Section | humanize }}{{ else }}{{ .Title }}{{ end }}</a></li>
|
||||
{{ end -}}
|
6
layouts/partials/main/date.html
Normal file
6
layouts/partials/main/date.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<!--
|
||||
Returns formatted date.
|
||||
Usage: partial "docs/date" (dict "Date" .Date "Format" .Site.Params.BookDateFormat)
|
||||
-->
|
||||
{{ $format := default "January 2, 2006" .Format -}}
|
||||
{{ return (.Date.Format $format) -}}
|
24
layouts/partials/main/docs-navigation.html
Normal file
24
layouts/partials/main/docs-navigation.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{{ if or .Prev .Next -}}
|
||||
<div class="docs-navigation d-flex justify-content-between">
|
||||
<!-- https://www.feliciano.tech/blog/custom-sort-hugo-single-pages/ -->
|
||||
{{ $pages := where site.RegularPages "Section" .Section -}}
|
||||
{{ with $pages.Next . -}}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<div class="card my-1">
|
||||
<div class="card-body py-2">
|
||||
← {{ .Title }}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{{ end -}}
|
||||
{{ with $pages.Prev . -}}
|
||||
<a class="ms-auto" href="{{ .RelPermalink }}">
|
||||
<div class="card my-1">
|
||||
<div class="card-body py-2">
|
||||
{{ .Title }} →
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{{ end -}}
|
||||
</div>
|
||||
{{ end -}}
|
34
layouts/partials/main/edit-page.html
Normal file
34
layouts/partials/main/edit-page.html
Normal file
@@ -0,0 +1,34 @@
|
||||
{{ $parts := slice .Site.Params.docsRepo }}
|
||||
|
||||
{{ if (eq .Site.Params.repoHost "GitHub") }}
|
||||
{{ $parts = $parts | append "blob" .Site.Params.docsRepoBranch }}
|
||||
{{ else if (eq .Site.Params.repoHost "Gitea") }}
|
||||
{{ $parts = $parts | append "_edit" .Site.Params.docsRepoBranch }}
|
||||
{{ else if (eq .Site.Params.repoHost "GitLab") }}
|
||||
{{ $parts = $parts | append "-/blob" .Site.Params.docsRepoBranch }}
|
||||
{{ else if (eq .Site.Params.repoHost "Bitbucket") }}
|
||||
{{ $parts = $parts | append "src" .Site.Params.docsRepoBranch }}
|
||||
{{ else if (eq .Site.Params.repoHost "BitbucketServer") }}
|
||||
{{ $parts = $parts | append "browse" .Site.Params.docsRepoBranch }}
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "docsreposubpath" }}
|
||||
{{ if not (eq .Site.Params.docsRepoSubPath "") }}
|
||||
{{ $parts = $parts | append .Site.Params.docsRepoSubPath }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $filePath := replace .File.Path "\\" "/" }}
|
||||
|
||||
{{ $parts = $parts | append "content" .Lang $filePath }}
|
||||
|
||||
{{ $url := delimit $parts "/" }}
|
||||
|
||||
<div class="edit-page">
|
||||
<a href="{{ $url }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2">
|
||||
<path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path>
|
||||
</svg>
|
||||
Edit this page on {{ .Site.Params.repoHost }}
|
||||
</a>
|
||||
</div>
|
10
layouts/partials/main/last-modified.html
Normal file
10
layouts/partials/main/last-modified.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{ if and .GitInfo .Site.Params.docsRepo -}}
|
||||
{{- $date := partial "main/date" (dict "Date" .GitInfo.AuthorDate.Local "Format" .Site.Params.BookDateFormat) -}}
|
||||
{{- $commitPath := default "commit" .Site.Params.BookCommitPath -}}
|
||||
<div class="last-modified">
|
||||
<a href="{{ .Site.Params.docsRepo }}/{{ $commitPath }}/{{ .GitInfo.Hash }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
|
||||
Last modified on {{ $date }}
|
||||
</a>
|
||||
</div>
|
||||
{{ end -}}
|
Reference in New Issue
Block a user