Initial Release
This commit is contained in:
1
layouts/_default/_markup/render-link.html
Normal file
1
layouts/_default/_markup/render-link.html
Normal file
@ -0,0 +1 @@
|
||||
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text }}</a>
|
11
layouts/_default/baseof.html
Normal file
11
layouts/_default/baseof.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Lang }}" itemscope itemtype="http://schema.org/WebPage">
|
||||
{{- partial "head.html" . -}}
|
||||
<body class="dark:bg-gray-800 dark:text-white relative flex flex-col min-h-screen">
|
||||
{{- partial "header.html" . -}}
|
||||
<main class="flex-1">
|
||||
{{- block "main" . }}{{- end }}
|
||||
</main>
|
||||
{{- partial "footer.html" . -}}
|
||||
</body>
|
||||
</html>
|
36
layouts/_default/index.json
Normal file
36
layouts/_default/index.json
Normal file
@ -0,0 +1,36 @@
|
||||
{{- $.Scratch.Add "index" slice -}}
|
||||
{{- range .Site.RegularPages -}}
|
||||
{{- if .Site.Params.searchKeys -}}
|
||||
{{ $page := . }}
|
||||
{{ $dict := dict "title" $page.Title }}
|
||||
{{- range .Site.Params.searchKeys -}}
|
||||
{{- if (eq . "tags") -}}
|
||||
{{ $dict = merge $dict (dict "tags" $page.Params.tags) }}
|
||||
{{- end -}}
|
||||
{{- if (eq . "date") -}}
|
||||
{{ $dict = merge $dict (dict "date" $page.Params.Lastmod) }}
|
||||
{{- end -}}
|
||||
{{- if (eq . "categories") -}}
|
||||
{{ $dict = merge $dict (dict "categories" $page.Params.categories) }}
|
||||
{{- end -}}
|
||||
{{- if (eq . "author") -}}
|
||||
{{ $dict = merge $dict (dict "author" $page.Params.author) }}
|
||||
{{- end -}}
|
||||
{{- if (eq . "summary") -}}
|
||||
{{ $dict = merge $dict (dict "contents" $page.Summary) }}
|
||||
{{- end -}}
|
||||
{{- if (eq . "contents") -}}
|
||||
{{ $dict = merge $dict (dict "contents" $page.Content) }}
|
||||
{{- end -}}
|
||||
{{- if (eq . "link") -}}
|
||||
{{ $dict = merge $dict (dict "permalink" $page.Permalink) }}
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
{{- $.Scratch.Add "index" $dict -}}
|
||||
{{- else -}}
|
||||
{{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "date" .Params.Lastmod "categories" .Params.categories "contents" .Summary "permalink" .Permalink) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
{{- $.Scratch.Get "index" | jsonify -}}
|
15
layouts/_default/list.html
Normal file
15
layouts/_default/list.html
Normal file
@ -0,0 +1,15 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<h1 class="container px-6 pt-6 mx-auto text-3xl font-bold">{{ .Title }}</h1>
|
||||
|
||||
{{ $paginator := .Paginate .Pages.ByDate.Reverse 6 }}
|
||||
<div class="container p-6 mx-auto grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 lg:gap-8">
|
||||
{{ range $paginator.Pages }}
|
||||
{{- partial "blog-card.html" . -}}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{- partial "pagination.html" . -}}
|
||||
|
||||
{{- partial "social.html" . -}}
|
||||
{{ end }}
|
73
layouts/_default/single.html
Normal file
73
layouts/_default/single.html
Normal file
@ -0,0 +1,73 @@
|
||||
{{ define "main" }}
|
||||
{{ $lastmodstr := (partial "date.html" (dict "date" .Lastmod "language" $.Page.Language "format" "long")) }}
|
||||
{{ $datestr := (partial "date.html" (dict "date" .Date "language" $.Page.Language "format" "long")) }}
|
||||
|
||||
{{ if (and .Params.thumbnail (not (or .Site.Params.hidePageThumbnail .Params.hidePageThumbnail)) ) }}
|
||||
<div class="relative max-w-5xl mx-auto px-4">
|
||||
<img src="{{ .Params.thumbnail }}" class="rounded-lg shadow-sm w-full object-contain" />
|
||||
{{ if not (or (or .Site.Params.hideMeta .Params.hideMeta) false) }}
|
||||
<div class="absolute top-4 right-8 rounded shadow bg-white text-gray-900 dark:bg-gray-900 dark:text-white px-2 py-0.5">
|
||||
{{ $datestr }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<article class="prose lg:prose-lg mx-auto my-8 dark:prose-dark px-4">
|
||||
|
||||
<h1 class="text-2xl font-bold mb-2">{{ .Title }}</h1>
|
||||
{{ if not (or (or .Site.Params.hideMeta .Params.hideMeta) false) }}
|
||||
<h5 class="text-sm flex items-center flex-wrap">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="mr-1" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<rect x="4" y="5" width="16" height="16" rx="2" />
|
||||
<line x1="16" y1="3" x2="16" y2="7" />
|
||||
<line x1="8" y1="3" x2="8" y2="7" />
|
||||
<line x1="4" y1="11" x2="20" y2="11" />
|
||||
<rect x="8" y="15" width="2" height="2" />
|
||||
</svg>
|
||||
{{ $datestr | i18n "postedOnDate" }}
|
||||
{{ if ne $datestr $lastmodstr }}
|
||||
 {{ $lastmodstr | i18n "lastModified" }}</h5><h5 class="text-sm flex items-center flex-wrap">
|
||||
{{ else }}
|
||||
•
|
||||
{{ end }}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="mr-1" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="12" cy="12" r="9" />
|
||||
<polyline points="12 7 12 12 15 15" />
|
||||
</svg>
|
||||
{{ i18n "readingTime"}}{{ .ReadingTime }} {{ i18n "readTime" }}
|
||||
•
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="mx-1" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0" />
|
||||
<path d="M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0" />
|
||||
<line x1="3" y1="6" x2="3" y2="19" />
|
||||
<line x1="12" y1="6" x2="12" y2="19" />
|
||||
<line x1="21" y1="6" x2="21" y2="19" />
|
||||
</svg>
|
||||
{{ .WordCount }} {{ i18n "words" }}
|
||||
{{ if not (or (or .Site.Params.hideOtherLanguages .Params.hideOtherLanguages) false) }}
|
||||
{{ if .IsTranslated -}}
|
||||
{{- $sortedTranslations := sort .Translations "Site.Language.Weight" -}}
|
||||
{{- $links := apply $sortedTranslations "partial" "translation_link.html" "." -}}
|
||||
{{- $cleanLinks := apply $links "chomp" "." -}}
|
||||
{{- $linksOutput := delimit $cleanLinks (i18n "translationsSeparator") -}}
|
||||
• {{ i18n "translationsLabel" }} {{ $linksOutput }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
</h5>
|
||||
{{ end }}
|
||||
|
||||
{{ if (or .Site.Params.toc .Params.toc) }}
|
||||
{{- partial "toc.html" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ .Content }}
|
||||
</article>
|
||||
|
||||
{{- partial "comments.html" . -}}
|
||||
|
||||
{{- partial "social.html" . -}}
|
||||
{{ end }}
|
Reference in New Issue
Block a user