diff --git a/archetypes/micro.md b/archetypes/micro.md new file mode 100644 index 0000000..efbf127 --- /dev/null +++ b/archetypes/micro.md @@ -0,0 +1,5 @@ +--- +title: "{{ replace .TranslationBaseName "-" " " | humanize }}" +date: {{ .Date }} + +--- \ No newline at end of file diff --git a/assets/js/contact.js b/assets/js/contact.js new file mode 100644 index 0000000..b390368 --- /dev/null +++ b/assets/js/contact.js @@ -0,0 +1,61 @@ +/** + * @file + * A JavaScript file for the contact form. + */ + +(function ($) { + + 'use strict'; + + // Contact form. + $('.contact-form').each(function (e) { + var $contact_form = $(e); + var $contact_button = $contact_form.find('.form-submit'); + var contact_action = '/php/contact.php'; + + // Display the hidden form. + $contact_form.removeClass('hidden'); + + // Wait for a mouse to move, indicating they are human. + $('body').on('mousemove', function () { + // Unlock the form. + $contact_form.attr('action', contact_action); + $contact_button.first().removeAttribute('disabled'); + }); + + // Wait for a touch move event, indicating that they are human. + $('body').on('touchmove', function () { + // Unlock the form. + $contact_form.attr('action', contact_action); + $contact_button.first().removeAttribute('disabled'); + }); + + // A tab or enter key pressed can also indicate they are human. + $('body').on('keydown', function (e) { + if ((e.keyCode === 9) || (e.keyCode === 13)) { + // Unlock the form. + $contact_form.attr('action', contact_action); + $contact_button.first().removeAttribute('disabled'); + } + }); + + // Mark the form as submitted. + $contact_button.on('click', function () { + $contact_form.addClass('js-submitted'); + }); + + // Display messages. + if (location.search.substring(1) !== '') { + switch (location.search.substring(1)) { + case 'submitted': + $('.contact-submitted').removeClass('hidden'); + break; + + case 'error': + $('.contact-error').removeClass('hidden'); + break; + } + } + }); + +})(u); diff --git a/assets/js/cookieconsent.js b/assets/js/cookieconsent.js new file mode 100644 index 0000000..326593c --- /dev/null +++ b/assets/js/cookieconsent.js @@ -0,0 +1,31 @@ +/* eslint-disable no-undef */ +(function () { + + 'use strict'; + + const cookiebanner = document.querySelector('.cookieconsent'); + const cookieconsent = localStorage.getItem('cookieconsent'); + + if (cookiebanner && !cookieconsent) { + cookiebanner.classList.remove('hidden'); + cookiebanner.classList.add('js-cookieconsent-open'); + } + + const cookie_buttons = Array.prototype.slice.call( + document.querySelectorAll('button[data-consent]') + ); + + cookie_buttons.forEach(function (button) { + button.addEventListener('click', function () { + if (button.getAttribute('data-consent') === 'true') { + localStorage.setItem('cookieconsent', 'accept'); + } + else { + localStorage.setItem('cookieconsent', 'decline'); + } + cookiebanner.classList.remove('js-cookieconsent-open'); + cookiebanner.classList.add('hidden'); + }); + }); + +})(); diff --git a/assets/js/jq_versions/contact.js b/assets/js/jq_versions/contact.js new file mode 100644 index 0000000..b243ace --- /dev/null +++ b/assets/js/jq_versions/contact.js @@ -0,0 +1,61 @@ +/** + * @file + * A JavaScript file for the contact form. + */ + +(function ($) { + + 'use strict'; + + // Contact form. + $('.contact-form').each(function () { + var $contact_form = $(this); + var $contact_button = $contact_form.find('.form-submit'); + var contact_action = '/php/contact.php'; + + // Display the hidden form. + $contact_form.removeClass('hidden'); + + // Wait for a mouse to move, indicating they are human. + $('body').mousemove(function () { + // Unlock the form. + $contact_form.attr('action', contact_action); + $contact_button.attr('disabled', false); + }); + + // Wait for a touch move event, indicating that they are human. + $('body').on('touchmove', function () { + // Unlock the form. + $contact_form.attr('action', contact_action); + $contact_button.attr('disabled', false); + }); + + // A tab or enter key pressed can also indicate they are human. + $('body').keydown(function (e) { + if ((e.keyCode === 9) || (e.keyCode === 13)) { + // Unlock the form. + $contact_form.attr('action', contact_action); + $contact_button.attr('disabled', false); + } + }); + + // Mark the form as submitted. + $contact_button.click(function () { + $contact_form.addClass('js-submitted'); + }); + + // Display messages. + if (location.search.substring(1) !== '') { + switch (location.search.substring(1)) { + case 'submitted': + $('.contact-submitted').removeClass('hidden'); + break; + + case 'error': + $('.contact-error').removeClass('hidden'); + break; + } + } + }); + +})(jQuery); diff --git a/assets/js/jq_versions/mobile.js b/assets/js/jq_versions/mobile.js new file mode 100644 index 0000000..774b50c --- /dev/null +++ b/assets/js/jq_versions/mobile.js @@ -0,0 +1,27 @@ +/** + * @file + * A JavaScript file for the mobile menu. + */ + +(function ($) { + + 'use strict'; + + // Activate the mobil menu for small screens. + if (window.matchMedia && $('.mobile-nav').length) { + var mq = window.matchMedia('(max-width: 999px)'); + if (mq.matches) { + // Toggle the mobile nav sheet. + $('.mobile-nav__cover, .mobile-nav__toggle').click(function (e) { + e.preventDefault(); + $('body').scrollTop(0).toggleClass('js-nav-open'); + }); + + // Close the nav sheet after click (needed for anchor links). + $('.mobile-nav__sheet').find('a').click(function () { + $('body').removeClass('js-nav-open'); + }); + } + } + +})(jQuery); diff --git a/assets/js/jq_versions/script.js b/assets/js/jq_versions/script.js new file mode 100644 index 0000000..1a4aec7 --- /dev/null +++ b/assets/js/jq_versions/script.js @@ -0,0 +1,13 @@ +/** + * @file + * A JavaScript file for the theme. + */ + +(function ($) { + + 'use strict'; + + // Add a js class to the html-tag when JavsScript is active. + $('html').removeClass('nojs').addClass('js'); + +})(jQuery); diff --git a/assets/js/lib/alpine.min.js b/assets/js/lib/alpine.min.js new file mode 100644 index 0000000..ea3bc48 --- /dev/null +++ b/assets/js/lib/alpine.min.js @@ -0,0 +1,6 @@ +/* Alpine.js 3.10.2 alpinejs.dev/ */ +(()=>{var We=!1,Ge=!1,j=[];function Nt(e){nn(e)}function nn(e){j.includes(e)||j.push(e),on()}function he(e){let t=j.indexOf(e);t!==-1&&j.splice(t,1)}function on(){!Ge&&!We&&(We=!0,queueMicrotask(sn))}function sn(){We=!1,Ge=!0;for(let e=0;ee.effect(t,{scheduler:r=>{Je?Nt(r):r()}}),Ye=e.raw}function Ze(e){K=e}function Dt(e){let t=()=>{};return[n=>{let i=K(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),Y(i))},i},()=>{t()}]}var $t=[],Lt=[],Ft=[];function jt(e){Ft.push(e)}function _e(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,Lt.push(t))}function Kt(e){$t.push(e)}function Bt(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function Qe(e,t){!e._x_attributeCleanups||Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}var et=new MutationObserver(Xe),tt=!1;function rt(){et.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),tt=!0}function cn(){an(),et.disconnect(),tt=!1}var ee=[],nt=!1;function an(){ee=ee.concat(et.takeRecords()),ee.length&&!nt&&(nt=!0,queueMicrotask(()=>{ln(),nt=!1}))}function ln(){Xe(ee),ee.length=0}function m(e){if(!tt)return e();cn();let t=e();return rt(),t}var it=!1,ge=[];function zt(){it=!0}function Vt(){it=!1,Xe(ge),ge=[]}function Xe(e){if(it){ge=ge.concat(e);return}let t=[],r=[],n=new Map,i=new Map;for(let o=0;os.nodeType===1&&t.push(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.push(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{Qe(s,o)}),n.forEach((o,s)=>{$t.forEach(a=>a(s,o))});for(let o of r)if(!t.includes(o)&&(Lt.forEach(s=>s(o)),o._x_cleanups))for(;o._x_cleanups.length;)o._x_cleanups.pop()();t.forEach(o=>{o._x_ignoreSelf=!0,o._x_ignore=!0});for(let o of t)r.includes(o)||!o.isConnected||(delete o._x_ignoreSelf,delete o._x_ignore,Ft.forEach(s=>s(o)),o._x_ignore=!0,o._x_ignoreSelf=!0);t.forEach(o=>{delete o._x_ignoreSelf,delete o._x_ignore}),t=null,r=null,n=null,i=null}function xe(e){return P(N(e))}function C(e,t,r){return e._x_dataStack=[t,...N(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function ot(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,i])=>{r[n]=i})}function N(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?N(e.host):e.parentNode?N(e.parentNode):[]}function P(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(i=>i.hasOwnProperty(n)),get:(r,n)=>(e.find(i=>{if(i.hasOwnProperty(n)){let o=Object.getOwnPropertyDescriptor(i,n);if(o.get&&o.get._x_alreadyBound||o.set&&o.set._x_alreadyBound)return!0;if((o.get||o.set)&&o.enumerable){let s=o.get,a=o.set,c=o;s=s&&s.bind(t),a=a&&a.bind(t),s&&(s._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(i,n,{...c,get:s,set:a})}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(s=>s.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function ye(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function be(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>un(n,i),s=>st(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function un(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function st(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),st(e[t[0]],t.slice(1),r)}}var Ht={};function x(e,t){Ht[e]=t}function te(e,t){return Object.entries(Ht).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){let[i,o]=at(t);return i={interceptor:be,...i},_e(t,o),n(t,i)},enumerable:!1})}),e}function qt(e,t,r,...n){try{return r(...n)}catch(i){J(i,e,t)}}function J(e,t,r=void 0){Object.assign(e,{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message} + +${r?'Expression: "'+r+`" + +`:""}`,t),setTimeout(()=>{throw e},0)}var ve=!0;function Ut(e){let t=ve;ve=!1,e(),ve=t}function k(e,t,r={}){let n;return _(e,t)(i=>n=i,r),n}function _(...e){return Wt(...e)}var Wt=ct;function Gt(e){Wt=e}function ct(e,t){let r={};te(r,e);let n=[r,...N(e)];if(typeof t=="function")return fn(n,t);let i=dn(n,t,e);return qt.bind(null,e,t,i)}function fn(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(P([n,...e]),i);we(r,o)}}var lt={};function pn(e,t){if(lt[e])return lt[e];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)\s/.test(e)?`(() => { ${e} })()`:e,o=(()=>{try{return new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`)}catch(s){return J(s,t,e),Promise.resolve()}})();return lt[e]=o,o}function dn(e,t,r){let n=pn(t,r);return(i=()=>{},{scope:o={},params:s=[]}={})=>{n.result=void 0,n.finished=!1;let a=P([o,...e]);if(typeof n=="function"){let c=n(n,a).catch(l=>J(l,r,t));n.finished?(we(i,n.result,a,s,r),n.result=void 0):c.then(l=>{we(i,l,a,s,r)}).catch(l=>J(l,r,t)).finally(()=>n.result=void 0)}}}function we(e,t,r,n,i){if(ve&&typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(s=>we(e,s,r,n)).catch(s=>J(s,i,t)):e(o)}else e(t)}var ut="x-";function E(e=""){return ut+e}function Yt(e){ut=e}var Jt={};function d(e,t){Jt[e]=t}function re(e,t,r){let n={};return Array.from(t).map(Zt((o,s)=>n[o]=s)).filter(Qt).map(hn(n,r)).sort(_n).map(o=>mn(e,o))}function Xt(e){return Array.from(e).map(Zt()).filter(t=>!Qt(t))}var ft=!1,ne=new Map,er=Symbol();function tr(e){ft=!0;let t=Symbol();er=t,ne.set(t,[]);let r=()=>{for(;ne.get(t).length;)ne.get(t).shift()();ne.delete(t)},n=()=>{ft=!1,r()};e(r),n()}function at(e){let t=[],r=a=>t.push(a),[n,i]=Dt(e);return t.push(i),[{Alpine:I,effect:n,cleanup:r,evaluateLater:_.bind(_,e),evaluate:k.bind(k,e)},()=>t.forEach(a=>a())]}function mn(e,t){let r=()=>{},n=Jt[t.type]||r,[i,o]=at(e);Bt(e,t.original,o);let s=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),ft?ne.get(er).push(n):n())};return s.runCleanups=o,s}var Ee=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),Se=e=>e;function Zt(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=rr.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var rr=[];function Z(e){rr.push(e)}function Qt({name:e}){return nr().test(e)}var nr=()=>new RegExp(`^${ut}([^:^.]+)\\b`);function hn(e,t){return({name:r,value:n})=>{let i=r.match(nr()),o=r.match(/:([a-zA-Z0-9\-:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var dt="DEFAULT",Ae=["ignore","ref","data","id","bind","init","for","mask","model","modelable","transition","show","if",dt,"teleport","element"];function _n(e,t){let r=Ae.indexOf(e.type)===-1?dt:e.type,n=Ae.indexOf(t.type)===-1?dt:t.type;return Ae.indexOf(r)-Ae.indexOf(n)}function B(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var pt=[],mt=!1;function Te(e=()=>{}){return queueMicrotask(()=>{mt||setTimeout(()=>{Oe()})}),new Promise(t=>{pt.push(()=>{e(),t()})})}function Oe(){for(mt=!1;pt.length;)pt.shift()()}function ir(){mt=!0}function R(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>R(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)R(n,t,!1),n=n.nextElementSibling}function O(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function sr(){document.body||O("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's ` diff --git a/layouts/partials/mobilemenu.html b/layouts/partials/mobilemenu.html new file mode 100644 index 0000000..855ba09 --- /dev/null +++ b/layouts/partials/mobilemenu.html @@ -0,0 +1,35 @@ +
+
+ {{ i18n "menu_mobile" }} +
+
+ {{ if site.IsMultiLingual }}{{ partial "language-selector.html" . }}{{ end }} +
+ +
+
diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html new file mode 100644 index 0000000..34af0cd --- /dev/null +++ b/layouts/partials/pagination.html @@ -0,0 +1,11 @@ +{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) -}} + +{{ end -}} diff --git a/layouts/partials/podcast.html b/layouts/partials/podcast.html new file mode 100644 index 0000000..3fcd133 --- /dev/null +++ b/layouts/partials/podcast.html @@ -0,0 +1,12 @@ +{{ $src := (.Params.podcast.mp3 | absURL) -}} +{{ if site.Params.Podcast.cdn -}} +{{ $src = path.Join site.Params.Podcast.cdn (.Params.podcast.mp3 | relURL) -}} +{{ end -}} +
+ +
{{ .Title }}
+
+{{ with .Params.podcast.image }} +{{ $resource := resources.Get .src }}{{ $size := "250x" }}{{ with .width }}{{ $size = (add (string .) "x") }}{{ end }}{{ $image := $resource.Resize $size -}} +
{{ .alt }}
+{{ end -}} diff --git a/layouts/partials/related.html b/layouts/partials/related.html new file mode 100644 index 0000000..81b9bcc --- /dev/null +++ b/layouts/partials/related.html @@ -0,0 +1,11 @@ + diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html new file mode 100644 index 0000000..11a0e27 --- /dev/null +++ b/layouts/partials/scripts.html @@ -0,0 +1,45 @@ +{{ $early := resources.Get "js/script-early.js" | minify | fingerprint -}} + +{{ if $.Param "alpine" -}} +{{ $alpine := resources.Get "js/lib/alpine.min.js" | fingerprint -}} + +{{ end -}} +{{ if $.Param "jquery" -}} +{{ $jquery := resources.Get "js/lib/jquery.slim.min.js" | fingerprint -}} + +{{ end -}} +{{ $umbrella := resources.Get "js/lib/umbrella.min.js" | fingerprint -}} + +{{ if $.Param "mobilemenu" -}} +{{ $mobilemenu := resources.Get "js/mobile.js" | minify | fingerprint -}} + +{{ end -}} +{{ if $.Param "cookieconsent" -}} +{{ $cookieconsent := resources.Get "js/cookieconsent.js" | minify | fingerprint -}} + +{{ end -}} +{{ if $.Param "lazyload" -}} +{{ $lozadmin := resources.Get "js/lib/lozad.min.js" | fingerprint -}} + +{{ $lozad := resources.Get "js/lozadinit.js" | fingerprint -}} + +{{ end -}} +{{ if $.Param "listsort" -}} +{{ $listmin := resources.Get "js/lib/list.min.js" | fingerprint -}} + +{{ $listsort := resources.Get "js/listsort.js" | fingerprint -}} + +{{ end -}} +{{ if .HasShortcode "contact" -}} +{{ $contact := resources.Get "js/contact.js" | minify | fingerprint -}} + +{{ end -}} +{{ if .HasShortcode "search" -}} +{{ $flexsearch := resources.Get "js/lib/flexsearch.compact.js" | fingerprint -}} + +{{ $search_opts := dict "minify" true "params" (dict "searchLimit" (site.Params.searchLimit | default 20)) -}} +{{ $search := resources.Get "js/search.js" | js.Build $search_opts | fingerprint -}} + +{{ end -}} +{{ $script := resources.Get "js/script.js" | minify | fingerprint -}} + diff --git a/layouts/partials/sidebar.old.html b/layouts/partials/sidebar.old.html new file mode 100644 index 0000000..44bfb6c --- /dev/null +++ b/layouts/partials/sidebar.old.html @@ -0,0 +1,15 @@ +{{ $currentSection := .Section -}} +{{ $currentID := "" -}} +{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}} + diff --git a/layouts/partials/styles.html b/layouts/partials/styles.html new file mode 100644 index 0000000..287acd0 --- /dev/null +++ b/layouts/partials/styles.html @@ -0,0 +1,19 @@ +{{ $main_options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" false "includePaths" (slice "assets/sass/lib/typey/stylesheets")) -}} +{{ if eq hugo.Environment "development" -}} + {{ $main_options = merge $main_options (dict "outputStyle" "nested" "enableSourceMap" true) -}} +{{ end -}} +{{ $mobile_options := merge $main_options (dict "targetPath" "css/mobile.css") -}} +{{ $print_options := merge $main_options (dict "targetPath" "css/print.css") -}} +{{ $main_style := resources.Get "sass/styles.scss" | toCSS $main_options -}} +{{ $mobile_style := resources.Get "sass/mobile.scss" | toCSS $mobile_options -}} +{{ $print_style := resources.Get "sass/print.scss" | toCSS $print_options -}} +{{ if ne hugo.Environment "development" -}} + {{ $main_style = $main_style | fingerprint -}} + {{ $mobile_style = $mobile_style | fingerprint -}} + {{ $print_style = $print_style | fingerprint -}} +{{ end -}} +{{ if $.Param "mobilemenu" -}} + +{{ end -}} + + diff --git a/layouts/partials/submitted.html b/layouts/partials/submitted.html new file mode 100644 index 0000000..b41bf73 --- /dev/null +++ b/layouts/partials/submitted.html @@ -0,0 +1,3 @@ + diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html new file mode 100644 index 0000000..82c6d67 --- /dev/null +++ b/layouts/partials/tags.html @@ -0,0 +1,8 @@ +
+{{ i18n "taxo_tags" }}: + +
diff --git a/layouts/partials/tracking.html b/layouts/partials/tracking.html new file mode 100644 index 0000000..91c412f --- /dev/null +++ b/layouts/partials/tracking.html @@ -0,0 +1,23 @@ +{{ $opts := dict + "minify" true + "params" (dict + "cookieConsent" site.Params.cookieConsent + "piwikTrackerUrl" site.Params.piwikTrackerUrl + "piwikSiteID" site.Params.piwikSiteID + "plausibleSiteID" site.Params.plausibleSiteID + "GoogleAnalytics" site.GoogleAnalytics) -}} +{{ if and site.Params.piwikTrackerUrl site.Params.piwikSiteID -}} +{{ $script := resources.Get "js/tracking.js" | js.Build $opts | fingerprint -}} + + +{{ end -}} + +{{ if site.Params.plausibleSiteID -}} + +{{ end -}} + +{{ if site.GoogleAnalytics -}} +{{ $script := resources.Get "js/tracking.js" | js.Build $opts | fingerprint -}} + +{{ template "_internal/google_analytics.html" . }} +{{ end -}} diff --git a/layouts/podcast/full.html b/layouts/podcast/full.html new file mode 100644 index 0000000..c4cecd8 --- /dev/null +++ b/layouts/podcast/full.html @@ -0,0 +1,10 @@ +
+
+

{{ .Title }}

+{{ if $.Param "submitted" | default false }}{{ partial "submitted.html" . }}{{ end -}} +
+{{ partial "podcast.html" . -}} +
+{{ .Content }} +
+
diff --git a/layouts/podcast/rss.xml b/layouts/podcast/rss.xml new file mode 100644 index 0000000..29c79e0 --- /dev/null +++ b/layouts/podcast/rss.xml @@ -0,0 +1,66 @@ +{{- printf "" | safeHTML }} + + + {{ site.Params.Podcast.Title | default site.Title }} + {{ .Permalink }} + {{ site.Params.Podcast.Description | default site.Params.Description }} + Hugo -- gohugo.io + {{ site.Params.Podcast.Lang | default site.LanguageCode }} + {{ with site.Author.email -}} + {{ . }}{{ with site.Author.name }} ({{ . }}){{end}} + {{ end -}} + {{ with site.Author.email -}} + {{ . }}{{ with site.Author.name }} ({{ . }}){{end}} + {{ end -}} + {{ with site.Copyright -}} + {{ . }} + {{ end -}} + {{ if not .Date.IsZero -}} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ end -}} + {{ with site.Params.Podcast.Image }}{{ $image := resources.Get . }}{{ end }} + {{ with site.Params.Podcast.Category -}} + + {{ range .subcategories }}{{ end }} + + {{ end -}} + {{ with site.Params.Podcast.Owner -}} + + {{ with .name }}{{ . }}{{ end }} + {{ with .email }}{{ . }}{{ end }} + + {{ end -}} + {{ with site.Params.Podcast.Description }}{{ . }}{{ end }} + {{ with site.Params.Podcast.Author }}{{ . }}{{ end }} + {{ with site.Params.Podcast.Type }}{{ . }}{{ end }} + {{ with site.Params.Podcast.Block }}{{ . }}{{ end }} + {{ with site.Params.Podcast.Complete }}{{ . }}{{ end }} + {{ with site.Params.Podcast.NewFeed }}{{ . }}{{ end }} + {{ if site.Params.Podcast.Explicit }}true{{ else }}false{{ end }} + {{ range .Pages }} + + {{ .Title }} + {{ .Title }} + {{ .Permalink }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with site.Author.email -}} + {{ . }}{{ with site.Author.name }} ({{ . }}){{ end }} + {{ end -}} + {{ .Content | html }} + {{ if site.Params.Podcast.local | default true -}} + {{ with .Params.podcast.mp3 }}{{ $file_stat := os.Stat (path.Join "/static" (. | relURL)) }}{{ end }} + {{ else -}} + {{ with .Params.podcast.mp3 }}{{ end }} + {{ end -}} + {{ with .Params.podcast.duration }}{{ . }}{{ end }} + {{ with .Params.podcast.image.src }}{{ $image := resources.Get . }}{{ end }} + {{ with .Params.podcast.episode }}{{ . }}{{ end }} + {{ with .Params.podcast.episodeType }}{{ . }}{{ end }} + {{ with .Params.podcast.season }}{{ . }}{{ end }} + {{ with .Params.podcast.block }}{{ . }}{{ end }} + {{ if .Params.podcast.explicit }}true{{ else }}false{{ end }} + + {{ end }} + + diff --git a/layouts/podcast/single.html b/layouts/podcast/single.html new file mode 100644 index 0000000..99e3920 --- /dev/null +++ b/layouts/podcast/single.html @@ -0,0 +1,15 @@ +{{ define "main" -}} +
+
+
+

