Compare commits

...

2 commits

3 changed files with 74 additions and 27 deletions

View file

@ -37,32 +37,63 @@ disableKinds = ["RSS", "sitemap"]
[module]
# replacement allow for easier local development
replacements = "git.sandpoints.org/Drawwell/SandpointsTheme -> /home/m/devel/SandpointsTheme"
#
# replacements = ["git.sandpoints.org/Drawwell/SandpointsTheme -> /home/m/devel/SandpointsTheme", "git.sandpoints.org/Drawwell/SandpointsEditPage -> /home/m/devel/SandpointsEditPage"]
# if any customizations are added one should add also
# the hugo's skeleton directory structure:
# archetypes, assets, layouts, static & data
#
[[module.imports]]
path = "git.sandpoints.org/Drawwell/SandpointsTheme"
[[module.imports.mounts]]
source = "archetypes"
target = "archetypes"
[[module.imports.mounts]]
source = "assets"
target = "assets"
[[module.imports.mounts]]
source = "layouts"
target = "layouts"
[[module.imports.mounts]]
source = "static"
target = "static"
[[module.imports.mounts]]
source = "data"
target = "data"
# metadata file needed for autocompletion
#
[[module.imports.mounts]]
source = "exampleSite/content/metadata/_index.md"
target = "content/metadata/_index.md"
# if only [[module.imports]]'s path is provided
# and repo is made into hugo module (hugo mod init repo_name)
# [[module.imports]]'s path should apply SandpointsTheme
#
# if repo needs some specific customization the rest of the
# mounts below should be added respectively
#
# [[module.imports.mounts]]
# source = "archetypes"
# target = "archetypes"
# [[module.imports.mounts]]
# source = "assets"
# target = "assets"
# [[module.imports.mounts]]
# source = "data"
# target = "data"
# [[module.imports.mounts]]
# source = "layouts"
# target = "layouts"
# [[module.imports.mounts]]
# source = "static"
# target = "static"
# [[module.imports.mounts]]
# source = "customizations/specific_custom_instance/assets/css/site.css"
# target = "assets/css/site.css"
# below is an example of customizations added to hugo web site
#
# [[module.imports.mounts]]
# source = "customizations/Dotawo/assets/css/site.css"
# target = "assets/css/site.css"
# [[module.imports.mounts]]
# source = "customizations/Dotawo/static/css/site.min.css"
# target = "static/css/site.min.css"
# below is the list of imports to get the svelte webapp
# which handles editing the website
#
[[module.imports]]
path = "git.sandpoints.org/Drawwell/SandpointsEditPage"
[[module.imports.mounts]]
source = "public/index.md"
target = "content/edit/index.md"
[[module.imports.mounts]]
source = "public/global.css"
target = "static/edit/build/global.css"
[[module.imports.mounts]]
source = "public/build/bundle.css"
target = "static/edit/build/bundle.css"
[[module.imports.mounts]]
source = "public/build/bundle.js"
target = "static/edit/build/bundle.js"
[[module.imports.mounts]]
source = "public/build/bundle.js.map"
target = "static/edit/build/bundle.js.map"

View file

@ -0,0 +1,4 @@
---
title: "meta"
outputs: js
---

View file

@ -10,6 +10,9 @@
{{ $sandnamePlural := (slice) }}
{{ $couldHaveSection := "" }}
{{ $couldHave := (slice)}}
<div class="{{ $scratch.depth | default "crust" }}title"><span class="supt">{{ substr $currentDir 0 -1 }}{{ substr .Title 0 1 }}</span>{{ substr .Title 1 }}</div></div>
<div class="grid">
@ -23,6 +26,9 @@
{{ range $k, $v := $.Site.Data.sandpointsnamegraph }}
{{ $sandnamePlural = $sandnamePlural | append $v }}
{{ if eq $scratch.has $v }}
{{ $couldHaveSection = $k }}
{{ end }}
{{ end }}
{{ $paramsKeys := (slice) }}
{{ range $k, $v := $currentNode.Params }}
@ -94,5 +100,11 @@
{{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}<div class="keywords"><span class="sup">keywords</span>{{- $v -}}{{- else -}},&nbsp;{{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}</div>{{- end -}}
{{ $var := printf "repo={\"frontmatter\": %s, \"content\": %s, \"path\": \"%s\", \"relpermalink\": \"%s\"}" (jsonify .Params) (jsonify .RawContent) .File.Path .RelPermalink| resources.FromString (printf "js/repo/%s.js" .File.UniqueID) }}
{{ if $couldHaveSection }}
{{ range where .Site.RegularPages "Section" $couldHaveSection }}
{{ $couldHave = $couldHave | append .File.LogicalName }}
{{ end }}
{{ end }}
{{ $var := printf "repo={\"frontmatter\": %s, \"content\": %s, \"path\": \"%s\", \"relpermalink\": \"%s\", \"couldhave\": %s }" (jsonify .Params) (jsonify .RawContent) .File.Path .RelPermalink (jsonify $couldHave)| resources.FromString (printf "js/repo/%s.js" .File.UniqueID) }}
{{ $dummy := $var.Permalink }}