second batch of restructure

This commit is contained in:
teldra 2022-04-10 02:24:33 +02:00
parent 722a701944
commit 20139b8f8d
11 changed files with 52 additions and 33 deletions

View File

@ -1,7 +0,0 @@
![](0)
![](1)
![](2)
![](3)
![](4)
![](5)
![](6)

View File

@ -0,0 +1,5 @@
---
title: "La Le Lu"
date: 2022-04-10T01:08:23+02:00
---
sadasd

View File

@ -1,11 +0,0 @@
---
title: ""
date: {{ .Date }}
when: ""
price: ""
covid: ""
contact: ""
categories: []
tags: []
events: []
---

View File

@ -1,13 +1,4 @@
---
title: ""
date: {{ .Date }}
newscategories: []
eventcategories: []
when: ""
featured: false
covid: ""
contact: ""
price: ""
draft: false
tags: []
---

View File

@ -9,8 +9,10 @@
{{ $title := "" }}
{{ $pic := "true" }}
{{ $pre := "l1" }}
{{- $paginator := "" -}}
{{ $part := .Layout }}
{{ $partial_before := "" }}
{{ $paginate := true }}
{{ if eq .Layout "article_list" }}
{{ if eq .Section "events" }}
{{- $pages = where $pages ".Params.when" "ne" nil -}}
@ -26,14 +28,18 @@
{{ else }}
{{ if eq .Kind "term" }}
{{- $pages = .Data.Pages -}}
{{ $part = "easy_list" }}
{{ $part = "article_list" }}
{{ else if eq .Kind "taxonomy" }}
{{- $pages = .Data.Terms.Alphabetical -}}
{{ $part = "easy_list" }}
{{ $part = "tags_n_categories" }}
{{ $paginate = false }}
{{ end }}
{{ end }}
{{ if eq $paginate true}}
{{- $paginator = .Paginate $pages -}}
{{ end }}
{{ if and $pre $part }}
{{ $partial := string (printf "%s/%s" $pre $part) }}
{{ partial $partial (dict "context" . "pages" $pages "amount" "5" "title" $title "content" .Content "pic" $pic "type" .Type "partial_before" $partial_before) }}
{{ partial $partial (dict "context" . "paginator" $paginator "pages" $pages "amount" "5" "title" $title "content" .Content "pic" $pic "type" .Type "partial_before" $partial_before) }}
{{ end }}
{{ end }}

View File

@ -3,6 +3,7 @@
{{ end }}
{{ define "content" }}
{{ time.Format "Monday, Jan 2, 2006" "2015-01-21" }}
{{- $all := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.searchSections }}
{{ $days := int (mul (mul (int .Site.Params.featured_expire) 7) -1) }}
{{ $featured := where (where (where $all ".Params.featured" "=" true) "Type" "in" .Site.Params.searchSections) ".Params.Lastmod" "gt" (now.AddDate 0 0 $days) }}

View File

@ -46,3 +46,27 @@
</div>
{{- end }}
</div>
{{ define "pagefooter" }}
{{ if and (eq .Kind "page") (or (eq .Section "news") (eq .Section "events") (eq .Section "about")) }}
<div id="article_footer">
<div style="flex-grow: 1; flex-direction: column;">
<b>{{ if i18n "created" }}{{ i18n "created" }}{{ else }}{{ "Created" }}{{ end }}</b><br>
{{ .Date | time.Format ":date_full" }}
</div>
{{ if ne .Date .Lastmod }}
<div style="flex-grow: 1; flex-direction: column;">
<b>{{ if i18n "lastmod" }}{{ i18n "lastmod" }}{{ else }}{{ "Last modification" }}{{ end }}</b><br>
{{ .Lastmod | time.Format ":date_full" }}
</div>
{{ end }}
</div>
{{ end }}
{{ end }}
{{ define "sidebar" }}
{{ if ne .Type "tools" }}
{{- partial "contentlayouts/menu.html" . }}
{{ end }}
{{ end }}

View File

@ -131,7 +131,7 @@
<div class="margin_top_1rem {{ if .group }} visibleIf margin_left_1rem" data-visibleif-rule=" {{ .group }}group == 'true' {{ end }}" class="minmax">
<div class="minmax" style="display: flex; flex-direction: column;">
<label class="{{ if $pageform.names }}sr-only{{ end }}" for="{{ .title }}">{{ .name }}{{- if .required -}}{{- " *" -}}{{- end -}}</label>
<input type="{{ .input_type }}" name="{{ .title }}" id="{{ .title }}" {{ if $pageform.names }}placeholder="{{ .name }}{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}>
<input type="{{ .input_type }}" name="{{ .title }}" id="{{ .title }}" {{ if $pageform.names }}placeholder="{{ .name }}"{{ end }}>
</div>
</div>
{{ end }}

View File

@ -30,8 +30,10 @@ function showInput(e) {
var output_info = document.getElementById("myform");
var display = document.getElementById("display");
var d = new Date();
var datestring = d.getFullYear() + "-" + ("0"+(d.getMonth()+1)).slice(-2) + "-" + ("0" + d.getDate()).slice(-2) + "T" + ("0" + d.getHours()).slice(-2) + ":" + ("0" + d.getMinutes()).slice(-2) + ":00+02:00\"";
var datestring = d.getFullYear() + "-" + ("0"+(d.getMonth()+1)).slice(-2) + "-" + ("0" + d.getDate()).slice(-2) + "T" + ("0" + d.getHours()).slice(-2) + ":" + ("0" + d.getMinutes()).slice(-2) + ":00+02:00";
var form = document.querySelector('form[id="myform"]');
var title = form.elements['title'].value;
@ -49,6 +51,11 @@ function showInput(e) {
var featured = check_checkboxes('featured');
var about = check_checkboxes('about');
var lastmod = form.elements['lastmod'].value;
if (lastmod) {
var dl = new Date(lastmod);
var lastmod = dl.getFullYear() + "-" + ("0"+(dl.getMonth()+1)).slice(-2) + "-" + ("0" + dl.getDate()).slice(-2) + "T" + "14:" + "00:00+02:00";
}
if (newtags != '""') {
var ntags = newtags;
@ -105,7 +112,7 @@ function showInput(e) {
if (title && content) {
display.innerHTML += "---<br>";
display.innerHTML += "title: \"" + title + "\"<br>";
display.innerHTML += "date: \"" + datestring + "<br>";
display.innerHTML += "date: " + datestring + "<br>";
if (featured != '') {
display.innerHTML += "featured: true<br>";
@ -136,6 +143,9 @@ function showInput(e) {
if (price) {
display.innerHTML += "price: \"" + price + "\"<br>";
}
if (lastmod) {
display.innerHTML += "lastmod: " + lastmod + "<br>";
}
if (contact) {
display.innerHTML += "contact: \"" + contact + "\"<br>";
}