From f2082a0d72f9359be02182883a1e1190d8b1b215 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sun, 18 Jul 2021 16:04:06 -0400 Subject: More changes to how the website functions --- example-site/blog/first-post.md | 5 +-- example-site/blog/second-post.md | 1 + example-site/blog/unpublished-post.md | 22 +++++++++++++ example-site/checkup.md | 62 +++++++++++++++++++++++++++++++++++ example-site/inc/base.html | 16 ++++----- example-site/index.md | 5 +++ example-site/multi-tag-page.md | 1 + example-site/untagged-page.md | 1 + 8 files changed, 100 insertions(+), 13 deletions(-) create mode 100644 example-site/blog/unpublished-post.md create mode 100644 example-site/checkup.md (limited to 'example-site') diff --git a/example-site/blog/first-post.md b/example-site/blog/first-post.md index 42ef931..f9c5ea2 100644 --- a/example-site/blog/first-post.md +++ b/example-site/blog/first-post.md @@ -1,13 +1,10 @@ --- title: 'Blog Post #1' -# head: "This is optional" description: My example description - date: 07.02.2021 15:00:00 EDT - +published: true tags: Blog: - |--- `{{.Date.Time.Format "Monday January 2 2006"}}` diff --git a/example-site/blog/second-post.md b/example-site/blog/second-post.md index f8abef2..34fe318 100644 --- a/example-site/blog/second-post.md +++ b/example-site/blog/second-post.md @@ -2,6 +2,7 @@ title: 'Blog Post #2' description: My example description for blog post #2 date: 07.14.2021 15:00:00 EDT +published: true tags: Blog: |--- diff --git a/example-site/blog/unpublished-post.md b/example-site/blog/unpublished-post.md new file mode 100644 index 0000000..3088250 --- /dev/null +++ b/example-site/blog/unpublished-post.md @@ -0,0 +1,22 @@ +--- +title: 'Unpublished Blog Post' +description: My example description for an unpublished blog post +date: 07.15.2021 15:00:00 EDT + +# Defaults to false +# published: false + +tags: + Blog: +|--- + +`{{.Date.Time.Format "Monday January 2 2006"}}` + +# {{.Title}} + +This is an example unpublished blog post. + +Description: + +> {{.Description}} + diff --git a/example-site/checkup.md b/example-site/checkup.md new file mode 100644 index 0000000..f7d7a88 --- /dev/null +++ b/example-site/checkup.md @@ -0,0 +1,62 @@ +--- +title: Example checkup page +description: Showing the output of one of the internal checkup mechanisms + +|--- + +# {{.Title}} + +# Status + +{{range $key, $val := .Checkup}} +## {{$key}}: +{{range $page := $val}} +``` +{{$page}} +{{$page.EncodeYaml nil}} +``` +{{end}} +{{end}} +## Raw + +``` +{{.EncodeYaml .Checkup}} +``` + +## Recent Blog Entries: + +[Atom Feed](/{{.Global.App.FeedPrefix}}/Blog?limit=5&content) + +{{range $val := .Index.Blog.SortDate}} + * [{{$val.Date.Time.Format "2006-01-02"}} {{$val.Title}}]({{$val.Path}}){{end}} + +## Published Blog Entries: + +{{range $val := .Index.Blog.SortDate}}{{if $val.Published}} + * [{{$val.Date.Time.Format "2006-01-02"}} * {{$val.Title}}]({{$val.Path}}){{end}}{{end}} + +## Some internals + + +#### Global vars: + +``` +{{.Global}} + +"App" under Global vars: +{{.Global.App}} +``` + +#### Page Index + +{{range $key, $val := .Index}} +``` +### {{$key}}: + +{{range $v2 := $val}} +{{$v2.StringDetail}}{{end}} +``` + + +{{end}} + diff --git a/example-site/inc/base.html b/example-site/inc/base.html index 959c7d6..2f93ec7 100644 --- a/example-site/inc/base.html +++ b/example-site/inc/base.html @@ -6,15 +6,13 @@ - - - - + + {{if .AuthorName }} + + {{else if .Global.App.Author.Name }} + + {{else}} + {{end}} {{if .Title}} {{.Title}} diff --git a/example-site/index.md b/example-site/index.md index 6d292b5..42b0181 100644 --- a/example-site/index.md +++ b/example-site/index.md @@ -21,6 +21,11 @@ it. {{range $val := .Index.Blog.SortDate}} * [{{$val.Date.Time.Format "2006-01-02"}} {{$val.Title}}]({{$val.Path}}){{end}} +## Published Blog Entries: + +{{range $val := .Index.Blog.SortDate}}{{if $val.Published}} + * [{{$val.Date.Time.Format "2006-01-02"}} * {{$val.Title}}]({{$val.Path}}){{end}}{{end}} + ## Some internals diff --git a/example-site/multi-tag-page.md b/example-site/multi-tag-page.md index a1a61d2..6e3b4f6 100644 --- a/example-site/multi-tag-page.md +++ b/example-site/multi-tag-page.md @@ -4,6 +4,7 @@ description: A page with several tags added to it date: 07.02.2021 15:00:00 EDT authorname: Someone Else # authoremail: someoneelse@example.com +published: true tags: Blog: Automotive: diff --git a/example-site/untagged-page.md b/example-site/untagged-page.md index aa8400f..c55274e 100644 --- a/example-site/untagged-page.md +++ b/example-site/untagged-page.md @@ -2,6 +2,7 @@ title: Untagged page description: A page with no tags added to it date: 07.02.2021 15:00:00 EDT +published: true tags: |--- -- cgit v1.2.3