From f2ebaae56912a8449eab90dd197bc2fa350ef3c9 Mon Sep 17 00:00:00 2001 From: Francesco Date: Mon, 22 Apr 2024 15:13:47 +0200 Subject: [PATCH] Theme Update --- assets/css/main.css | 33 +++++++++++++++++ layouts/_default/single.html | 68 +++++++++++++++++++----------------- 2 files changed, 69 insertions(+), 32 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 0c4c7f4..0941263 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -248,4 +248,37 @@ footer a { .toc ul { margin-top: 0; margin-bottom: .5rem; +} + + +/* Autonumbering */ + +.autonumber { + counter-reset: h2-counter 0; +} + +.autonumber h2 { + counter-increment: h2-counter 1; + counter-reset: h3-counter 0; +} + +.autonumber h3 { + counter-increment: h3-counter 1; + counter-reset: h4-counter 0; +} + +.autonumber h4 { + counter-increment: h4-counter 1; +} + +.autonumber h2:before { + content: counter(h2-counter) "\00a0\00a0"; +} + +.autonumber h3:before { + content: counter(h2-counter) "." counter(h3-counter) "\00a0\00a0"; +} + +.autonumber h4:before { + content: counter(h2-counter) "." counter(h3-counter) "." counter(h4-counter) "\00a0\00a0"; } \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index b68da6c..9a478f7 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,44 +2,48 @@ {{/* Intro */}} -
+
- {{/* Title and Summary */}} +
-

{{ .Title }}

- {{if .Param "summary" }} -

{{ .Summary }}

+ {{/* 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 }} - {{/* Reading Time */}} + {{/* Actual document content */}} -

- {{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 }} -

+
+ {{ .Content }} +
-{{/* Table of Content */}} - -{{if .Param "toc" }} - -{{ end }} - -{{/* Actual document content */}} - -
- {{ .Content }} -
- {{ end }} \ No newline at end of file