{{ .Title }}

+{{ if $.Param "submitted" | default false }}{{ partial "submitted.html" . }}{{ end -}} +{{ if .Params.tags }}{{ partial "tags.html" . }}{{ end -}} +
+{{ partial "podcast.html" . -}} +
+{{ .Content }} +
+
+
+{{ end }} diff --git a/layouts/shortcodes/audio.html b/layouts/shortcodes/audio.html new file mode 100644 index 0000000..4f6f863 --- /dev/null +++ b/layouts/shortcodes/audio.html @@ -0,0 +1,6 @@ +
+ +{{ with .Get "caption" }}
{{ . }}
{{ end }} +
diff --git a/layouts/shortcodes/button.html b/layouts/shortcodes/button.html new file mode 100644 index 0000000..a733166 --- /dev/null +++ b/layouts/shortcodes/button.html @@ -0,0 +1,5 @@ +{{ $class := .Get "class" -}} +{{ $newtab := .Get "newtab" | default false -}} +{{ $src := .Get "src" -}} +{{ $text := .Get "text" -}} +{{ $text }} diff --git a/layouts/shortcodes/clear.html b/layouts/shortcodes/clear.html new file mode 100644 index 0000000..a9d2c1a --- /dev/null +++ b/layouts/shortcodes/clear.html @@ -0,0 +1 @@ +
diff --git a/layouts/shortcodes/contact.html b/layouts/shortcodes/contact.html new file mode 100644 index 0000000..545fbe7 --- /dev/null +++ b/layouts/shortcodes/contact.html @@ -0,0 +1,16 @@ +

