diff --git a/.gitignore b/.gitignore index df2e8ca..44aab12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules build *.js -!static/*.js \ No newline at end of file +!static/*.js +/posts/_draft_*.md \ No newline at end of file diff --git a/ryuji.ts b/ryuji.ts index ccfbce1..defd8ea 100644 --- a/ryuji.ts +++ b/ryuji.ts @@ -1,6 +1,6 @@ import { readFileSync } from 'fs'; -export const SYNTAX_REGEX = /\[\[ [a-zA-Z0-9.:\-_!]+ \]\]/g; +export const SYNTAX_REGEX = /\[\[ [a-zA-Z0-9.:/\-_!]+ \]\]/g; export type file_extension = `.${string}`; @@ -129,11 +129,6 @@ export class Renderer { //make sure thing we are iterating over isn't empty if (var_value.length === 0) { //skip straight to the endfor - //todo: remove - /*let new_index: number = matches.slice(index, matches.length).findIndex((match) => match[0] === "[[ endfor ]]"); - if (new_index === -1) throw Error("for statement missing an `[[ endfor ]]`"); - index += new_index; - continue;*/ let sliced = matches.slice(index+1, matches.length); let new_index: number; let extra_fors: number = 0; @@ -148,7 +143,7 @@ export class Renderer { extra_fors--; } } - if (typeof new_index === "undefined") throw Error("if statement missing an `[[ endif ]]`"); + if (typeof new_index === "undefined") throw Error("`for:` statement missing an `[[ endfor ]]`"); index += new_index+1; continue; } @@ -225,7 +220,7 @@ export class Renderer { extra_ifs--; } } - if (typeof new_index === "undefined") throw Error("if statement missing an `[[ endif ]]`"); + if (typeof new_index === "undefined") throw Error("`if:` statement missing an `[[ endif ]]`"); index += new_index+1; continue; } @@ -243,7 +238,7 @@ export class Renderer { //convert to string let var_value: string = String(Renderer.get_var(var_name, vars)); //add indentation - let current_lines: string[] = rendered.split("\n") + let current_lines: string[] = rendered.split("\n"); let current_last: string = current_lines[current_lines.length-1]; let indentation: number = 0; for (let i=0; i < current_last.length; i++) { @@ -260,7 +255,6 @@ export class Renderer { } else { rendered += Renderer.sanitize(var_value); } - //offset += var_value.length-match[0].length; } //add the html that comes after this, up until the next template syntax match thing rendered += template_contents.slice(match.index+match[0].length, matches[index+1]?.index ? matches[index+1].index : template_contents.length); diff --git a/static/88x31/247.gif b/static/88x31/247.gif new file mode 100644 index 0000000..9b4782f Binary files /dev/null and b/static/88x31/247.gif differ diff --git a/static/88x31/btw.png b/static/88x31/btw.png new file mode 100644 index 0000000..1599223 Binary files /dev/null and b/static/88x31/btw.png differ diff --git a/static/88x31/fe.gif b/static/88x31/fe.gif new file mode 100644 index 0000000..3e8af29 Binary files /dev/null and b/static/88x31/fe.gif differ diff --git a/static/88x31/ie11.png b/static/88x31/ie11.png new file mode 100644 index 0000000..8fba1a7 Binary files /dev/null and b/static/88x31/ie11.png differ diff --git a/static/88x31/jsn.gif b/static/88x31/jsn.gif new file mode 100644 index 0000000..31d8eae Binary files /dev/null and b/static/88x31/jsn.gif differ diff --git a/static/88x31/mh.gif b/static/88x31/mh.gif new file mode 100644 index 0000000..90a321b Binary files /dev/null and b/static/88x31/mh.gif differ diff --git a/static/88x31/salt.gif b/static/88x31/salt.gif new file mode 100644 index 0000000..662f039 Binary files /dev/null and b/static/88x31/salt.gif differ diff --git a/static/styles/global.css b/static/styles/global.css index 2f5dae4..999acb1 100644 --- a/static/styles/global.css +++ b/static/styles/global.css @@ -22,6 +22,30 @@ body { font-size: 1.02rem; } +h1 { + font-size: 2rem !important; +} + +h1 code { + font-size: 1.9rem !important; +} + +h2 { + font-size: 1.5em !important; +} + +h2 code { + font-size: 1.4em !important; +} + +h3, h3 code { + font-size: 1.3em !important; +} + +h3 code { + font-size: 1.2em !important; +} + #return { position: absolute; top: 5px; @@ -79,9 +103,11 @@ label[for="dark-mode"] { } #dark-mode + label[for="dark-mode"]::after { + color: black; content: "🌙"; } #dark-mode:checked + label[for="dark-mode"]::after { + color: white; content: "☀️"; } diff --git a/static/styles/index.css b/static/styles/index.css index e723212..be410e6 100644 --- a/static/styles/index.css +++ b/static/styles/index.css @@ -14,3 +14,20 @@ h2 { top: 0; left: 0; } + +.random { + margin-top: 10px; + display: none; +} + +.random:target { + display: block; +} + +.random:target ~ #ciran { + display: none; +} + +.random-content { + min-height: 40px; +} diff --git a/templates/components/random/badges.html b/templates/components/random/badges.html new file mode 100644 index 0000000..8346056 --- /dev/null +++ b/templates/components/random/badges.html @@ -0,0 +1,12 @@ +
+
+
+
+
+
+
+