From 0c7cb4486a89ec6fe9680e6569ef41d4b82d557d Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Thu, 18 Feb 2021 22:21:36 +0100 Subject: use maintained theme --- themes/CodeIT/layouts/index.json | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 themes/CodeIT/layouts/index.json (limited to 'themes/CodeIT/layouts/index.json') diff --git a/themes/CodeIT/layouts/index.json b/themes/CodeIT/layouts/index.json new file mode 100644 index 0000000..4e81039 --- /dev/null +++ b/themes/CodeIT/layouts/index.json @@ -0,0 +1,46 @@ +{{- if .Site.Params.search -}} + {{- $index := slice -}} + {{- $pages := .Site.RegularPages -}} + {{- if .Site.Params.page.hiddenFromSearch -}} + {{- $pages = where $pages "Params.hiddenfromsearch" false -}} + {{- else -}} + {{- $pages = where $pages "Params.hiddenfromsearch" "!=" true -}} + {{- end -}} + {{- range $pages -}} + {{- $uri := .RelPermalink -}} + {{- if $.Site.Params.search.absoluteURL -}} + {{- $uri = .Permalink -}} + {{- end -}} + {{- $meta := dict "uri" $uri "title" .Title "tags" .Params.tags "categories" .Params.categories -}} + {{- $meta = $.Site.Params.dateFormat | default "2006-01-02" | .PublishDate.Format | dict "date" | merge $meta -}} + {{- with .Description -}} + {{- $index = $index | append (dict "content" . "objectID" $uri | merge $meta) -}} + {{- end -}} + {{- $params := .Params | merge $.Site.Params.page -}} + {{/* Extended Markdown syntax */}} + {{- $content := dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" -}} + {{/* Remove line number for code */}} + {{- $content = $content | replaceRE ` *\d*\n?` "" -}} + {{- range $i, $contenti := split $content "