{{ i18n "js_required" }}

+ + + + diff --git a/layouts/shortcodes/details.html b/layouts/shortcodes/details.html new file mode 100644 index 0000000..8aeb3c7 --- /dev/null +++ b/layouts/shortcodes/details.html @@ -0,0 +1,6 @@ +{{ $class := .Get "class" -}} +{{ $summary := .Get "summary" -}} + +{{ with $summary }}{{ . }}{{ end }} +{{ .Inner | $.Page.RenderString (dict "display" "block") }} + diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html new file mode 100644 index 0000000..372bd6c --- /dev/null +++ b/layouts/shortcodes/figure.html @@ -0,0 +1,76 @@ +{{ $alt := .Get "alt" -}} +{{ $attr := .Get "attr" -}} +{{ $attrlink := .Get "attrlink" -}} +{{ $caption := .Get "caption" -}} +{{ $class := .Get "class" -}} +{{ $height := .Get "height" -}} +{{ $link := .Get "link" -}} +{{ $size := .Get "size" -}} +{{ $src := .Get "src" -}} +{{ $srcset := .Get "srcset" -}} +{{ $srcsetw := (slice) }} +{{ $title := .Get "title" -}} +{{ $width := .Get "width" -}} +{{ $maxwidth := site.Params.imageMaxWidth -}} +{{ $realwidth := 0 -}} +{{ $realheight := 0 -}} +{{ if and $src (fileExists (path.Join "/assets" $src)) -}} + {{ $original := resources.Get $src -}} + {{ if $size -}} + {{ $image := $original.Resize $size -}} + {{ $src = $image.RelPermalink -}} + {{ $width = $image.Width -}} + {{ $height = $image.Height -}} + {{ else -}} + {{ $src = $original.RelPermalink -}} + {{ $realwidth = $original.Width -}} + {{ $realheight = $original.Height -}} + {{ end -}} + {{ if $srcset -}} + {{ range $set := split $srcset " " -}} + {{ $image := $original.Resize (printf "%sx" $set) -}} + {{ $srcsetw = $srcsetw | append (printf "%s %sw" $image.RelPermalink $set) }} + {{ end }} + {{ $width = "" -}} + {{ $height = "" -}} + {{ end -}} +{{ else if and $src (fileExists (path.Join "/static" $src)) -}} + {{ with (imageConfig (path.Join "/static" $src)) -}} + {{ $realwidth = .Width -}} + {{ $realheight = .Height -}} + {{ end -}} +{{ end -}} +{{ if and $width $height -}} + {{ $width = int $width -}} + {{ $height = int $height -}} +{{ else if $width -}} + {{ $width = int $width -}} + {{ $height = $realheight -}} + {{ if and ($realwidth) (lt ($width) ($realwidth)) -}} + {{ $height = (mul ($realheight) (div (add ($width) 0.0) ($realwidth))) -}} + {{ $height = (math.Round $height) -}} + {{ end -}} +{{ else if $height -}} + {{ $width = $realwidth -}} + {{ $height = int $height -}} + {{ if and ($realheight) (lt ($height) ($realheight)) -}} + {{ $width = (mul ($realwidth) (div (add ($height) 0.0) ($realheight))) -}} + {{ $width = (math.Round $width) -}} + {{ end -}} +{{ else if and ($maxwidth) (lt ($maxwidth) ($realwidth)) -}} + {{ $width = ($maxwidth) -}} + {{ $height = (mul ($realheight) (div (add ($width) 0.0) ($realwidth))) -}} + {{ $height = (math.Round $height) -}} +{{ end -}} +
+{{ with $link }}{{ end -}} +{{ . }} +{{- if $link }}{{ end }} +{{ if or $title $caption $attr -}} +
+{{ with $title }}

