Merge pull request #2 from xoxys/improve-minimal-setup

Improve minimal setup
This commit is contained in:
Robert Kaussow 2020-09-17 15:12:51 +02:00 committed by GitHub
commit 2e46f3128f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 27 deletions

View File

@ -56,6 +56,9 @@ steps:
strip_prefix: lhci_reports/dist/
target: /${DRONE_REPO_NAME}
when:
ref:
- refs/heads/master
- refs/tags/**
status:
- failure
- success
@ -235,6 +238,6 @@ depends_on:
---
kind: signature
hmac: 0c98dc22823695273ff711ccf8d2693a0895bdac5a6d53617d6f7f89a36b7cb1
hmac: 41d1cd141179529490477cabe96f9e62933e0deb7cab3d17043a2182afd515fb
...

View File

@ -78,9 +78,7 @@ To prepare your new site environment just a few steps are required:
# Geekblog required configuration
pygmentsUseClasses = true
pygmentsCodeFences = true
disablePathToLower = true
enableGitInfo=true
# Needed for mermaid shortcodes
[markup]
@ -91,8 +89,9 @@ To prepare your new site environment just a few steps are required:
endLevel = 9
[taxonomies]
author = authors
tag = tags
author = "authors"
tag = "tags"
series = "series"
[mediaTypes]
[mediaTypes."application/atom+xml"]
@ -122,7 +121,13 @@ To prepare your new site environment just a few steps are required:
5. Test your site.
```Shell
hugo server --theme geekblog -D
hugo server -D
```
If you want to add some demo data you could use the content from the [Hugo basic example](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
@ -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.
```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
```
@ -162,15 +168,13 @@ gulp default
{{< tab "TOML" >}}
```Toml
# ...
baseURL = "http://localhost"
title = "Geekblog"
theme = "hugo-geekblog"
# Required to get well formatted code blocks
pygmentsUseClasses = true
pygmentsCodeFences = true
enableGitInfo = true
disablePathToLower = true
enableGitInfo = true
@ -182,8 +186,9 @@ enableGitInfo = true
endLevel = 9
[taxonomies]
author = authors
tag = tags
author = "authors"
tag = "tags"
series = "series"
[mediaTypes]
[mediaTypes."application/atom+xml"]
@ -210,14 +215,14 @@ enableGitInfo = true
term = ["HTML", "ATOM"]
[params]
subtitle =
subtitle = "Blog about my favorite topics"
description = "This is my personal blog about tech."
keywords = []
images = []
# (Optional, default static/brand.svg) Set the path to a logo for the Geekblog
# 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.
# 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.
# Could be used if you want to give credits to your hosting provider.
[geekblogHostedOn]
name = Uberspace
[params.geekblogHostedOn]
name = "Uberspace"
link = "https://uberspace.de/en/"
# (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.
[geekblogContentLicense]
[params.geekblogContentLicense]
name = "CC 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
pygmentsUseClasses: true
pygmentsCodeFences: true
enableGitInfo: true
disablePathToLower: true
enableGitInfo: true
@ -282,6 +285,7 @@ markup:
taxonomies:
author: authors
tag: tags
series: series
mediaTypes:
"application/atom+xml":
@ -319,7 +323,7 @@ outputs:
enableRobotsTXT: true
params:
subtitle:
subtitle: "Blog about my favorite topics"
description: "This is my personal blog about tech."
keywords: []
images: []

View File

@ -3,7 +3,7 @@
{{ $description := default (default .Site.Title .Site.Params.description) (default .Summary .Description) }}
{{ $keywords := default .Site.Params.Keywords .Keywords }}
{{ $author := default (slice .Site.Params.GeekblogAuthor) .Params.authors }}
{{ $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors }}
{{ with $description }}
<meta name="description" content="{{ . }}">
@ -11,14 +11,16 @@
{{ with $keywords }}
<meta name="keywords" content="{{ delimit . "," }}">
{{ end }}
{{ with $author }}
{{ $authors := slice }}
{{ with $authors }}
{{ $list := slice }}
{{ range sort . }}
{{ $author := index $.Site.Data.authors . }}
{{ $authors = $authors | append $author.name }}
{{ with . }}
{{ $author := index $.Site.Data.authors . }}
{{ $list = $list | append $author.name }}
{{ end }}
{{ end }}
{{ with $authors }}
{{ with $list }}
<meta name="author" content="{{ delimit . "," }}">
{{ end }}
{{ end }}

View File

@ -1,5 +1,5 @@
{{ 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">
{
"@context": "http://schema.org",
@ -43,12 +43,14 @@
{{- with $authors }}
"author" : [
{{- range sort . }}
{{- with . -}}
{{- $ac = (add $ac 1) }}
{{- $author := index $.Site.Data.authors . }}
{
"@type": "Person",
"name": "{{ $author.name }}"
}{{ if lt $ac $ac_max }},{{ end }}
{{- end -}}
{{- end }}
],
{{- end }}

View File

@ -7,10 +7,12 @@
<a href='{{ .Permalink | relURL }}' class="gblog-footer__link">Feed</a>
</span>
{{ end }}
{{ if (fileExists "contact.md") }}
<span class="gblog-footer__item">
<svg class="icon email"><use xlink:href="#email"></use></svg>
<a href='{{ "contact" | relURL }}' class="gblog-footer__link">Contact</a>
</span>
{{ end }}
{{ with .Site.Params.GeekblogLegalNotice }}
<span class="gblog-footer__item">
<a href="{{ . | relURL }}" class="gblog-footer__link">Legal Notice</a>