From 15c730e6378a32283ea1f94237b37a4ab5956746 Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Sat, 2 Jan 2021 14:08:21 +0100 Subject: [PATCH] added support for injecting content --- README.md | 14 ++++++++++++++ layouts/_default/baseof.html | 1 + layouts/_default/single.html | 2 ++ layouts/partials/footer.html | 1 + layouts/partials/head.html | 1 + layouts/partials/inject/body.html | 1 + layouts/partials/inject/content-after.html | 1 + layouts/partials/inject/content-before.html | 1 + layouts/partials/inject/footer.html | 1 + layouts/partials/inject/head.html | 1 + 10 files changed, 24 insertions(+) create mode 100644 layouts/partials/inject/body.html create mode 100644 layouts/partials/inject/content-after.html create mode 100644 layouts/partials/inject/content-before.html create mode 100644 layouts/partials/inject/footer.html create mode 100644 layouts/partials/inject/head.html diff --git a/README.md b/README.md index dd0e031..3699aa3 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ A prickly blog theme for Hugo # Customization +## Configuration + These are some parameters you can use in your `config.toml` to customize Ficurinia: ```toml @@ -65,6 +67,18 @@ paginate = 5 # number of articles per page in the index 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? It's Sicilian for Indian fig, also known as prickly pear cactus. diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 103f322..b99b323 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -10,5 +10,6 @@ {{- partial "footer.html" . -}} {{- partial "plausible.html" . -}} + {{- partial "inject/body.html" . -}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a9587f0..96d6315 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,4 +1,5 @@ {{ define "main" }} + {{- partial "inject/content-before.html" . -}}

{{ .Title }}

{{ .Date.Format "2006-01-02" }}

@@ -13,6 +14,7 @@

{{ end }}
+ {{- partial "inject/content-after.html" . -}} {{ if .Site.Params.commento }}