{{ . }}

{{ end -}} +{{- $caption | markdownify }}{{ if and $caption $attr }} {{ end -}} +{{ with $attrlink }}{{ end }}{{ $attr | markdownify }}{{ if $attrlink }}{{ end -}} +
+{{ end -}} +
diff --git a/layouts/shortcodes/file.html b/layouts/shortcodes/file.html new file mode 100644 index 0000000..44402fa --- /dev/null +++ b/layouts/shortcodes/file.html @@ -0,0 +1,12 @@ +{{ $class := .Get "class" -}} +{{ $newtab := .Get "newtab" | default false -}} +{{ $src := .Get "src" -}} +{{ $text := .Get "text" -}} +{{ if and $src (fileExists (path.Join "/assets" $src)) -}} + {{ $original := resources.Get $src -}} + {{ $src = $original.RelPermalink -}} +{{ end -}} +{{ if not $text -}} + {{ $text = path.Base $src -}} +{{ end -}} +{{ $text }} diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html new file mode 100644 index 0000000..546d6f8 --- /dev/null +++ b/layouts/shortcodes/img.html @@ -0,0 +1,63 @@ +{{ $alt := .Get "alt" -}} +{{ $class := .Get "class" -}} +{{ $height := .Get "height" -}} +{{ $link := .Get "link" -}} +{{ $size := .Get "size" -}} +{{ $src := .Get "src" -}} +{{ $srcset := .Get "srcset" -}} +{{ $srcsetw := (slice) }} +{{ $width := .Get "width" -}} +{{ $maxwidth := site.Params.imageMaxWidth -}} +{{ $realwidth := 0 -}} +{{ $realheight := 0 -}} +{{ if and $src (fileExists (path.Join "/assets" $src)) -}} + {{ $original := resources.Get $src -}} + {{ if $size -}} + {{ $image := $original.Resize $size -}} + {{ $src = $image.RelPermalink -}} + {{ $width = $image.Width -}} + {{ $height = $image.Height -}} + {{ else -}} + {{ $src = $original.RelPermalink -}} + {{ $realwidth = $original.Width -}} + {{ $realheight = $original.Height -}} + {{ end -}} + {{ if $srcset -}} + {{ range $set := split $srcset " " -}} + {{ $image := $original.Resize (printf "%sx" $set) -}} + {{ $srcsetw = $srcsetw | append (printf "%s %sw" $image.RelPermalink $set) }} + {{ end }} + {{ $width = "" -}} + {{ $height = "" -}} + {{ end -}} +{{ else if and $src (fileExists (path.Join "/static" $src)) -}} + {{ with (imageConfig (path.Join "/static" $src)) -}} + {{ $realwidth = .Width -}} + {{ $realheight = .Height -}} + {{ end -}} +{{ end -}} +{{ if and $width $height -}} + {{ $width = int $width -}} + {{ $height = int $height -}} +{{ else if $width -}} + {{ $width = int $width -}} + {{ $height = $realheight -}} + {{ if and ($realwidth) (lt ($width) ($realwidth)) -}} + {{ $height = (mul ($realheight) (div (add ($width) 0.0) ($realwidth))) -}} + {{ $height = (math.Round $height) -}} + {{ end -}} +{{ else if $height -}} + {{ $width = $realwidth -}} + {{ $height = int $height -}} + {{ if and ($realheight) (lt ($height) ($realheight)) -}} + {{ $width = (mul ($realwidth) (div (add ($height) 0.0) ($realheight))) -}} + {{ $width = (math.Round $width) -}} + {{ end -}} +{{ else if and ($maxwidth) (lt ($maxwidth) ($realwidth)) -}} + {{ $width = ($maxwidth) -}} + {{ $height = (mul ($realheight) (div (add ($width) 0.0) ($realwidth))) -}} + {{ $height = (math.Round $height) -}} +{{ end -}} +{{ with $link }}{{ end -}} +{{ . }} +{{- if $link }}{{ end }} diff --git a/layouts/shortcodes/reflink.html b/layouts/shortcodes/reflink.html new file mode 100644 index 0000000..f2bf2b3 --- /dev/null +++ b/layouts/shortcodes/reflink.html @@ -0,0 +1 @@ +{{ with site.GetPage (.Get 0) }}{{ .Title }}{{ end }} diff --git a/layouts/shortcodes/search.html b/layouts/shortcodes/search.html new file mode 100644 index 0000000..784c598 --- /dev/null +++ b/layouts/shortcodes/search.html @@ -0,0 +1,22 @@ +

