From 55b59bfd2c61a8058adc0a7c463b13018fe8b892 Mon Sep 17 00:00:00 2001 From: Xananax Date: Sat, 13 May 2023 17:58:34 +0200 Subject: [PATCH] minor refactoring --- .../400016300497_6129063567043520548-1.jpg | Bin ...nian-at-a-french-school-in-saudi-arabia.md | 0 .../anastase-maragos-kqkzdnujczq-unsplash.jpg | Bin .../annie-spratt-fcwmnaarumk-unsplash.jpg | Bin .../musings}/armenian-french-school.png | Bin .../musings}/artisanmarmikhael.jpg | Bin sally-files.txt => examples/musings/files.txt | 0 .../gregory-morit-gm0a9bae6gu-unsplash.jpg | Bin examples/musings/index.html | 20 ++++++++++++++++++ .../julia-joppien-w-7h8oxrawc-unsplash.jpg | Bin .../musings}/marmikhael-newproject.jpg | Bin .../musings}/marmikhael-village-copy.jpg | Bin .../musings}/marmikhael-village.jpg | Bin {sally => examples/musings}/piano.jpg | Bin {sally => examples/musings}/portrait.jpg | Bin .../musings}/shitadvertising.jpg | Bin .../musings}/thanks-for-the-piano-lessons.md | 0 .../to-the-cannibals-of-mar-mikhail.md | 0 .../une-histoire-de-portes-et-de-fenetres.jpg | Bin .../une-histoire-de-portes-et-de-fenetres.md | 0 modules/templates/blog.mjs | 2 +- modules/utils/fetchMarkdown.mjs | 8 ++++++- sally.html | 9 -------- 23 files changed, 28 insertions(+), 11 deletions(-) rename {sally => examples/musings}/400016300497_6129063567043520548-1.jpg (100%) rename {sally => examples/musings}/an-armenian-at-a-french-school-in-saudi-arabia.md (100%) rename {sally => examples/musings}/anastase-maragos-kqkzdnujczq-unsplash.jpg (100%) rename {sally => examples/musings}/annie-spratt-fcwmnaarumk-unsplash.jpg (100%) rename {sally => examples/musings}/armenian-french-school.png (100%) rename {sally => examples/musings}/artisanmarmikhael.jpg (100%) rename sally-files.txt => examples/musings/files.txt (100%) rename {sally => examples/musings}/gregory-morit-gm0a9bae6gu-unsplash.jpg (100%) create mode 100644 examples/musings/index.html rename {sally => examples/musings}/julia-joppien-w-7h8oxrawc-unsplash.jpg (100%) rename {sally => examples/musings}/marmikhael-newproject.jpg (100%) rename {sally => examples/musings}/marmikhael-village-copy.jpg (100%) rename {sally => examples/musings}/marmikhael-village.jpg (100%) rename {sally => examples/musings}/piano.jpg (100%) rename {sally => examples/musings}/portrait.jpg (100%) rename {sally => examples/musings}/shitadvertising.jpg (100%) rename {sally => examples/musings}/thanks-for-the-piano-lessons.md (100%) rename {sally => examples/musings}/to-the-cannibals-of-mar-mikhail.md (100%) rename {sally => examples/musings}/une-histoire-de-portes-et-de-fenetres.jpg (100%) rename {sally => examples/musings}/une-histoire-de-portes-et-de-fenetres.md (100%) delete mode 100644 sally.html diff --git a/sally/400016300497_6129063567043520548-1.jpg b/examples/musings/400016300497_6129063567043520548-1.jpg similarity index 100% rename from sally/400016300497_6129063567043520548-1.jpg rename to examples/musings/400016300497_6129063567043520548-1.jpg diff --git a/sally/an-armenian-at-a-french-school-in-saudi-arabia.md b/examples/musings/an-armenian-at-a-french-school-in-saudi-arabia.md similarity index 100% rename from sally/an-armenian-at-a-french-school-in-saudi-arabia.md rename to examples/musings/an-armenian-at-a-french-school-in-saudi-arabia.md diff --git a/sally/anastase-maragos-kqkzdnujczq-unsplash.jpg b/examples/musings/anastase-maragos-kqkzdnujczq-unsplash.jpg similarity index 100% rename from sally/anastase-maragos-kqkzdnujczq-unsplash.jpg rename to examples/musings/anastase-maragos-kqkzdnujczq-unsplash.jpg diff --git a/sally/annie-spratt-fcwmnaarumk-unsplash.jpg b/examples/musings/annie-spratt-fcwmnaarumk-unsplash.jpg similarity index 100% rename from sally/annie-spratt-fcwmnaarumk-unsplash.jpg rename to examples/musings/annie-spratt-fcwmnaarumk-unsplash.jpg diff --git a/sally/armenian-french-school.png b/examples/musings/armenian-french-school.png similarity index 100% rename from sally/armenian-french-school.png rename to examples/musings/armenian-french-school.png diff --git a/sally/artisanmarmikhael.jpg b/examples/musings/artisanmarmikhael.jpg similarity index 100% rename from sally/artisanmarmikhael.jpg rename to examples/musings/artisanmarmikhael.jpg diff --git a/sally-files.txt b/examples/musings/files.txt similarity index 100% rename from sally-files.txt rename to examples/musings/files.txt diff --git a/sally/gregory-morit-gm0a9bae6gu-unsplash.jpg b/examples/musings/gregory-morit-gm0a9bae6gu-unsplash.jpg similarity index 100% rename from sally/gregory-morit-gm0a9bae6gu-unsplash.jpg rename to examples/musings/gregory-morit-gm0a9bae6gu-unsplash.jpg diff --git a/examples/musings/index.html b/examples/musings/index.html new file mode 100644 index 0000000..d93719e --- /dev/null +++ b/examples/musings/index.html @@ -0,0 +1,20 @@ + + + + Tickle + + + + +
+ + +
+
+

