1

starting the blog

This commit is contained in:
2024-01-27 16:42:47 +02:00
parent 82434456d9
commit c3ef78605d
19 changed files with 343 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
{{ partial "html-meta.html" . -}}
<title>{{ if not .IsHome }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>
{{ $css := resources.Get "style.css" }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
{{ with .Site.Params.favicon -}}
<link rel="shortcut icon" href="{{ . }}" type="image/x-icon">
{{ end -}}
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
{{ end -}}
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description"
content="{{ if .Params.description }}{{ .Params.description }}{{ else }}11sync.net blog{{ end }}"
/>
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
</head>
<body>
<header>
{{ with .Site.Menus.parent -}}
<nav>
{{ range . -}}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end -}}
</nav>
{{ end -}}
<div>
<h1><a href="/">{{ .Site.Title }}</a></h1>
{{- if .Site.Params.subtitle }}<h2><a href="{{ .Site.BaseURL }}">{{ .Site.Params.subtitle }}</a></h2>{{- end }}
</div>
<nav>
{{- range .Site.Menus.main -}}
<a href="{{ .URL }}">{{ .Name }}</a>
{{- end -}}
</nav>
</header>
<main>
{{ block "main" . }}{{- end }}
</main>
<footer>
</footer>
</body>
</html>

View File

@@ -0,0 +1,14 @@
{{ define "main" -}}
<div>
<h1>{{ .Title }}</h1>
</div>
<ul class="article-list">
{{ range .Paginator.Pages -}}
<li class="article-item">
<div class="article-date">{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02 15:04") }}</div>
<div class="article-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></div>
</li>
{{ end -}}
</ul>
{{ template "_internal/pagination.html" . -}}
{{ end -}}

View File

@@ -0,0 +1,17 @@
{{ define "main" -}}
<div>
<h1>{{ .Title }}</h1>
</div>
<div>
{{ .Content -}}
</div>
<ul class="article-list">
{{ range .Paginator.Pages -}}
<li class="article-item">
<div class="article-date">{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02 15:04") }}</div>
<div class="article-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></div>
</li>
{{ end -}}
</ul>
</main>
{{ end }}

View File

@@ -0,0 +1,41 @@
{{ define "main" -}}
<article>
<div class="title">
<h1>{{ .Title }}</h1>
{{ with .Params.Subtitle -}}
<h2>{{ . }}</h2>
{{ end -}}
</div>
{{ if .Date -}}
<div class="meta">{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02 15:04") }}</div>
{{ end -}}
{{ $taxo := "tags" -}}
{{ if .Param $taxo -}}
<div class="meta">
{{ $data := newScratch }}
{{ range .Param $taxo -}}
{{ $name := . -}}
{{ with $.Site.GetPage (printf "/%s/%s" $taxo ($name | anchorize)) }}
{{ $data.Set "url" .Permalink }}
{{ end }}
{{ with $.Site.GetPage (printf "/%s/%s" $taxo ($name | urlize)) }}
{{ $data.Set "url" .Permalink }}
{{ end }}
<div class="tag"><a href="{{ $data.Get "url" }}">#{{ $name }}</a></div>
{{ end -}}
</div>
{{ end -}}
<div class="artical-body">
{{ if ne .TableOfContents "<nav id=\"TableOfContents\"></nav>" }}
{{ .TableOfContents }}
<div class="content-with-toc">
{{ .Content -}}
</div>
{{ else }}
<div class="content">
{{ .Content -}}
</div>
{{ end }}
</div>
</article>
{{ end -}}

View File

@@ -0,0 +1,14 @@
{{ define "main" -}}
<div>
{{ .Content -}}
</div>
<ul class="article-list">
{{ range (.Paginate ( where .Site.RegularPages "Type" "in" site.Params.mainSections )).Pages -}}
<li class="article-item">
<div class="article-date">{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02 15:04") }}</div>
<div class="article-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></div>
</li>
{{ end -}}
</ul>
{{ template "_internal/pagination.html" . -}}
{{ end -}}

View File

@@ -0,0 +1,15 @@
{{ with .Site.Params.googleSiteVerification -}}
<meta name="google-site-verification" content="{{ . }}">
{{ end -}}
{{ with .Site.Params.author -}}
<meta name="author" content="{{ . }}">
{{ end -}}
{{ with .Site.Params.description -}}
<meta name="description" content="{{ . }}">
{{ end -}}
{{ with .Site.Params.keywords -}}
<meta name="keywords" content="{{ . }}">
{{ end -}}
{{ with .Site.Params.referrer -}}
<meta name="referrer" content="{{ . }}">
{{ end -}}

View File

@@ -0,0 +1 @@
{{with .Get 0}}<a id="{{.}}" href="#{{.}}"><svg class="permalink" height="22px" viewBox="0 0 24 24" width="22px" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"></path><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a>{{end}}