mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-24 22:10:39 +00:00
improve defaults and getting started guide
This commit is contained in:
parent
b2f715a50c
commit
4e59fbe941
@ -78,9 +78,7 @@ To prepare your new site environment just a few steps are required:
|
|||||||
# Geekblog required configuration
|
# Geekblog required configuration
|
||||||
pygmentsUseClasses = true
|
pygmentsUseClasses = true
|
||||||
pygmentsCodeFences = true
|
pygmentsCodeFences = true
|
||||||
|
|
||||||
disablePathToLower = true
|
disablePathToLower = true
|
||||||
enableGitInfo=true
|
|
||||||
|
|
||||||
# Needed for mermaid shortcodes
|
# Needed for mermaid shortcodes
|
||||||
[markup]
|
[markup]
|
||||||
@ -91,8 +89,9 @@ To prepare your new site environment just a few steps are required:
|
|||||||
endLevel = 9
|
endLevel = 9
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
author = authors
|
author = "authors"
|
||||||
tag = tags
|
tag = "tags"
|
||||||
|
series = "series"
|
||||||
|
|
||||||
[mediaTypes]
|
[mediaTypes]
|
||||||
[mediaTypes."application/atom+xml"]
|
[mediaTypes."application/atom+xml"]
|
||||||
@ -122,7 +121,13 @@ To prepare your new site environment just a few steps are required:
|
|||||||
5. Test your site.
|
5. Test your site.
|
||||||
|
|
||||||
```Shell
|
```Shell
|
||||||
hugo server --theme geekblog -D
|
hugo server -D
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to add some demo data you could use the content from [hugoBasicExample](https://github.com/gohugoio/hugoBasicExample):
|
||||||
|
|
||||||
|
```Shell
|
||||||
|
curl -L https://github.com/gohugoio/hugoBasicExample/archive/master.tar.gz | tar -xz --exclude "config*" --exclude "LICENSE" --exclude "README*" --strip-components=1
|
||||||
```
|
```
|
||||||
|
|
||||||
### Option 1: Download pre-build release bundle
|
### Option 1: Download pre-build release bundle
|
||||||
@ -130,6 +135,7 @@ To prepare your new site environment just a few steps are required:
|
|||||||
Download and extract the latest release bundle into the theme directory.
|
Download and extract the latest release bundle into the theme directory.
|
||||||
|
|
||||||
```Shell
|
```Shell
|
||||||
|
mkdir -p themes/hugo-geekblog/
|
||||||
curl -L https://github.com/xoxys/hugo-geekblog/releases/latest/download/hugo-geekblog.tar.gz | tar -xz -C themes/hugo-geekblog/ --strip-components=1
|
curl -L https://github.com/xoxys/hugo-geekblog/releases/latest/download/hugo-geekblog.tar.gz | tar -xz -C themes/hugo-geekblog/ --strip-components=1
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -162,15 +168,13 @@ gulp default
|
|||||||
{{< tab "TOML" >}}
|
{{< tab "TOML" >}}
|
||||||
|
|
||||||
```Toml
|
```Toml
|
||||||
# ...
|
baseURL = "http://localhost"
|
||||||
|
title = "Geekblog"
|
||||||
theme = "hugo-geekblog"
|
theme = "hugo-geekblog"
|
||||||
|
|
||||||
# Required to get well formatted code blocks
|
# Required to get well formatted code blocks
|
||||||
pygmentsUseClasses = true
|
pygmentsUseClasses = true
|
||||||
pygmentsCodeFences = true
|
pygmentsCodeFences = true
|
||||||
enableGitInfo = true
|
|
||||||
|
|
||||||
disablePathToLower = true
|
disablePathToLower = true
|
||||||
enableGitInfo = true
|
enableGitInfo = true
|
||||||
|
|
||||||
@ -182,8 +186,9 @@ enableGitInfo = true
|
|||||||
endLevel = 9
|
endLevel = 9
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
author = authors
|
author = "authors"
|
||||||
tag = tags
|
tag = "tags"
|
||||||
|
series = "series"
|
||||||
|
|
||||||
[mediaTypes]
|
[mediaTypes]
|
||||||
[mediaTypes."application/atom+xml"]
|
[mediaTypes."application/atom+xml"]
|
||||||
@ -210,14 +215,14 @@ enableGitInfo = true
|
|||||||
term = ["HTML", "ATOM"]
|
term = ["HTML", "ATOM"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
subtitle =
|
subtitle = "Blog about my favorite topics"
|
||||||
description = "This is my personal blog about tech."
|
description = "This is my personal blog about tech."
|
||||||
keywords = []
|
keywords = []
|
||||||
images = []
|
images = []
|
||||||
|
|
||||||
# (Optional, default static/brand.svg) Set the path to a logo for the Geekblog
|
# (Optional, default static/brand.svg) Set the path to a logo for the Geekblog
|
||||||
# relative to your 'static/' folder.
|
# relative to your 'static/' folder.
|
||||||
logo = logo.png
|
logo = "logo.png"
|
||||||
|
|
||||||
# (Optional, default 6) Set how many table of contents levels to be showed on page.
|
# (Optional, default 6) Set how many table of contents levels to be showed on page.
|
||||||
# Use false to hide ToC, note that 0 will default to 6 (https://gohugo.io/functions/default/)
|
# Use false to hide ToC, note that 0 will default to 6 (https://gohugo.io/functions/default/)
|
||||||
@ -243,13 +248,13 @@ enableGitInfo = true
|
|||||||
|
|
||||||
# (Optional, default none) Adds a "Hosted on <provider>" line to the footer.
|
# (Optional, default none) Adds a "Hosted on <provider>" line to the footer.
|
||||||
# Could be used if you want to give credits to your hosting provider.
|
# Could be used if you want to give credits to your hosting provider.
|
||||||
[geekblogHostedOn]
|
[params.geekblogHostedOn]
|
||||||
name = Uberspace
|
name = "Uberspace"
|
||||||
link = "https://uberspace.de/en/"
|
link = "https://uberspace.de/en/"
|
||||||
|
|
||||||
# (Optional, default none) Adds a "Content licensed under <license>" line to the footer.
|
# (Optional, default none) Adds a "Content licensed under <license>" line to the footer.
|
||||||
# Could be used if you want to define a default license for your content.
|
# Could be used if you want to define a default license for your content.
|
||||||
[geekblogContentLicense]
|
[params.geekblogContentLicense]
|
||||||
name = "CC BY-SA 4.0"
|
name = "CC BY-SA 4.0"
|
||||||
link = "https://creativecommons.org/licenses/by-sa/4.0/"
|
link = "https://creativecommons.org/licenses/by-sa/4.0/"
|
||||||
```
|
```
|
||||||
@ -266,8 +271,6 @@ theme: hugo-geekblog
|
|||||||
# Required to get well formatted code blocks
|
# Required to get well formatted code blocks
|
||||||
pygmentsUseClasses: true
|
pygmentsUseClasses: true
|
||||||
pygmentsCodeFences: true
|
pygmentsCodeFences: true
|
||||||
enableGitInfo: true
|
|
||||||
|
|
||||||
disablePathToLower: true
|
disablePathToLower: true
|
||||||
enableGitInfo: true
|
enableGitInfo: true
|
||||||
|
|
||||||
@ -282,6 +285,7 @@ markup:
|
|||||||
taxonomies:
|
taxonomies:
|
||||||
author: authors
|
author: authors
|
||||||
tag: tags
|
tag: tags
|
||||||
|
series: series
|
||||||
|
|
||||||
mediaTypes:
|
mediaTypes:
|
||||||
"application/atom+xml":
|
"application/atom+xml":
|
||||||
@ -319,7 +323,7 @@ outputs:
|
|||||||
enableRobotsTXT: true
|
enableRobotsTXT: true
|
||||||
|
|
||||||
params:
|
params:
|
||||||
subtitle:
|
subtitle: "Blog about my favorite topics"
|
||||||
description: "This is my personal blog about tech."
|
description: "This is my personal blog about tech."
|
||||||
keywords: []
|
keywords: []
|
||||||
images: []
|
images: []
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
{{ $description := default (default .Site.Title .Site.Params.description) (default .Summary .Description) }}
|
{{ $description := default (default .Site.Title .Site.Params.description) (default .Summary .Description) }}
|
||||||
{{ $keywords := default .Site.Params.Keywords .Keywords }}
|
{{ $keywords := default .Site.Params.Keywords .Keywords }}
|
||||||
{{ $author := default (slice .Site.Params.GeekblogAuthor) .Params.authors }}
|
{{ $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors }}
|
||||||
|
|
||||||
{{ with $description }}
|
{{ with $description }}
|
||||||
<meta name="description" content="{{ . }}">
|
<meta name="description" content="{{ . }}">
|
||||||
@ -11,14 +11,16 @@
|
|||||||
{{ with $keywords }}
|
{{ with $keywords }}
|
||||||
<meta name="keywords" content="{{ delimit . "," }}">
|
<meta name="keywords" content="{{ delimit . "," }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with $author }}
|
{{ with $authors }}
|
||||||
{{ $authors := slice }}
|
{{ $list := slice }}
|
||||||
{{ range sort . }}
|
{{ range sort . }}
|
||||||
{{ $author := index $.Site.Data.authors . }}
|
{{ with . }}
|
||||||
{{ $authors = $authors | append $author.name }}
|
{{ $author := index $.Site.Data.authors . }}
|
||||||
|
{{ $list = $list | append $author.name }}
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ with $authors }}
|
{{ with $list }}
|
||||||
<meta name="author" content="{{ delimit . "," }}">
|
<meta name="author" content="{{ delimit . "," }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{{ if .IsHome -}}
|
{{ if .IsHome -}}
|
||||||
{{ $thumbnail := default (default "brand.svg" .Site.Params.logo) (index .Site.Params.images 0) | absURL }}
|
{{ $thumbnail := default (default "brand.svg" .Site.Params.logo) (index (default slice .Site.Params.images) 0) | absURL }}
|
||||||
<script type="application/ld+json">
|
<script type="application/ld+json">
|
||||||
{
|
{
|
||||||
"@context": "http://schema.org",
|
"@context": "http://schema.org",
|
||||||
@ -43,12 +43,14 @@
|
|||||||
{{- with $authors }}
|
{{- with $authors }}
|
||||||
"author" : [
|
"author" : [
|
||||||
{{- range sort . }}
|
{{- range sort . }}
|
||||||
|
{{- with . -}}
|
||||||
{{- $ac = (add $ac 1) }}
|
{{- $ac = (add $ac 1) }}
|
||||||
{{- $author := index $.Site.Data.authors . }}
|
{{- $author := index $.Site.Data.authors . }}
|
||||||
{
|
{
|
||||||
"@type": "Person",
|
"@type": "Person",
|
||||||
"name": "{{ $author.name }}"
|
"name": "{{ $author.name }}"
|
||||||
}{{ if lt $ac $ac_max }},{{ end }}
|
}{{ if lt $ac $ac_max }},{{ end }}
|
||||||
|
{{- end -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
],
|
],
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -7,10 +7,12 @@
|
|||||||
<a href='{{ .Permalink | relURL }}' class="gblog-footer__link">Feed</a>
|
<a href='{{ .Permalink | relURL }}' class="gblog-footer__link">Feed</a>
|
||||||
</span>
|
</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ if (fileExists "contact.md") }}
|
||||||
<span class="gblog-footer__item">
|
<span class="gblog-footer__item">
|
||||||
<svg class="icon email"><use xlink:href="#email"></use></svg>
|
<svg class="icon email"><use xlink:href="#email"></use></svg>
|
||||||
<a href='{{ "contact" | relURL }}' class="gblog-footer__link">Contact</a>
|
<a href='{{ "contact" | relURL }}' class="gblog-footer__link">Contact</a>
|
||||||
</span>
|
</span>
|
||||||
|
{{ end }}
|
||||||
{{ with .Site.Params.GeekblogLegalNotice }}
|
{{ with .Site.Params.GeekblogLegalNotice }}
|
||||||
<span class="gblog-footer__item">
|
<span class="gblog-footer__item">
|
||||||
<a href="{{ . | relURL }}" class="gblog-footer__link">Legal Notice</a>
|
<a href="{{ . | relURL }}" class="gblog-footer__link">Legal Notice</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user