Commit theme

This commit is contained in:
Daniel Mason 2021-11-03 22:23:25 +13:00
parent 1ec1007169
commit 690a3ff983
Signed by: idanoo
GPG key ID: 387387CDBC02F132
46 changed files with 2443 additions and 0 deletions

View file

@ -0,0 +1,7 @@
{{ define "main" }}
<div class="error-404">
<h1 class="error-404-title">O{{ partial "icon.html" (dict "ctx" $ "name" "frown") }}ps... </h1>
<p>The link you followed may be broken, or the page may have been removed.</p>
<a href="{{ "/" | relURL }}">Go home {{ partial "icon.html" (dict "ctx" $ "name" "arrow-right") }}</a>
</div>
{{ end }}

View file

@ -0,0 +1,50 @@
<!doctype html>
<html lang="{{ .Site.LanguageCode | default "en-us" }}">
<head>
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} // {{ .Site.Title }}{{ end }}</title>
<link rel="shortcut icon" href="{{ .Site.Params.favicon | default "/favicon.ico" }}" />
<meta charset="utf-8" />
{{ hugo.Generator }}
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="{{ .Site.Params.author | default "John Doe" }}" />
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}" />
{{ $style := resources.Get "css/main.scss" | resources.ExecuteAsTemplate "css/main.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint -}}
<link rel="stylesheet" href="{{ $style.Permalink }}" />
{{ template "_internal/google_analytics.html" . }}
{{ template "_internal/twitter_cards.html" . }}
{{ template "_internal/opengraph.html" . }}
</head>
<body>
<header class="app-header">
<a href="{{ .Site.BaseURL }}"><img class="app-header-avatar" src="{{ .Site.Params.avatar | default "avatar.jpg" | relURL }}" alt="{{ .Site.Params.author | default "John Doe" }}" /></a>
<h1>{{ .Site.Title }}</h1>
{{- with .Site.Menus.main }}
<nav class="app-header-menu">
{{- range $key, $item := . }}
{{- if ne $key 0 }}
{{ $.Site.Params.menu_item_separator | default " - " | safeHTML }}
{{ end }}
<a class="app-header-menu-item" href="{{ $item.URL }}">{{ $item.Name }}</a>
{{- end }}
</nav>
{{- end }}
<p>{{ .Site.Params.description | default "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vehicula turpis sit amet elit pretium." }}</p>
{{- with .Site.Params.social }}
<div class="app-header-social">
{{ range . }}
<a href="{{ .url }}" target="_blank" rel="noreferrer noopener">
{{ partial "icon.html" (dict "ctx" $ "name" .icon "title" .name) }}
</a>
{{ end }}
</div>
{{- end }}
</header>
<main class="app-container">
{{ block "main" . }}
{{ .Content }}
{{ end }}
</main>
</body>
</html>

View file

@ -0,0 +1,20 @@
{{ define "main" }}
<article>
<h1>{{ .Title }}</h1>
<ul class="posts-list">
{{ range where .Paginator.Pages "Type" "!=" "page" }}
<li class="posts-list-item">
<a class="posts-list-item-title" href="{{ .Permalink }}">{{ .Title }}</a>
<span class="posts-list-item-description">
{{ partial "icon.html" (dict "ctx" $ "name" "calendar") }}
{{ .PublishDate.Format "Jan 2, 2006" }}
-
{{ partial "icon.html" (dict "ctx" $ "name" "clock") }}
{{ .ReadingTime }} min read
</span>
</li>
{{ end }}
</ul>
{{ partial "pagination.html" $ }}
</article>
{{ end }}

View file

@ -0,0 +1,35 @@
{{ define "main" }}
<article class="post">
<header class="post-header">
<h1 class ="post-title">{{ .Title }}</h1>
{{- if ne .Type "page" }}
<div class="post-meta">
<div>
{{ partial "icon.html" (dict "ctx" $ "name" "calendar") }}
{{ .PublishDate.Format "Jan 2, 2006" }}
</div>
<div>
{{ partial "icon.html" (dict "ctx" $ "name" "clock") }}
{{ .ReadingTime }} min read
</div>
{{- with .Params.tags }}
<div>
{{ partial "icon.html" (dict "ctx" $ "name" "tag") }}
{{- range . -}}
{{ with $.Site.GetPage (printf "/%s/%s" "tags" . ) }}
<a class="tag" href="{{ .Permalink }}">{{ .Title }}</a>
{{- end }}
{{- end }}
</div>
{{- end }}
</div>
{{- end }}
</header>
<div class="post-content">
{{ .Content }}
</div>
<div class="post-footer">
{{ template "_internal/disqus.html" . }}
</div>
</article>
{{ end }}

View file

@ -0,0 +1,16 @@
{{ define "main" }}
<article>
<h1>{{ .Title }}</h1>
<ul class="tags-list">
{{ range .Data.Terms.ByCount }}
<li class="tags-list-item">
{{ partial "icon.html" (dict "ctx" $ "name" "tag") }}
<a class="tags-list-item-title" href="{{ .Page.Permalink }}">
({{ .Count }})
{{ .Page.Title }}
</a>
</li>
{{ end }}
</ul>
</article>
{{ end }}

View file

@ -0,0 +1,11 @@
{{- if isset .ctx.Site.Data.m10c.icons .name -}}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-{{ .name }}">
<title>{{ .title | default .name }}</title>
{{ safeHTML (index .ctx.Site.Data.m10c.icons .name) }}
</svg>
{{- else -}}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-link">
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
</svg>
{{- end -}}

View file

@ -0,0 +1,27 @@
{{ with $.Paginator }}
{{ if gt .TotalPages 1 }}
<ul class="pagination">
{{ with .Prev }}
<li class="page-item">
<a class="page-link" href="{{ .URL }}">
{{ partial "icon.html" (dict "ctx" $ "name" "arrow-left") }}
</a>
</li>
{{ end }}
{{ range .Pagers }}
<li class="page-item{{ if eq .PageNumber $.Paginator.PageNumber }} active{{ end }}">
<a class="page-link" href="{{ .URL }}">
{{ .PageNumber }}
</a>
</li>
{{ end }}
{{ with .Next }}
<li class="page-item">
<a class="page-link" href="{{ .URL }}">
{{ partial "icon.html" (dict "ctx" $ "name" "arrow-right") }}
</a>
</li>
{{ end }}
</ul>
{{ end }}
{{ end }}