+    
+

+
+ + + diff --git a/sally/julia-joppien-w-7h8oxrawc-unsplash.jpg b/examples/musings/julia-joppien-w-7h8oxrawc-unsplash.jpg similarity index 100% rename from sally/julia-joppien-w-7h8oxrawc-unsplash.jpg rename to examples/musings/julia-joppien-w-7h8oxrawc-unsplash.jpg diff --git a/sally/marmikhael-newproject.jpg b/examples/musings/marmikhael-newproject.jpg similarity index 100% rename from sally/marmikhael-newproject.jpg rename to examples/musings/marmikhael-newproject.jpg diff --git a/sally/marmikhael-village-copy.jpg b/examples/musings/marmikhael-village-copy.jpg similarity index 100% rename from sally/marmikhael-village-copy.jpg rename to examples/musings/marmikhael-village-copy.jpg diff --git a/sally/marmikhael-village.jpg b/examples/musings/marmikhael-village.jpg similarity index 100% rename from sally/marmikhael-village.jpg rename to examples/musings/marmikhael-village.jpg diff --git a/sally/piano.jpg b/examples/musings/piano.jpg similarity index 100% rename from sally/piano.jpg rename to examples/musings/piano.jpg diff --git a/sally/portrait.jpg b/examples/musings/portrait.jpg similarity index 100% rename from sally/portrait.jpg rename to examples/musings/portrait.jpg diff --git a/sally/shitadvertising.jpg b/examples/musings/shitadvertising.jpg similarity index 100% rename from sally/shitadvertising.jpg rename to examples/musings/shitadvertising.jpg diff --git a/sally/thanks-for-the-piano-lessons.md b/examples/musings/thanks-for-the-piano-lessons.md similarity index 100% rename from sally/thanks-for-the-piano-lessons.md rename to examples/musings/thanks-for-the-piano-lessons.md diff --git a/sally/to-the-cannibals-of-mar-mikhail.md b/examples/musings/to-the-cannibals-of-mar-mikhail.md similarity index 100% rename from sally/to-the-cannibals-of-mar-mikhail.md rename to examples/musings/to-the-cannibals-of-mar-mikhail.md diff --git a/sally/une-histoire-de-portes-et-de-fenetres.jpg b/examples/musings/une-histoire-de-portes-et-de-fenetres.jpg similarity index 100% rename from sally/une-histoire-de-portes-et-de-fenetres.jpg rename to examples/musings/une-histoire-de-portes-et-de-fenetres.jpg diff --git a/sally/une-histoire-de-portes-et-de-fenetres.md b/examples/musings/une-histoire-de-portes-et-de-fenetres.md similarity index 100% rename from sally/une-histoire-de-portes-et-de-fenetres.md rename to examples/musings/une-histoire-de-portes-et-de-fenetres.md diff --git a/modules/templates/blog.mjs b/modules/templates/blog.mjs index d0fff25..75c5b87 100644 --- a/modules/templates/blog.mjs +++ b/modules/templates/blog.mjs @@ -19,7 +19,7 @@ export const bootstrap = async () => { Burger.addEventListener("click", mode.menuOpen.toggle); mode.loading.on(); - const lines = await fetchText("../files.txt"); + const lines = await fetchText("files.txt"); const links = parseFileList(lines); const firstHref = links[0].href; sortFileListLines(links); diff --git a/modules/utils/fetchMarkdown.mjs b/modules/utils/fetchMarkdown.mjs index c39ffc1..0405aac 100644 --- a/modules/utils/fetchMarkdown.mjs +++ b/modules/utils/fetchMarkdown.mjs @@ -6,6 +6,8 @@ import { generateDomFromString } from "./generateDomFromString.mjs"; import {getFirstTitleContent} from "./getFirstTitleContent.mjs"; // @ts-ignore import { micromark } from "https://esm.sh/micromark@3?bundle"; +// @ts-ignore +import {frontmatter, frontmatterHtml} from 'https://esm.sh/micromark-extension-frontmatter@1?bundle' /** * Loads and parses a markdown document. Makes use of micromark. @@ -15,7 +17,11 @@ export const fetchMarkdown = (path) => fetchText(path) .then(waitIfLocalHost()) .then((raw) => { - const content = generateDomFromString(micromark(raw)); + const output = micromark(raw, { + extensions: [frontmatter()], + htmlExtensions: [frontmatterHtml()] + }) + const content = generateDomFromString(output); const title = getFirstTitleContent(content) || path.replace(/\.\w{2, 4}$/, ""); return { title, raw, content }; }); diff --git a/sally.html b/sally.html deleted file mode 100644 index b29eed5..0000000 --- a/sally.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - Sally Emerzian - - - - - \ No newline at end of file