From 7b4b78ee8458b16a6167170bf7405d7bf911cfbc Mon Sep 17 00:00:00 2001 From: Francesco Date: Mon, 22 Apr 2024 13:19:56 +0200 Subject: Initial --- layouts/_default/baseof.html | 31 +++++++++++++++++ layouts/_default/home.html | 58 +++++++++++++++++++++++++++++++ layouts/_default/list.html | 18 ++++++++++ layouts/_default/single.html | 45 ++++++++++++++++++++++++ layouts/partials/footer.html | 5 +++ layouts/partials/head.html | 10 ++++++ layouts/partials/head/css.html | 11 ++++++ layouts/partials/head/js.html | 12 +++++++ layouts/partials/header.html | 20 +++++++++++ layouts/partials/math.html | 9 +++++ layouts/partials/pagination-controls.html | 23 ++++++++++++ layouts/partials/post-entry.html | 4 +++ 12 files changed, 246 insertions(+) create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/home.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/head/css.html create mode 100644 layouts/partials/head/js.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/math.html create mode 100644 layouts/partials/pagination-controls.html create mode 100644 layouts/partials/post-entry.html (limited to 'layouts') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..eef7b25 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,31 @@ + + + + + {{ partial "head.html" . }} + {{ if .Param "math" }} + {{ partialCached "math.html" . }} + {{ end }} + + + + +
+
+ {{ partial "header.html" . }} +
+ +
+ {{ block "main" . }}{{ end }} +
+
+ + + + + + + \ No newline at end of file diff --git a/layouts/_default/home.html b/layouts/_default/home.html new file mode 100644 index 0000000..bc3aad8 --- /dev/null +++ b/layouts/_default/home.html @@ -0,0 +1,58 @@ +{{ define "main" }} + +{{ .Content }} + +{{/* Intro summary section */}} +{{ if .Site.Params.homeIntro }} + +
+ {{ if .Site.Params.homeIntroTitle }} +

{{ .Site.Params.homeIntroTitle }}

+ {{ end }} + + {{ if .Site.Params.homeIntroContent }} +

{{ .Site.Params.homeIntroContent | markdownify }}

+ {{ end }} +
+ +{{ end }} + +{{/* Social Icons */}} + +{{ with site.Params.social }} +
+ {{- range . }} + + {{ partial "svg.html" . }} + + {{- end }} +
+{{ end }} + +{{/* Collection Section */}} + +{{ if .Site.Params.homeCollection }} + +{{ with .Site.Params.homeCollectionTitle}} +

{{ . }}

+{{ end }} + +{{ $pages := where .Site.RegularPages "Section" .Site.Params.homeCollection }} + +{{ $paginationSize := 1}} +{{ if (gt .Site.Params.paginationSize 0) }} +{{ $paginationSize = .Site.Params.paginationSize }} +{{ end }} + +{{ $paginator := .Paginate $pages $paginationSize }} + +{{ range $index, $page := $paginator.Pages }} +{{ partial "post-entry.html" $page}} +{{ end }} + +{{ partial "pagination-controls.html" $paginator}} + +{{ end }} + +{{ end }} \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..8c52a86 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,18 @@ +{{ define "main" }} +

{{ .Title }}

+{{ .Content }} + +{{ $paginationSize := 1}} +{{ if (gt .Site.Params.paginationSize 0) }} +{{ $paginationSize = .Site.Params.paginationSize }} +{{ end }} + +{{ $paginator := .Paginate (.Pages) $paginationSize }} + +{{ range $index, $page := $paginator.Pages }} +{{ partial "post-entry.html" $page}} +{{ end }} + +{{ partial "pagination-controls.html" $paginator}} + +{{ end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..b68da6c --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,45 @@ +{{ define "main" }} + +{{/* Intro */}} + +
+ + {{/* Title and Summary */}} + +

{{ .Title }}

+ {{if .Param "summary" }} +

{{ .Summary }}

+ {{ end }} + + {{/* Reading Time */}} + +

+ {{if .Date }} + {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} + {{ $dateHuman := .Date | time.Format ":date_long" }} + + - + {{end}} + {{if (.Param "readTime")}} + {{.ReadingTime}} min + {{end }} +

+ +
+ +{{/* Table of Content */}} + +{{if .Param "toc" }} + +{{ end }} + +{{/* Actual document content */}} + +
+ {{ .Content }} +
+ +{{ end }} \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..65f97aa --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,5 @@ +

Powered by + Hugo + {{/* and + tomfran/typo */}} +

\ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..a16d7ea --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,10 @@ + + +{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }} +{{ partialCached "head/css.html" . }} +{{ partialCached "head/js.html" . }} + + +{{ if hugo.IsProduction }} +{{ template "_internal/google_analytics.html" . }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html new file mode 100644 index 0000000..abca3b8 --- /dev/null +++ b/layouts/partials/head/css.html @@ -0,0 +1,11 @@ +{{- $CSS := slice +(resources.Get "css/reset.css") +(resources.Get "css/vars.css") +(resources.Get "css/utils.css") +(resources.Get "css/fonts.css") +(resources.Get "css/main.css") | +resources.Concat "assets/combined.css" | +minify | +fingerprint }} + + \ No newline at end of file diff --git a/layouts/partials/head/js.html b/layouts/partials/head/js.html new file mode 100644 index 0000000..18fe842 --- /dev/null +++ b/layouts/partials/head/js.html @@ -0,0 +1,12 @@ +{{- with resources.Get "js/main.js" }} + {{- if eq hugo.Environment "development" }} + {{- with . | js.Build }} + + {{- end }} + {{- else }} + {{- $opts := dict "minify" true }} + {{- with . | js.Build $opts | fingerprint }} + + {{- end }} + {{- end }} +{{- end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..92da9a7 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,20 @@ +{{/* Header */}} + +
+

{{ site.Title }}

+ +
+ {{ $currentPage := . }} + + {{ with site.Params.menu }} + {{ range . }} +

+ + /{{.name }} + +

+ {{ end }} + {{ end }} + +
+
\ No newline at end of file diff --git a/layouts/partials/math.html b/layouts/partials/math.html new file mode 100644 index 0000000..59a0b2d --- /dev/null +++ b/layouts/partials/math.html @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/layouts/partials/pagination-controls.html b/layouts/partials/pagination-controls.html new file mode 100644 index 0000000..b26d609 --- /dev/null +++ b/layouts/partials/pagination-controls.html @@ -0,0 +1,23 @@ +{{ if gt .TotalPages 1 }} + +{{ end }} \ No newline at end of file diff --git a/layouts/partials/post-entry.html b/layouts/partials/post-entry.html new file mode 100644 index 0000000..f3f2a23 --- /dev/null +++ b/layouts/partials/post-entry.html @@ -0,0 +1,4 @@ +
+ +

{{ .Title }}

+
\ No newline at end of file -- cgit v1.2.3