Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pjbakker/flexible-seo-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul <paul@brainspark.nl>2020-03-11 18:40:31 +0300
committerPaul <paul@brainspark.nl>2020-03-11 18:41:16 +0300
commit20174737e5b5267709987edac2fb7d50554fb71b (patch)
tree6a51b6a3038569d6fa348b8b0417de53f12f4864
parentc145dbbe8c432201f5fe4cb6f28956c599974b8c (diff)
Add bootstrap specific shortcodes to theme
-rw-r--r--layouts/robots.txt3
-rw-r--r--layouts/shortcodes/figure.html18
-rw-r--r--layouts/shortcodes/table.html2
3 files changed, 23 insertions, 0 deletions
diff --git a/layouts/robots.txt b/layouts/robots.txt
new file mode 100644
index 0000000..2baf3f9
--- /dev/null
+++ b/layouts/robots.txt
@@ -0,0 +1,3 @@
+User-agent: *
+
+Sitemap: {{ "sitemap.xml" | absURL }}
diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html
new file mode 100644
index 0000000..79d15d9
--- /dev/null
+++ b/layouts/shortcodes/figure.html
@@ -0,0 +1,18 @@
+<!-- image -->
+<figure class="figure {{with .Get "class" }}{{.}}{{ end }}">
+ {{ if .Get "link"}}<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>{{ end }}
+ <img src="{{ .Get "src" }}" class="figure-img {{ with .Get "imgclass" }}{{.}}{{ end }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}" {{ end }}{{with .Get "title"}}title="{{.}}" {{end}}{{ with .Get "width" }}width="{{.}}" {{ end }}{{ with .Get "height" }}height="{{.}}" {{ end }}/>
+ {{- if .Get "link"}}</a>{{ end }}
+ {{- if or (or (.Get "caption-title") (.Get "caption")) (.Get "attr")}}
+ <figcaption class="figure-caption text-right">{{- if isset .Params "caption-title" }}
+ <h4>{{ .Get "caption-title" }}</h4>{{ end }}
+ {{- if or (.Get "caption") (.Get "attr")}}<p>
+ {{- .Get "caption" }}
+ {{- with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
+ {{- .Get "attr" }}
+ {{- if .Get "attrlink"}}</a> {{ end }}
+ </p> {{ end }}
+ </figcaption>
+ {{ end }}
+</figure>
+<!-- image -->
diff --git a/layouts/shortcodes/table.html b/layouts/shortcodes/table.html
new file mode 100644
index 0000000..c7ebf68
--- /dev/null
+++ b/layouts/shortcodes/table.html
@@ -0,0 +1,2 @@
+{{ $caption := printf "<table class=\"%s\"><caption class=\"text-center\">%s</caption>" ( .Get "class" ) ( .Get "caption" ) }}
+{{ .Inner | markdownify | replaceRE "<table>" $caption | safeHTML }}