Skip to content

Commit 56b25b1

Browse files
committed
update list avatar and favicon
1 parent 16b269b commit 56b25b1

File tree

6 files changed

+28
-4
lines changed

6 files changed

+28
-4
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ Then, add the theme to your site config:
1818
echo theme = \"bookstack\" >> config.toml
1919
```
2020

21+
## Configuration
22+
- favicon: file in static/favicon.png
23+
- list avatar: images file in assets/ and doc must have config `image`
24+
- example at `gh-pages` branch
25+
2126
## Features
2227

2328
* **Search** supported by [Fuse.js](https://github.com/krisk/Fuse)

assets/json/manifest.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "{{ .Site.Title }}",
3+
"short_name": "{{ .Site.Title }}",
4+
"start_url": "{{ "/" | relURL }}",
5+
"scope": "{{ "/" | relURL }}",
6+
"display": "standalone",
7+
"background_color": "#000000",
8+
"theme_color": "#000000",
9+
"icons": [
10+
{
11+
"src": "{{ "/favicon.svg" | relURL }}",
12+
"sizes": "512x512"
13+
}
14+
]
15+
}

layouts/_default/index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{- $.Scratch.Add "index" slice -}}
22
{{- range site.RegularPages -}}
33
{{- if and (not .Params.searchHidden) (ne .Layout `archives`) (ne .Layout `search`) }}
4-
{{- $.Scratch.Add "index" (dict "title" .Title "content" .Plain "permalink" .Permalink "summary" .Summary "date" (.Date.Format "2006/01/02") "image" ((print .Permalink .Params.image) | absURL)) -}}
4+
{{- $.Scratch.Add "index" (dict "title" .Title "content" .Plain "permalink" .Permalink "summary" .Summary "date" (.Date.Format "2006/01/02") "image" ((print .Site.BaseURL .Params.image) | absURL)) -}}
55
{{- end }}
66
{{- end -}}
77
{{- $.Scratch.Get "index" | jsonify -}}

layouts/_default/list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h2 class="tags__title">{{ .Title }}</h2>
2424
{{- $pages := union .RegularPages .Sections }}
2525
{{ range $pages }}
2626
<div class="resultItem">
27-
<div class="resultItem__media" style="background-image: url({{ (print .Permalink .Params.image) | absURL }});"></div>
27+
<div class="resultItem__media" style="background-image: url({{ (print .Site.BaseURL .Params.image) | absURL }});"></div>
2828
<div class="resultItem__body">
2929
<h3 class="resultItem__title"><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
3030
<div class="resultItem__footer">{{ .Date.Format "2006/01/02" }}</div>

layouts/partials/head.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
<title>{{ if not .IsHome }}{{ if .Title }}{{ .Title }} - {{ end }}{{ end }}{{ .Site.Title }}</title>
77

8+
{{- $manifest := resources.Get "json/manifest.json" | resources.ExecuteAsTemplate "manifest.json" . }}
9+
<link rel="manifest" href="{{ $manifest.RelPermalink }}">
10+
<link rel="icon" href="{{ "favicon.png" | relURL }}" type="image/x-icon">
11+
812
{{ $sass := resources.Get "scss/style.scss" }}
913
{{ $style := $sass | resources.ToCSS | minify | resources.Fingerprint "sha256" }}
1014
<link rel="stylesheet" href="{{ $style.RelPermalink }}">

theme.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "bookstack"
22
license = "MIT"
33
licenselink = "https://github.com/xnzone/hugo-theme-bookstack/blob/main/LICENSE"
4-
description = "Card-based blog theme for Hugo"
4+
description = "Card-based bookstack theme for Hugo"
55

66
# The home page of the theme, where the source can be found.
77
homepage = "https://github.com/xnzone/hugo-theme-bookstack"
@@ -12,7 +12,7 @@ demosite = "https://xnzone.github.io/hugo-theme-bookstack/"
1212
tags = ["blog"]
1313
features = ["awesome", "card"]
1414

15-
min_version = "0.101.0"
15+
min_version = "0.83.1"
1616

1717
# If the theme has a single author
1818
[author]

0 commit comments

Comments
 (0)