add 'see also' section to bottom of single pages ; setup blog post config in cms configs ; update slugs for blog in hugo config
This commit is contained in:
parent
51855b28bc
commit
fbaafdfe97
|
@ -19,7 +19,7 @@ footnotereturnlinkcontents = '↩'
|
|||
uglyURLs = false
|
||||
[permalinks]
|
||||
tips = '/tips/:slug/'
|
||||
posts = '/posts/:slug/'
|
||||
posts = '/posts/:year-:month-:day-:slug/'
|
||||
tags = '/tags/:title/'
|
||||
|
||||
[sitemap]
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
+++
|
||||
title = "First Post"
|
||||
author = "KemoNine"
|
||||
publishDate = 2023-03-18
|
||||
lastmod = 2023-03-18
|
||||
draft = false
|
||||
categories = [
|
||||
"blog"
|
||||
]
|
||||
+++
|
||||
---
|
||||
layout: post
|
||||
title: First Post
|
||||
author: KemoNine
|
||||
pubDate: 2023-03-18
|
||||
modDate: 2023-03-18
|
||||
toc: false
|
||||
draft: false
|
||||
categories:
|
||||
- blog
|
||||
---
|
||||
|
||||
The site has been created and more details will be published as time permits.
|
||||
|
|
15
content/posts/2023-03-19-test.md
Normal file
15
content/posts/2023-03-19-test.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
layout: post
|
||||
title: test
|
||||
author: test
|
||||
pubDate: 2023-03-19T16:24:50.215Z
|
||||
modDate: 2023-03-19T16:24:50.238Z
|
||||
toc: true
|
||||
draft: false
|
||||
categories:
|
||||
- blog
|
||||
tags:
|
||||
- tag: test 1
|
||||
- tag: test 2
|
||||
---
|
||||
test
|
|
@ -21,4 +21,19 @@
|
|||
{{ .Content }}
|
||||
</main>
|
||||
|
||||
{{ range first 1 (where (where .Site.Pages ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
|
||||
{{ $.Scratch.Set "has_related" true }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $.Scratch.Get "has_related" }}
|
||||
<h2>See Also</h2>
|
||||
<a href="#top">Back to top</a>
|
||||
<ul>
|
||||
{{ $num_to_show := .Site.Params.related_content_limit | default 15 }}
|
||||
{{ range first $num_to_show (where (where .Site.Pages ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
|
|
|
@ -1,18 +1,48 @@
|
|||
site_url: https://kb.accessible.tips
|
||||
display_url: https://kb.accessible.tips
|
||||
|
||||
media_folder: "static/uploads"
|
||||
public_folder: "/uploads"
|
||||
|
||||
search: false
|
||||
|
||||
backend:
|
||||
name: git-gateway
|
||||
branch: main
|
||||
|
||||
collections:
|
||||
- name: "blog" # Used in routes, e.g., /admin/collections/blog
|
||||
label: "Blog" # Used in the UI
|
||||
folder: "_posts/blog" # The path to the folder where the documents are stored
|
||||
folder: "content/posts" # The path to the folder where the documents are stored
|
||||
create: true # Allow users to create new documents in this collection
|
||||
slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
|
||||
show_preview_links: true
|
||||
preview_path: "posts/{{slug}}"
|
||||
fields: # The fields for each document, usually in front matter
|
||||
- {label: "Layout", name: "layout", widget: "hidden", default: "blog"}
|
||||
- {label: "Title", name: "title", widget: "string"}
|
||||
- {label: "Publish Date", name: "date", widget: "datetime"}
|
||||
- {label: "Featured Image", name: "thumbnail", widget: "image"}
|
||||
- {label: "Rating (scale of 1-5)", name: "rating", widget: "number"}
|
||||
- {label: "Body", name: "body", widget: "markdown"}
|
||||
- {label: "Layout", name: "layout", widget: "hidden", default: "post", required: true}
|
||||
- {label: "Title", name: "title", widget: "string", required: true}
|
||||
- {label: "Author", name: "author", widget: "string", required: true}
|
||||
- {label: "Publish Date", name: "pubDate", widget: "datetime", date_format: 'yyyy-MM-dd', time_format: false, required: true}
|
||||
- {label: "Last Modified", name: "modDate", widget: "datetime", date_format: 'yyyy-MM-dd', time_format: false, required: true}
|
||||
- {label: "Show TOC?", name: "toc", widget: "boolean", default: true}
|
||||
- {label: "Draft?", name: "draft", widget: "boolean", default: true}
|
||||
- name: categories
|
||||
label: Categories
|
||||
widget: list
|
||||
allow_add: false
|
||||
default:
|
||||
- 'blog'
|
||||
fields:
|
||||
- name: category
|
||||
label: Category
|
||||
widget: string
|
||||
- name: tags
|
||||
label: Tags
|
||||
widget: list
|
||||
required: true
|
||||
collapsed: false
|
||||
fields:
|
||||
- name: tag
|
||||
label: Tag
|
||||
widget: string
|
||||
- {label: "Body", name: "body", widget: "markdown", required: true}
|
||||
|
|
|
@ -1,18 +1,42 @@
|
|||
site_url: https://kb.accessible.tips
|
||||
display_url: https://kb.accessible.tips
|
||||
|
||||
media_folder: "static/uploads"
|
||||
public_folder: "/uploads"
|
||||
|
||||
search: false
|
||||
|
||||
backend:
|
||||
name: git-gateway
|
||||
branch: main
|
||||
|
||||
collections:
|
||||
- name: "blog" # Used in routes, e.g., /admin/collections/blog
|
||||
label: "Blog" # Used in the UI
|
||||
folder: "_posts/blog" # The path to the folder where the documents are stored
|
||||
folder: "content/posts" # The path to the folder where the documents are stored
|
||||
create: true # Allow users to create new documents in this collection
|
||||
slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
|
||||
show_preview_links: true
|
||||
preview_path: "posts/{{slug}}"
|
||||
fields: # The fields for each document, usually in front matter
|
||||
- {label: "Layout", name: "layout", widget: "hidden", default: "blog"}
|
||||
- {label: "Title", name: "title", widget: "string"}
|
||||
- {label: "Publish Date", name: "date", widget: "datetime"}
|
||||
- {label: "Featured Image", name: "thumbnail", widget: "image"}
|
||||
- {label: "Rating (scale of 1-5)", name: "rating", widget: "number"}
|
||||
- {label: "Body", name: "body", widget: "markdown"}
|
||||
- {label: "Layout", name: "layout", widget: "hidden", default: "post", required: true}
|
||||
- {label: "Title", name: "title", widget: "string", required: true}
|
||||
- {label: "Author", name: "author", widget: "string", required: true}
|
||||
- {label: "Publish Date", name: "pubDate", widget: "datetime", date_format: 'YYYY-MM-DD', time_format: false, required: true}
|
||||
- {label: "Last Modified", name: "modDate", widget: "datetime", date_format: 'YYYY-MM-DD', time_format: false, required: true}
|
||||
- {label: "Show TOC?", name: "toc", widget: "boolean", default: true}
|
||||
- {label: "Draft?", name: "draft", widget: "boolean", default: true}
|
||||
- label: "Categories"
|
||||
name: "categories"
|
||||
widget: "list"
|
||||
allow_add: false
|
||||
default: ["blog"]
|
||||
- label: "Tags"
|
||||
name: "tags"
|
||||
widget: "list"
|
||||
fields:
|
||||
- label: "Tag"
|
||||
name: "tag"
|
||||
widget: "string"
|
||||
required: true
|
||||
- {label: "Body", name: "body", widget: "markdown", required: true}
|
||||
|
|
Loading…
Reference in a new issue