diff --git a/themes/acoeur/assets/js/setup.js b/themes/acoeur/assets/js/setup.js index fca97ea..717c099 100644 --- a/themes/acoeur/assets/js/setup.js +++ b/themes/acoeur/assets/js/setup.js @@ -9,8 +9,12 @@ const topSection = window.location.pathname.split('/')[1] if (topSection) document.body.classList.add(topSection) // Differentiate users and authors -if ('pages' === topSection) +if ('pages' === topSection) { document.body.classList.add('author') +} else { + // Check if access is authorized to root page + fetch('/').then(() => document.body.classList.add('author')) +} // Setup a "property" attribute, to send to the backend for insertion/update/deletion document.querySelectorAll('body > header h1, main article header h1') diff --git a/themes/acoeur/layouts/_default/assets.html b/themes/acoeur/layouts/_default/assets.html new file mode 100644 index 0000000..8ca5c33 --- /dev/null +++ b/themes/acoeur/layouts/_default/assets.html @@ -0,0 +1,27 @@ +{{ define "main" }} +
+ + + {{ with .Content }} +
+ {{- . -}} +
+ {{ end }} + +
+ {{ range .Resources }} +
+ {{.}} + {{ . }} + +
+ {{ end }} +
+
+{{ end }} diff --git a/themes/acoeur/layouts/_default/list.html b/themes/acoeur/layouts/_default/list.html index 281f404..4c2767e 100644 --- a/themes/acoeur/layouts/_default/list.html +++ b/themes/acoeur/layouts/_default/list.html @@ -1,12 +1,9 @@ {{ define "main" }}
@@ -33,19 +30,8 @@ {{ .Render "summary-with-image" }} {{ end }} - {{- template "_internal/pagination.html" . -}} - {{ if .Parent.IsHome }} - {{ range .Resources }} -
- {{.}} - {{ . }} - -
- {{ end }} - {{ end }} + {{- template "_internal/pagination.html" . -}} {{ end }}