added support for injecting content
This commit is contained in:
parent
25cf285710
commit
15c730e637
14
README.md
14
README.md
|
@ -10,6 +10,8 @@ A prickly blog theme for Hugo
|
||||||
|
|
||||||
# Customization
|
# Customization
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
These are some parameters you can use in your `config.toml` to customize Ficurinia:
|
These are some parameters you can use in your `config.toml` to customize Ficurinia:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
|
@ -65,6 +67,18 @@ paginate = 5 # number of articles per page in the index
|
||||||
accentColor = "#db5793"
|
accentColor = "#db5793"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Inject custom content
|
||||||
|
|
||||||
|
Ficurinia supports injecting custom content into the theme. There are several files you can create in `layouts/partials/inject` that will be included inside the theme in different places.
|
||||||
|
|
||||||
|
| Partial | Placement |
|
||||||
|
|---------|-----------|
|
||||||
|
| `layouts/partials/inject/body.html` | Before closing the `body` tag |
|
||||||
|
| `layouts/partials/inject/content-after.html` | After a post or page content |
|
||||||
|
| `layouts/partials/inject/content-before.html` | Before a post or page content |
|
||||||
|
| `layouts/partials/inject/footer.html` | At the beginning of the footer |
|
||||||
|
| `layouts/partials/inject/head.html` | Before closing the `head` tag |
|
||||||
|
|
||||||
# Does *Ficurinia* mean anything?
|
# Does *Ficurinia* mean anything?
|
||||||
|
|
||||||
It's Sicilian for Indian fig, also known as prickly pear cactus.
|
It's Sicilian for Indian fig, also known as prickly pear cactus.
|
||||||
|
|
|
@ -10,5 +10,6 @@
|
||||||
{{- partial "footer.html" . -}}
|
{{- partial "footer.html" . -}}
|
||||||
</div>
|
</div>
|
||||||
{{- partial "plausible.html" . -}}
|
{{- partial "plausible.html" . -}}
|
||||||
|
{{- partial "inject/body.html" . -}}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
{{- partial "inject/content-before.html" . -}}
|
||||||
<article>
|
<article>
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
<p class="date">{{ .Date.Format "2006-01-02" }}</p>
|
<p class="date">{{ .Date.Format "2006-01-02" }}</p>
|
||||||
|
@ -13,6 +14,7 @@
|
||||||
</p>
|
</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</article>
|
</article>
|
||||||
|
{{- partial "inject/content-after.html" . -}}
|
||||||
{{ if .Site.Params.commento }}
|
{{ if .Site.Params.commento }}
|
||||||
<script
|
<script
|
||||||
defer
|
defer
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<footer>
|
<footer>
|
||||||
<hr />
|
<hr />
|
||||||
|
{{- partial "inject/footer.html" . -}}
|
||||||
<p><small>
|
<p><small>
|
||||||
{{ now.Format "2006" }} © {{ .Site.Copyright }}
|
{{ now.Format "2006" }} © {{ .Site.Copyright }}
|
||||||
</small></p>
|
</small></p>
|
||||||
|
|
|
@ -22,4 +22,5 @@
|
||||||
<link href="/jetbrains-mono/jetbrains-mono.css" rel="stylesheet">
|
<link href="/jetbrains-mono/jetbrains-mono.css" rel="stylesheet">
|
||||||
{{ $style := resources.Get "/scss/style.scss" | resources.ExecuteAsTemplate "/scss/style.scss" . | resources.ToCSS (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") | resources.Fingerprint "sha512" }}
|
{{ $style := resources.Get "/scss/style.scss" | resources.ExecuteAsTemplate "/scss/style.scss" . | resources.ToCSS (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") | resources.Fingerprint "sha512" }}
|
||||||
<link type=text/css rel=stylesheet href={{ $style.Permalink }} integrity="{{ $style.Data.Integrity }}" />
|
<link type=text/css rel=stylesheet href={{ $style.Permalink }} integrity="{{ $style.Data.Integrity }}" />
|
||||||
|
{{- partial "inject/head.html" . -}}
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<!-- This code will be injected before closing the body tag -->
|
|
@ -0,0 +1 @@
|
||||||
|
<!-- This code will be injected after a post or page content -->
|
|
@ -0,0 +1 @@
|
||||||
|
<!-- This code will be injected before a post or page content -->
|
|
@ -0,0 +1 @@
|
||||||
|
<!-- This code will be injected at the beginning of the footer -->
|
|
@ -0,0 +1 @@
|
||||||
|
<!-- This code will be injected before closing the head tag -->
|
Loading…
Reference in New Issue