Skip to content

Commit

Permalink
hopefully fix data importing in deployed bundle, lean into frontmatter
Browse files Browse the repository at this point in the history
  • Loading branch information
colevandersWands committed May 3, 2024
1 parent ba24c0e commit df355c9
Show file tree
Hide file tree
Showing 12 changed files with 3,191 additions and 174 deletions.
8 changes: 0 additions & 8 deletions gather-snippets/interpret/langs/md/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,8 @@ export const md = ({ title, text }) => {
});
}

const tags = staticLabels({
text,
label: 'tags',
begin: /(\(|<!\-\-|)[\s]*tags[\s]*:/gi,
end: /(\-\-\>)/gi,
});

const newppet = {
forelinks: Array.from(forelinks).sort(),
tags,
text: toMarkdown(mdAST),
...parsedFrontmatter,
};
Expand Down
3,315 changes: 3,170 additions & 145 deletions public/bundle/min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/data/links.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/data/snippets.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/data/tags.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["1-liner","coaithored","esi","frivolous","game","golf","joke","le chat","metappet","minibrary","polyfill","puzzle","quine","reel","remix","sketch","subtext","testing","the fun parts","translation","tribute","useful","useless","variation","variations","wellbeing","wtfjs","wuzzle","yolo"]
["1-liner","coaithored","esi","frivolous","game","golf","joke","le chat","metappet","minibrary","polyfill","puzzle","quine","reel","remix","sketch","subtext","testing","the fun parts","translation","tribute","useful","useless","variation","wellbeing","wtfjs","wuzzle","yolo"]
14 changes: 6 additions & 8 deletions public/src/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import { shuffleArray } from './utils/shuffle-array.js';

import { filterSnipPets } from './filter-snip-pets/index.js';

// ===== fetch data =====

const [comments, snips, snippets, tags] = await Promise.all([
fetch('../public/data/comments.json').then((res) => res.json()),
fetch('../public/data/snips.json').then((res) => res.json()),
fetch('../public/data/snippets.json').then((res) => res.json()),
fetch('../public/data/tags.json').then((res) => res.json()),
]);
// ===== import data =====

import comments from '../data/comments.json' assert { type: 'json' };
import snips from '../data/snips.json' assert { type: 'json' };
import snippets from '../data/snippets.json' assert { type: 'json' };
import tags from '../data/tags.json' assert { type: 'json' };

// ===== initialize state =====

Expand Down
4 changes: 2 additions & 2 deletions snippets/ESi.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
alt: Don't make it complex, KISS.
tags:
- metappet
---

# ℂ.js = ES(n + i)

Why [wait 6 years](https://github.com/tc39/proposal-pipeline-operator/issues/91) for a
real language feature? Have an imaginary one today.

<!-- tags: metappet -->
2 changes: 2 additions & 0 deletions snippets/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
alt: More interesting than useful.
tags:
- metappet
---

# Snippets
Expand Down
4 changes: 2 additions & 2 deletions snippets/all-medium.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
alt: no message
tags:
- metappet
---

They _intended_ to write. They really did.
Expand All @@ -13,5 +15,3 @@ Before there was a **what** there were [empty](./empty.json) [vehicles](./empty.
- [unused](./log.mjs)
- [unfinished](./funsole.mjs)
- [ill-defined](./cat-detector.psu)

<!-- tags: metappet -->
4 changes: 2 additions & 2 deletions snippets/be.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
alt: "* België, Belgique, Belgien"
tags:
- metappet
---

# Belgium\*!

<!-- tags: metappet -->
4 changes: 2 additions & 2 deletions snippets/the-fun-parts.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
alt: "JavaScripting: teach me how to, Dougie."
tags:
- metappet
---

# JavaScript: The ~~Good~~ _Fun_ Parts
Expand All @@ -12,5 +14,3 @@ exclusively on the ~~good~~ _fun_ parts.

- adapted by **Dougie Crockpot** from
[the original](https://www.oreilly.com/library/view/javascript-the-good/9780596517748/)

<!-- tags: metappet -->
4 changes: 2 additions & 2 deletions snippets/variation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
alt: It's expression, not obsession. I promise.
tags:
- metappet
---

# Theme and Variation

<!-- tags: metappet -->

0 comments on commit df355c9

Please sign in to comment.