a lot of stuff done in SandpointsDev...

This commit is contained in:
Marcell Mars 2020-09-15 04:07:23 +02:00
parent e5aab7f744
commit 9a190e9d95
13 changed files with 175 additions and 132 deletions

View File

@ -0,0 +1 @@
@-webkit-keyframes spin{from{-webkit-transform:rotate(0deg);opacity:.4}50%{-webkit-transform:rotate(180deg);opacity:1}to{-webkit-transform:rotate(360deg);opacity:.4}}@keyframes spin{from{transform:rotate(0deg);opacity:.2}50%{transform:rotate(180deg);opacity:1}to{transform:rotate(360deg);opacity:.2}}.soundcite-loaded{border-radius:6px;padding:0 5px;display:inline-block;cursor:pointer}.soundcite-loaded:before{display:inline-block;content:"";vertical-align:-10%;margin-right:.25em}.soundcite-loading:before{margin-right:.5em;font-size:.9em;position:relative;top:-.05em;height:.75em;width:.75em;border:2px solid #000;border-right-color:transparent;border-radius:50%;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}.soundcite-play:before{font-size:.9em;position:relative;top:-.05em;border:.5em solid transparent;border-left:.75em solid #000}.soundcite-pause:before{font-size:.9em;position:relative;top:-.05em;height:1em;border-left:.75em double #000;border-right:.5em solid transparent}

View File

@ -432,6 +432,32 @@ body {
color: black;
}
.headiter {
display: flex;
justify-content: space-between;
background-color: red;
color: white;
padding-top: 1rem;
padding-bottom: 0.5rem;
padding-left: 1rem;
padding-right:1rem;
margin-bottom: 1rem;
}
a.edit-button {
color:#fff;
text-decoration:none
}
a.edit-button:hover {
text-decoration:underline;
-webkit-text-decoration-color:red;
text-decoration-color:white;
font-weight:500;
font-size:.97em;
cursor:pointer
}
.header {
display: grid;
grid-template-columns: auto;

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ window.addEventListener('scroll', function(e) {
let grid = document.querySelector('.grid')
let gridrect = mantletitle.getBoundingClientRect();
if ((document.querySelector('body').clientHeight - (grid.clientHeight + mantle.clientHeight + 32)) < window.innerHeight) {
if ((document.querySelector('body').clientHeight - (grid.clientHeight + mantletitle.clientHeight + 32)) < window.innerHeight) {
return
}

View File

@ -8,6 +8,7 @@ disableKinds = ["RSS", "sitemap"]
[params]
description = "Network of activists, researchers and practitioners against the criminalisation of solidarity & for a common care infrastructure."
images = ["/images/piratecaqre.png"]
giturl = "http://127.0.0.1:3333/Sandpoints/dev"
title = "Pirate Care Syllabus"
home = "/syllabus/"

View File

@ -1,23 +1,12 @@
<!DOCTYPE html>
{{- $filePath := .File -}}
{{- $gitUrl := .Site.Params.giturl -}}
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-us{{ end }}">
{{- partial "head.html" . -}}
<body>
{{ with .Site.Data.myvars.edit }}
<div class="headiter">
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_edit/master/content/{{ $filePath }}">edit_this</a>
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_new/master/content/topic/">add_new_topic</a>
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_new/master/content/session/">add_new_session</a>
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_edit/master/PUBLISH.trigger.md">publish</a>
<a class="edit-button" target="_blank" href="{{ $gitUrl }}"> ? </a>
</div>
{{ end }}
{{- partial "header.html" . -}}
{{$currentNode := . }}
<h1>{{ .Title }}</h1>
{{- block "main" . }}{{- end }}
{{- partial "footer.html" . -}}
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-us{{ end }}">
<head>
{{- partialCached "head.html" . -}}
{{- partialCached "sandpointjs.html" . .RelPermalink -}}
</head>
<body>
{{- block "singlebody" . }}{{- end }}
{{- partialCached "footer.html" . -}}
</body>
</html>

View File

@ -0,0 +1,3 @@
<ul>
<li>{{ .Title }}</li>
</ul>

View File

@ -1,63 +1,52 @@
{{ define "main" }}
{{$currentNode := . }}
{{- define "singlebody" -}}
{{ $currentNode := . }}
{{ $currentDir := "" }}
{{ with .File }}
{{ $currentDir = .Dir }}
{{ end }}
{{ range $k, $v := $.Site.Data.sandpointsnamegraph }}
{{ if eq (substr $currentNode.File.Dir 0 -1) $k }}
{{ if eq (substr $currentDir 0 -1) $k }}
{{ $.Scratch.Set "plural" (index $v "plural") }}
{{ $.Scratch.Set "depth" (index $v "depth") }}
{{ if eq (index $v "depth") "core" }}
{{ $.Scratch.Add "core" $k }}
{{ $.Scratch.Add "mantle" (index $v "has" 0) }}
{{ $.Scratch.Add "crust" (index (index $currentNode.Site.Data.sandpointsnamegraph ($.Scratch.Get "mantle")) "has" 0) }}
{{ end }}
{{ if eq (index $v "depth") "mantle" }}
{{ $.Scratch.Add "core" (index $v "in" 0) }}
{{ $.Scratch.Add "mantle" $k }}
{{ $.Scratch.Add "crust" (index $v "has" 0) }}
{{ end }}
{{ if eq (index $v "depth") "crust" }}
{{ $.Scratch.Add "core" (index (index $currentNode.Site.Data.sandpointsnamegraph (index $v "in" 0)) "in" 0) }}
{{ $.Scratch.Add "mantle" (index $v "in" 0) }}
{{ $.Scratch.Add "crust" $k }}
{{ $.Scratch.Add "mantle_has" (index (index $currentNode.Site.Data.sandpointsnamegraph (index $v "in" 0)) "has" 1) }}
{{ end }}
{{ with index $v "in" }}
{{ $.Scratch.Set "in" (index $v "in") }}
{{ end }}
{{ with index $v "has" }}
{{ $.Scratch.Set "has" (index $v "has") }}
{{ end }}
{{ end }}
{{ end }}
<div class="{{ $.Scratch.Get "depth" }}title"><span class="sup">{{ substr .File.Dir 0 -1 }}{{ substr .Title 0 1 }}</span>{{ substr .Title 1 }}</div></div>
{{ $depth := $.Scratch.Get "depth" }}
{{- partialCached "header.html" . $depth .RelPermalink hugo.Environment -}}
<div class="grid">
<div class="leftcolumn">
{{ if ne (trim .Page.TableOfContents "\n") "<nav id=\"TableOfContents\"></nav>" }}
{{ .Page.TableOfContents }}
{{ end }}
</div>
<div class="rightcolumn">
{{ if (not (eq ($.Scratch.Get "depth") "crust")) }}
<div class="has">
<span class="sup">has {{ index ($.Scratch.Get "has") 1 }}</span>
</div>
<div class="afterhas">
{{ range index $currentNode.Params (printf "has_%s" (index ($.Scratch.Get "has") 1) )}}
{{ with $.GetPage (printf "%s%s" (printf "/%s/" (index ($.Scratch.Get "has") 0)) . ) }}
<div class="{{ index $.Site.Data.sandpointsnamegraph (index ($.Scratch.Get "has") 0) "depth" }}">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
{{ end }}
{{ end }}
{{ end }}
<h1>{{ .Title }}</h1>
{{ if eq ($.Scratch.Get "depth") "crust" }}
<div class="has">
<span class="sup">in {{ index ($.Scratch.Get "in") 1 }}</span>
</div>
<div class="afterhas">
{{ range where $.Site.RegularPages ".Section" (index ($.Scratch.Get "in") 0) }}
{{ if in (index .Params (printf "has_%s" ($.Scratch.Get "plural"))) $currentNode.File.LogicalName }}
<div class="{{ substr .File.Dir 0 -1 }}">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
{{ else if in $currentNode.Params.is_in .File.LogicalName }}
<div class="{{ substr .File.Dir 0 -1 }}">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
{{ end }}
{{ end }}
{{ end }}
</div>
</div>
</div>
{{- partialCached "singlebody.html" . $depth .RelPermalink hugo.Environment -}}
<div class="content">{{ .Content }}</div>
{{ end }}
{{- end -}}

View File

@ -1,10 +0,0 @@
{{ if (or (eq hugo.Environment "gitea") (eq hugo.Environment "preview") ) }}
{{ $sitemin := resources.Get "css/site.min.css" }}
<link rel="stylesheet" href="{{ $sitemin.RelPermalink }}" />
<link rel="stylesheet" href="/css/player.min.css" />
{{ else if (or (eq hugo.Environment "offline") (.Site.IsServer)) }}
{{ $style := resources.Get "css/site.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" />
{{ $style := resources.Get "css/player.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" />
{{ end }}

View File

@ -1,46 +1,39 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
{{ if .Description }}
<meta name="description" content="{{ .Description }}" />
{{ end }}
{{ if .Keywords }}
<meta name="keywords" content="{{ delimit .Keywords "," }}" />
{{ end }}
{{ if .Params.Author }}
<meta name="author" content="{{ .Params.Author}}" />
{{ end }}
{{ if .Description }}
<meta name="description" content="{{ .Description }}" />
{{ end }}
{{ if .Keywords }}
<meta name="keywords" content="{{ delimit .Keywords "," }}" />
{{ end }}
{{ if .Params.Author }}
<meta name="author" content="{{ .Params.Author}}" />
{{ end }}
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }}
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }}
{{ hugo.Generator }}
{{ hugo.Generator }}
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#996561">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#996561">
{{ if (or (eq hugo.Environment "gitea") (eq hugo.Environment "preview") ) }}
{{ $sitemin := resources.Get "css/site.min.css" }}
<link rel="stylesheet" href="{{ $sitemin.RelPermalink }}" />
{{ $player := resources.Get "css/player.min.css" }}
<link rel="stylesheet" href="{{ $player.RelPermalink }}" />
{{ else if (or (eq hugo.Environment "offline") (.Site.IsServer)) }}
{{ $style := resources.Get "css/site.css" | postCSS (dict "config" "assets/css/postcss.config.js") | minify }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" />
{{ $style := resources.Get "css/player.css" | postCSS (dict "config" "assets/css/postcss.config.js") | minify }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" />
{{ end }}
{{ if (or (eq hugo.Environment "gitea") (eq hugo.Environment "preview") ) }}
{{ $sitemin := resources.Get "css/site.min.css" }}
<link rel="stylesheet" href="{{ $sitemin.RelPermalink }}" />
{{ $player := resources.Get "css/player.min.css" }}
<link rel="stylesheet" href="{{ $player.RelPermalink }}" />
{{ else if (or (eq hugo.Environment "offline") (.Site.IsServer)) }}
{{ $style := resources.Get "css/site.css" | postCSS (dict "config" "assets/css/postcss.config.js") | minify }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" />
{{ $style := resources.Get "css/player.css" | postCSS (dict "config" "assets/css/postcss.config.js") | minify }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" />
{{ end }}
<script type="text/javascript">var relPathDepth = {{ .RelPermalink | strings.Count "/" }};</script>
{{ $sjsopts := dict "targetPath" "js/sandpoints.js" "minify" "true"}}
{{ $sjs := resources.Get "js/sandpoints.js" | js.Build $sjsopts }}
<script defer src='{{ $sjs.RelPermalink }}' type="application/javascript"></script>
<title>{{ block "title" . }}{{- .Title }} - {{ .Site.Title -}}{{ end }}</title>
</head>
<title>{{ block "title" . }}{{- .Title }} - {{ .Site.Title -}}{{ end }}</title>

View File

@ -1,18 +1,15 @@
{{ $currentSession := . }}
{{ $currentNode := . }}
{{- range $k, $v := .Page.Site.Data.sandpointsnamegraph -}}
{{ if eq $currentSession.File.Dir (printf "%s/" $k) }}
{{ $.Scratch.Add "depth" (index $v "depth") }}
{{ if eq (index $v "depth") "mantle" }}
{{ $.Scratch.Add "home" (index $v "in" 0) }}
{{ end }}
{{ if eq (index $v "depth") "crust" }}
{{ $.Scratch.Add "home" (index (index $currentSession.Site.Data.sandpointsnamegraph (index $v "in" 0)) "in" 0) }}
{{ $.Scratch.Add "mantle" (index $v "in" 0) }}
{{ $.Scratch.Add "mantle_has" (index (index $currentSession.Site.Data.sandpointsnamegraph (index $v "in" 0)) "has" 1) }}
{{ end }}
{{ end }}
{{- end -}}
{{- $gitUrl := .Site.Params.giturl -}}
{{ if eq hugo.Environment "preview" }}
<div class="headiter">
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_edit/master/content/{{ $currentNode.File }}">edit_this</a>
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_new/master/content/{{ $.Scratch.Get "mantle" }}/">add_new_{{ $.Scratch.Get "mantle" }}</a>
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_new/master/content/{{ $.Scratch.Get "crust" }}/">add_new_{{ $.Scratch.Get "crust" }}</a>
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_edit/master/PUBLISH.trigger.md">publish</a>
<a class="edit-button" target="_blank" href="{{ $gitUrl }}"> ? </a>
</div>
{{ end }}
<div class="header">
<a title="{{ $.Site.Home.Title }}'s Bibliotheke" href="/library/BROWSE_LIBRARY.html" class="bibliotheke" target="_blank">
@ -20,7 +17,7 @@
</a>
<div class="breadcrumbs">
{{ if ne ($.Scratch.Get "depth") "core" }}
<a href="{{ with $currentSession.Site.GetPage (printf "/%s/index.md" ($.Scratch.Get "home")) }}{{ .RelPermalink }}{{ end }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}"><span class="sup">{{ with $currentSession.Site.GetPage (printf "/%s/index.md" ($.Scratch.Get "home")) }}{{ substr .Title 0 1 }}</span><i>{{ substr .Title 1 }}</i></a>{{ end }}
<a href="{{ with $currentNode.Site.GetPage (printf "/%s/index.md" ($.Scratch.Get "core")) }}{{ .RelPermalink }}{{ end }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}"><span class="sup">{{ with $currentNode.Site.GetPage (printf "/%s/index.md" ($.Scratch.Get "core")) }}{{ substr .Title 0 1 }}</span><i>{{ substr .Title 1 }}</i></a>{{ end }}
{{ end }}
{{ if eq ($.Scratch.Get "depth") "mantle" }}
@ -28,10 +25,10 @@
{{ end }}
{{ if eq ($.Scratch.Get "depth") "crust" }}
{{ range first 1 (where (where $.Site.RegularPages ".Section" ($.Scratch.Get "mantle")) (printf ".Params.has_%s" ($.Scratch.Get "mantle_has")) "intersect" (slice $currentSession.File.LogicalName)) }}
{{ range first 1 (where (where $.Site.RegularPages ".Section" ($.Scratch.Get "mantle")) (printf ".Params.has_%s" ($.Scratch.Get "mantle_has")) "intersect" (slice $currentNode.File.LogicalName)) }}
<span><i> » <a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a></i></span>
{{ end }}
<span class="mantlebar"><i> » <a href="{{ $currentSession.RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $currentSession.Title }}</a></i></span>
<span class="mantlebar"><i> » <a href="{{ $currentNode.RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $currentNode.Title }}</a></i></span>
{{ end }}
</div>
</div>

View File

@ -0,0 +1,4 @@
<script type="text/javascript">var relPathDepth = {{- .RelPermalink | strings.Count "/" -}};</script>
{{ $sjsopts := dict "targetPath" "js/sandpoints.js" "minify" "true"}}
{{ $sjs := resources.Get "js/sandpoints.js" | js.Build $sjsopts }}
<script defer src='{{ $sjs.RelPermalink }}' type="application/javascript"></script>

View File

@ -0,0 +1,49 @@
{{ $currentNode := . }}
{{ $currentDir := "" }}
{{ with .File }}
{{ $currentDir = .Dir }}
{{ end }}
<div class="{{ $.Scratch.Get "depth" }}title"><span class="sup">{{ substr $currentDir 0 -1 }}{{ substr .Title 0 1 }}</span>{{ substr .Title 1 }}</div></div>
<div class="grid">
<div class="leftcolumn">
{{ if ne (trim .Page.TableOfContents "\n") "<nav id=\"TableOfContents\"></nav>" }}
{{ .Page.TableOfContents }}
{{ end }}
</div>
<div class="rightcolumn">
{{ if (not (eq ($.Scratch.Get "depth") "crust")) }}
<div class="has">
<span class="sup">has {{ index ($.Scratch.Get "has") 1 }}</span>
</div>
<div class="afterhas">
{{ range index $currentNode.Params (printf "has_%s" (index ($.Scratch.Get "has") 1) )}}
{{ with $.GetPage (printf "%s%s" (printf "/%s/" (index ($.Scratch.Get "has") 0)) . ) }}
<div class="{{ index $.Site.Data.sandpointsnamegraph (index ($.Scratch.Get "has") 0) "depth" }}">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
{{ end }}
{{ end }}
{{ end }}
{{ if eq ($.Scratch.Get "depth") "crust" }}
<div class="has">
<span class="sup">in {{ index ($.Scratch.Get "in") 1 }}</span>
</div>
<div class="afterhas">
{{ range where $.Site.RegularPages ".Section" (index ($.Scratch.Get "in") 0) }}
{{ if in (index .Params (printf "has_%s" ($.Scratch.Get "plural"))) $currentNode.File.LogicalName }}
<div class="{{ substr $currentDir 0 -1 }}">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
{{ else if in $currentNode.Params.is_in .File.LogicalName }}
<div class="{{ substr $currentDir 0 -1 }}">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
{{ end }}
{{ end }}
{{ end }}
</div>
</div>
</div>