Fixes #12
This commit is contained in:
parent
c201ff8f63
commit
5fa631a903
@ -1,82 +1,86 @@
|
|||||||
//-
|
//-
|
||||||
DS2 core (c) 2024 Alexander McIlwraith
|
DS2 core (c) 2024 Alexander McIlwraith
|
||||||
Core licensed under CC BY-SA 4.0
|
Core licensed under CC BY-SA 4.0
|
||||||
|
|
||||||
- const getDate = function(){
|
- const getDate = function(){
|
||||||
- var d = new Date();
|
- var d = new Date();
|
||||||
- return d.toLocaleDateString(lang, {day: "numeric", month: "long", year: "numeric"});
|
- return d.toLocaleDateString(lang, {day: "numeric", month: "long", year: "numeric"});
|
||||||
- }
|
- }
|
||||||
- String.prototype.toTitleCase = function() {
|
- String.prototype.toTitleCase = function() {
|
||||||
- return this.replace(/\w\S*/g, function(txt) {
|
- return this.replace(/\w\S*/g, function(txt) {
|
||||||
- return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
- return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
||||||
- });
|
- });
|
||||||
- }
|
- }
|
||||||
- String.prototype.toSentenceCase = function() {
|
- String.prototype.toSentenceCase = function() {
|
||||||
- return this.charAt(0).toUpperCase() + this.substr(1).toLowerCase();
|
- return this.charAt(0).toUpperCase() + this.substr(1).toLowerCase();
|
||||||
- }
|
- }
|
||||||
- String.prototype.toContent = function() {
|
- String.prototype.toContent = function() {
|
||||||
- return this.replace(/-/g, " ");
|
- return this.replace(/-/g, " ");
|
||||||
- }
|
- }
|
||||||
- String.prototype.toPath = function() {
|
- String.prototype.toPath = function() {
|
||||||
- return this.trim().replace(/ /g, "_").replace(/-/g, "_").replace(/[\/\W]/g, "").replace(/_/g, "-");
|
- return this.trim().replace(/ /g, "_").replace(/-/g, "_").replace(/[\/\W]/g, "").replace(/_/g, "-");
|
||||||
- }
|
- }
|
||||||
|
|
||||||
include ../_config
|
include ../_config
|
||||||
block config
|
block config
|
||||||
|
|
||||||
|
|
||||||
mixin show-content(items, path)
|
mixin show-content(items, path)
|
||||||
|
|
||||||
- path = (path == "" ? "" : path + "/") + items.name.toPath()
|
- path = (path == "" ? "" : path + "/") + items.name.toPath()
|
||||||
|
|
||||||
if items.core == true
|
if items.core == true
|
||||||
- items.status = "complete"
|
- items.status = "complete"
|
||||||
|
|
||||||
article(id=path.replace(/\//g, "-").toPath()
|
article(id=path.replace(/\//g, "-").toPath()
|
||||||
data-name=items.name
|
data-name=items.name
|
||||||
data-status=items.status
|
data-status=items.status
|
||||||
data-display=items.display
|
data-display=items.display
|
||||||
data-template=(items.template == undefined ? "pug" : items.template)
|
data-template=(items.template == undefined ? "pug" : items.template)
|
||||||
data-core= (items.core ? "true" : "false")
|
data-core= (items.core ? "true" : "false")
|
||||||
data-path=path
|
data-path=path
|
||||||
style="height: 100vh"
|
style="height: 100vh"
|
||||||
)
|
)
|
||||||
|
if items.display
|
||||||
h1(class="status-" + items.status )
|
h1(class="status-" + items.status )
|
||||||
span= items.name.toSentenceCase().toContent()
|
span= items.display
|
||||||
tool-tip(role="tooltip" inert tip-position="right")= items.status.toSentenceCase().toContent()
|
tool-tip(role="tooltip" inert tip-position="right")= items.status.toSentenceCase().toContent()
|
||||||
if items.files
|
else
|
||||||
each item in items.files
|
h1(class="status-" + items.status )
|
||||||
+show-content(item, path)
|
span= items.name.toSentenceCase().toContent()
|
||||||
|
tool-tip(role="tooltip" inert tip-position="right")= items.status.toSentenceCase().toContent()
|
||||||
|
if items.files
|
||||||
doctype html
|
each item in items.files
|
||||||
html(lang= lang )
|
+show-content(item, path)
|
||||||
head
|
|
||||||
meta(charset="utf-8")
|
|
||||||
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
doctype html
|
||||||
meta(name="viewport" content="width=device-width, initial-scale=1")
|
html(lang= lang )
|
||||||
|
head
|
||||||
title(data-site= site )= site
|
meta(charset="utf-8")
|
||||||
|
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
||||||
block head
|
meta(name="viewport" content="width=device-width, initial-scale=1")
|
||||||
link( href="assets/scaffolding.css" rel="stylesheet" )
|
|
||||||
|
title(data-site= site )= site
|
||||||
body
|
|
||||||
//
|
block head
|
||||||
DS2 core (c) 2024 Alexander McIlwraith
|
link( href="assets/scaffolding.css" rel="stylesheet" )
|
||||||
Core licensed under CC BY-SA 4.0
|
|
||||||
|
body
|
||||||
|
//
|
||||||
a.skip(href="#main") Skip to main content
|
DS2 core (c) 2024 Alexander McIlwraith
|
||||||
div.container
|
Core licensed under CC BY-SA 4.0
|
||||||
|
|
||||||
block header
|
|
||||||
|
a.skip(href="#main") Skip to main content
|
||||||
main#main
|
div.container
|
||||||
|
|
||||||
h1= site
|
block header
|
||||||
each category in content
|
|
||||||
+show-content(category, "")
|
main#main
|
||||||
|
|
||||||
script(src="assets/scaffolding-min.js")
|
h1= site
|
||||||
|
each category in content
|
||||||
|
+show-content(category, "")
|
||||||
|
|
||||||
|
script(src="assets/scaffolding-min.js")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user