{{ i18n "js_required" }}

+ + + + +
+ + diff --git a/layouts/shortcodes/services.html b/layouts/shortcodes/services.html index e3fee8f..64fe11b 100644 --- a/layouts/shortcodes/services.html +++ b/layouts/shortcodes/services.html @@ -1,32 +1,16 @@ - - - - -
-
-
    -
  • -
    -
    -

    nitter.cz

    -

    Alternativní rozhraní pro Twitter, které nesbírá osobní údaje a nevyžaduje přihlášení.

    - - - -
    -
  • -
  • -
    -
    -

    cryptpad.cz

    -

    End-to-end šifrovaná sada nástrojů pro spolupráci a sdílení souborů. Tabulky, dokumenty, formuláře a další.

    - -
    -
  • -
  • -
    -
    -

    upload.nolog.cz

    -

    End-to-end šifrované nahrávání a sdílení souborů do velikosti 2GB.

    - -
    -
  • -
  • -
    -
    -

    nolog.link

    -

    Zkracovač odkazů bez sledování uživatelů.

    - -
    -
  • -
  • -
    -
    -

    decide.nolog.cz

    -

    Alternativa k Doodle pro vytváření anket a hledání termínů.

    - -
    -
  • -
  • -
    -
    -

    paste.nolog.cz

    -

    Rychlé šifrované sdílení textu s možností "autodestrukce" po přečtení.

    - -
    -
  • -
  • -
    -
    -

    call.nolog.cz

    -

    Videokonferenční a vzdělávací systém bez sledování uživatelů.

    - -
    -
  • -
  • -
    -
    -

    bridge.nolog.cz

    -

    Přeposílání příspěvků mezi decentralizovanou sociální sítí Mastodon a Twitterem.

    - -
    -
  • - -
  • -
    -
    -

    nolog.media

    -

    Sdílení a přehrávání videí, alternativa k YouTube apod. Prozatím ve fázi testování.

    - -
    -
  • -
  • -
    -
    -

    pad.nolog.cz

    -

    Vytváření a úpravy textových souborů ve skupině. Pro citlivý obsah doporučujeme přechod na CryptPad.

    - -
    -
  • -
  • -
    -
    -

    Něco dalšího?

    -

    Potřebujete fórum, e-maily, úložiště nebo webhosting pro vaší organizaci, skupinu či třeba kolektiv?

    - Čtěte dál... -
    -
  • - -
