From 30c459948a96e1038a24237a3fffe30190d46229 Mon Sep 17 00:00:00 2001 From: geekifan Date: Mon, 21 Apr 2025 22:02:02 +0800 Subject: [PATCH] add layout post --- .../2019-08-08-text-and-typography/index.md | 1 + .../post/2019-08-09-getting-started/index.md | 1 + layouts/_default/post.html | 162 ++++++++++++++++++ 3 files changed, 164 insertions(+) create mode 100644 layouts/_default/post.html diff --git a/content/post/2019-08-08-text-and-typography/index.md b/content/post/2019-08-08-text-and-typography/index.md index 4451c99..fd8776d 100644 --- a/content/post/2019-08-08-text-and-typography/index.md +++ b/content/post/2019-08-08-text-and-typography/index.md @@ -3,6 +3,7 @@ title: "Text and Typography" date: 2019-08-09 lastmod: 2025-04-21 draft: false +layout: post description: >- Examples of text, typography, math equations, diagrams, flowcharts, pictures, videos, and more. tags: diff --git a/content/post/2019-08-09-getting-started/index.md b/content/post/2019-08-09-getting-started/index.md index 536ad25..ffeb631 100644 --- a/content/post/2019-08-09-getting-started/index.md +++ b/content/post/2019-08-09-getting-started/index.md @@ -3,6 +3,7 @@ title: "Getting Started" date: 2019-08-09 lastmod: 2025-04-21 draft: false +layout: post description: >- Get started with Chirpy basics in this comprehensive overview. You will learn how to install, configure, and use your first Chirpy-based website, as well as deploy it to a web server. diff --git a/layouts/_default/post.html b/layouts/_default/post.html new file mode 100644 index 0000000..0fae42b --- /dev/null +++ b/layouts/_default/post.html @@ -0,0 +1,162 @@ +{{ define "main" }} + {{ $enable_toc := and (.Params.toc | default .Site.Params.enableTOC) (gt (len .TableOfContents) 100) }} + {{ $lang := .Site.Language.Lang }} + +
+
+

{{ .Title }}

+ {{ with .Description }} +

{{ . }}

+ {{ end }} + + +
+ + {{ if $enable_toc }} + + + + + +
+
{{ .Title }}
+ +
+
{{ .TableOfContents }}
+
+ {{ end }} + +
+ {{ .Content }} +
+ +
+ + {{ with .Params.categories }} + + {{ end }} + + + {{ with .Params.tags }} + + {{ end }} + +
+
+ {{ with (i18n "copyright.license.template") }} + {{ $replacement := printf `%s` (i18n "copyright.license.link") (i18n "copyright.license.name") }} + {{ replace . ":LICENSE_NAME" $replacement | safeHTML }} + {{ end }} +
+ +
+
+
+{{ end }} + +{{ define "panel" }} + {{ partial "toc.html" . }} +{{ end }} \ No newline at end of file