-
- -
\ No newline at end of file + + + diff --git a/layouts/shortcodes/svg.html b/layouts/shortcodes/svg.html new file mode 100644 index 0000000..a32c21d --- /dev/null +++ b/layouts/shortcodes/svg.html @@ -0,0 +1,40 @@ +{{ $alt := .Get "alt" -}} +{{ $caption := .Get "caption" -}} +{{ $class := .Get "class" -}} +{{ $height := .Get "height" -}} +{{ $inline := .Get "inline" | default false -}} +{{ $link := .Get "link" -}} +{{ $src := .Get "src" -}} +{{ $width := .Get "width" -}} +{{ if and $src (fileExists (path.Join "/assets" $src)) -}} + {{ $original := resources.Get $src -}} + {{ if $inline -}} + {{ $src = $original.Content -}} + {{ else -}} + {{ $src = $original.RelPermalink -}} + {{ end -}} +{{ else if and $src $inline (fileExists (path.Join "/static" $src)) -}} + {{ $src = readFile (path.Join "/static" $src) -}} +{{ end -}} +{{ if and $width $height -}} + {{ $width = int $width -}} + {{ $height = int $height -}} +{{ else if $width -}} + {{ $width = int $width -}} +{{ else if $height -}} + {{ $height = int $height -}} +{{ end -}} +{{ if $caption }}
{{ end -}} +{{ with $link }}{{ end -}} +{{ if $inline -}} +
{{ $src | safeHTML }}
+{{ else -}} +{{ . }} +{{ end -}} +{{- if $link }}
{{ end }} +{{ if $caption -}} +
+{{ $caption | markdownify -}} +
+
+{{ end -}} diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html new file mode 100644 index 0000000..9ae5982 --- /dev/null +++ b/layouts/shortcodes/video.html @@ -0,0 +1,6 @@ +
+ +{{ with .Get "caption" }}
{{ . }}
{{ end }} +
diff --git a/layouts/shortcodes/wrapper.html b/layouts/shortcodes/wrapper.html new file mode 100644 index 0000000..7c5965b --- /dev/null +++ b/layouts/shortcodes/wrapper.html @@ -0,0 +1,3 @@ +{{ $display := "inline" -}} +{{ if eq (.Get 1) "block" }}{{ $display = "block" }}{{ end -}} +
{{ if eq (.Get 1) "nomarkdown" }}{{ .Inner }}{{ else }}{{ .Inner | $.Page.RenderString (dict "display" $display) }}{{ end }}
diff --git a/podcast.md b/podcast.md new file mode 100644 index 0000000..7a7b85c --- /dev/null +++ b/podcast.md @@ -0,0 +1,8 @@ +--- +title: "{{ replace .TranslationBaseName "-" " " | humanize }}" +date: {{ .Date }} +podcast: + mp3: + duration: + +--- \ No newline at end of file diff --git a/scripts/set_up_new_site.sh b/scripts/set_up_new_site.sh new file mode 100755 index 0000000..a9794d2 --- /dev/null +++ b/scripts/set_up_new_site.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# shell script hardening +set -euo pipefail + +# This script copies the scss and layout files I think most people +# would like to override. It also copies the example config file. +# (Run chmod 700 on this file to make it executable) + +if [[ ! "$0" =~ "themes/zen/scripts/set_up_new_site.sh" ]]; then + echo "Error: This script must be run from the project root directory." + echo "Usage: ./theme/zen/set_up_new_site.sh" + exit 1 +fi + +mkdir -p "assets/sass" +mkdir -p "layouts" + +copy_files=("themes/zen/assets/sass/_colors.scss:assets/sass/_colors.scss" + "themes/zen/assets/sass/_extra.scss:assets/sass/_extra.scss" + "themes/zen/assets/sass/_fonts.scss:assets/sass/_fonts.scss" + "themes/zen/assets/sass/_custom.scss:assets/sass/_custom.scss" + "themes/zen/assets/sass/_zen.scss:assets/sass/_zen.scss" + "themes/zen/layouts/index.html:layouts/index.html" + "themes/zen/exampleSite/config.yaml:config.yaml") + +for files in "${copy_files[@]}" ; do + if [[ ! -f "${files##*:}" ]]; then + cp "${files%%:*}" "${files##*:}" + echo "Copied: ${files##*:}" + else + echo "Already exist so not overwritten: ${files##*:}" + fi +done + +if [[ -f "config.toml" && -f "config.yaml" ]]; then + mv config.toml config.toml.old +fi diff --git a/static/css/services.css b/static/css/services.css deleted file mode 100644 index 111a5d8..0000000 --- a/static/css/services.css +++ /dev/null @@ -1,143 +0,0 @@ -article > .content ul > li::before, aside ul > li::before { - font-size: 0.88888889rem; - padding-right: 0.75rem; - display: table-cell; - content: unset; -} - -.main h2, .main h3, .main h4, .main h5, .main h6, .main ul, .main ol, .main dl, .main p { - max-width: 90ch; -} - - -article > .content ul > li, aside ul > li { - display: flex; -} - -.mainer { - max-width: 60rem; - margin: 0 auto; - padding: 1rem; - display: flex; -} - -.mainer * { - margin: 0; - padding: 0; - box-sizing: border-box; - color: inherit; - max-width: -moz-available; /* WebKit-based browsers will ignore this. */ - max-width: -webkit-fill-available; /* Mozilla-based browsers will ignore this. */ - max-width: fill-available; -} - - -h1 { - margin-bottom: 1rem; -} - -.card h2 a { -text-decoration: none; -} - -.cards > ul { - list-style: none; - display: grid !important; - -} - -.card + .card { - margin-top: 1.5rem; -} - -@supports (display: grid) { - .cards > ul { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); - grid-column-gap: 1.5rem; - grid-row-gap:1.5rem; - } - - .card + .card { - margin-top: 0; - } -} - -.card { - border: 1px solid; - border-radius: 0.25rem; - display: flex; - flex-direction: column; - position: relative; -} - -.card .text { - padding: 1rem; - flex: 1 0 auto; - display: flex; - flex-direction: column; -} - -.card p { - max-width: 60ch; -} - -.card .img { - height: 6.5rem; - clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 1rem)); -} - -.card .img img { - width: 100%; - height: 100%; - object-fit: cover; - object-position: top; - /* filter: grayscale(100%); */ -} - -.card a { - text-decoration: none; - outline: none; -} - -.h2 a::after { - content: ''; - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; -} - - -.card a:focus { - outline: none; - text-decoration: underline; -} - -/* .card:focus-within, .card:hover { - box-shadow: 0 0 0 0.05rem; -} */ - -.card:focus-within a:focus { - text-decoration: none; -} - -.card small { - display: block; - text-decoration: underline; -} - -.card .text > * + * { - margin-top: 0.75rem; -} - -.card .text > :last-child { - margin-top: auto; - padding-top: 0.75rem; -} - -.card a { - outline: none; - text-decoration: none; -} diff --git a/themes/zen b/themes/zen deleted file mode 160000 index 73635d8..0000000 --- a/themes/zen +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 73635d834b47ffc25d8ed9ecef6641adb8c34f8e