Fix now and guide to incrementals pages
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m21s

This commit is contained in:
thepaperpilot 2024-06-18 09:30:26 -05:00
parent 14a570c17b
commit 411de1d59f
9 changed files with 45 additions and 23 deletions

View file

@ -172,10 +172,22 @@ function moveImportStatementUp(filePath, times = 1) {
// Fix links to /now
data = data.replace('NOW', '/now')
// Add header to the top
data = data.replaceAll('___', '/');
const relPath = path.relative("./garden-output/logseq-pages", path.resolve(...filePath.split("___"))).replaceAll(/%3F/gi, '').replace('what-is-content-', 'what-is-content').replace('.md', '/index.md');
data = data.replaceAll(
/---\n\n/gm,
`prev: false\nnext: false\n---\n<script setup>\nimport { data } from '${path.relative(path.resolve("site", relPath), path.resolve("site", "git.data.ts")).replaceAll('\\', '/')}';\nimport { useData } from 'vitepress';\nconst pageData = useData();\n</script>\n<h1 class="p-name">${data.match(/title: "(.+)"/)[1]}</h1>\n<p>${wc} words, ~${Math.round(wc / 183)} minute read. <span v-html="data[\`site/\${pageData.page.value.relativePath}\`]" /></p>\n<hr/>\n\n`);
`prev: false
next: false
---
<script setup>
import { data } from '${path.relative(path.resolve("site", relPath), path.resolve("site", "git.data.ts")).replaceAll('\\', '/')}';
import { useData } from 'vitepress';
const pageData = useData();
</script>
<h1 class="p-name">${data.match(/title: "(.+)"/)[1]}</h1>
<p>${wc} words, ~${Math.round(wc / 183)} minute read. <span v-html="data[\`site/\${pageData.page.value.relativePath}\`]" /></p>
<hr/>
\n`);
const fd = fs.openSync(filePath, "w+");
fs.writeSync(fd, data);

View file

@ -1,7 +1,7 @@
---
public: "true"
slug: "guide-to-incrementals___appeal-to-developers"
title: "Guide to Incrementals___Appeal to Developers"
slug: "guide-to-incrementals/appeal-to-developers"
title: "Guide to Incrementals/Appeal to Developers"
prev: false
next: false
---
@ -10,7 +10,7 @@ import { data } from '../../../git.data.ts';
import { useData } from 'vitepress';
const pageData = useData();
</script>
<h1 class="p-name">Guide to Incrementals___Appeal to Developers</h1>
<h1 class="p-name">Guide to Incrementals/Appeal to Developers</h1>
<p>636 words, ~3 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/>

View file

@ -1,7 +1,7 @@
---
public: "true"
slug: "guide-to-incrementals___appeal-to-players"
title: "Guide to Incrementals___Appeal to Players"
slug: "guide-to-incrementals/appeal-to-players"
title: "Guide to Incrementals/Appeal to Players"
prev: false
next: false
---
@ -10,7 +10,7 @@ import { data } from '../../../git.data.ts';
import { useData } from 'vitepress';
const pageData = useData();
</script>
<h1 class="p-name">Guide to Incrementals___Appeal to Players</h1>
<h1 class="p-name">Guide to Incrementals/Appeal to Players</h1>
<p>2400 words, ~13 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/>

View file

@ -1,7 +1,7 @@
---
public: "true"
slug: "guide-to-incrementals___defining-the-genre"
title: "Guide to Incrementals___Defining the Genre"
slug: "guide-to-incrementals/defining-the-genre"
title: "Guide to Incrementals/Defining the Genre"
prev: false
next: false
---
@ -10,7 +10,7 @@ import { data } from '../../../git.data.ts';
import { useData } from 'vitepress';
const pageData = useData();
</script>
<h1 class="p-name">Guide to Incrementals___Defining the Genre</h1>
<h1 class="p-name">Guide to Incrementals/Defining the Genre</h1>
<p>3429 words, ~19 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/>

View file

@ -1,7 +1,7 @@
---
public: "true"
slug: "guide-to-incrementals___navigating-criticism"
title: "Guide to Incrementals___Navigating Criticism"
slug: "guide-to-incrementals/navigating-criticism"
title: "Guide to Incrementals/Navigating Criticism"
prev: false
next: false
---
@ -10,7 +10,7 @@ import { data } from '../../../git.data.ts';
import { useData } from 'vitepress';
const pageData = useData();
</script>
<h1 class="p-name">Guide to Incrementals___Navigating Criticism</h1>
<h1 class="p-name">Guide to Incrementals/Navigating Criticism</h1>
<p>747 words, ~4 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/>

View file

@ -1,7 +1,7 @@
---
public: "true"
slug: "guide-to-incrementals___what-is-content-"
title: "Guide to Incrementals___What is Content?"
slug: "guide-to-incrementals/what-is-content-"
title: "Guide to Incrementals/What is Content?"
prev: false
next: false
---
@ -10,7 +10,7 @@ import { data } from '../../../git.data.ts';
import { useData } from 'vitepress';
const pageData = useData();
</script>
<h1 class="p-name">Guide to Incrementals___What is Content?</h1>
<h1 class="p-name">Guide to Incrementals/What is Content?</h1>
<p>2092 words, ~11 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/>

View file

@ -1,7 +1,7 @@
---
public: "true"
slug: "the-indieweb___amplification"
title: "The IndieWeb___Amplification"
slug: "the-indieweb/amplification"
title: "The IndieWeb/Amplification"
prev: false
next: false
---
@ -10,7 +10,7 @@ import { data } from '../../../git.data.ts';
import { useData } from 'vitepress';
const pageData = useData();
</script>
<h1 class="p-name">The IndieWeb___Amplification</h1>
<h1 class="p-name">The IndieWeb/Amplification</h1>
<p>57 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/>

View file

@ -1,7 +1,7 @@
---
public: "true"
slug: "the-indieweb___signature-blocks"
title: "The IndieWeb___Signature Blocks"
slug: "the-indieweb/signature-blocks"
title: "The IndieWeb/Signature Blocks"
prev: false
next: false
---
@ -10,7 +10,7 @@ import { data } from '../../../git.data.ts';
import { useData } from 'vitepress';
const pageData = useData();
</script>
<h1 class="p-name">The IndieWeb___Signature Blocks</h1>
<h1 class="p-name">The IndieWeb/Signature Blocks</h1>
<p>14 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/>

View file

@ -5,7 +5,7 @@ const util = require('node:util');
const exec = util.promisify(require('node:child_process').exec);
export default {
watch: ['site/garden/**/*'],
watch: ['site/garden/**/*', 'site/now/**/*'],
async load(files: string[]): Record<string, string> {
const ret: Record<string, string> = {};
await Promise.all(files.map(e => new Promise<void>(async (resolve) => {
@ -22,6 +22,16 @@ export default {
ret[e] = `Planted ${firstCommit}.${lastCommit ? ` Last tended to ${lastCommit}.` : ''}`;
resolve();
})));
console.log(ret)
// Map pages just like build_garden does
ret['site/guide-to-incrementals/index.md'] = ret['site/garden/guide-to-incrementals/index.md'];
ret['site/guide-to-incrementals/design/criticism/index.md'] = ret['site/garden/guide-to-incrementals/navigating-criticism/index.md'];
ret['site/guide-to-incrementals/ludology/appeal-developers/index.md'] = ret['site/garden/guide-to-incrementals/appeal-to-developers/index.md'];
ret['site/guide-to-incrementals/ludology/appeal-gamers/index.md'] = ret['site/garden/guide-to-incrementals/appeal-to-players/index.md'];
ret['site/guide-to-incrementals/ludology/content/index.md'] = ret['site/garden/guide-to-incrementals/what-is-content/index.md'];
ret['site/guide-to-incrementals/ludology/definition/index.md'] = ret['site/garden/guide-to-incrementals/defining-the-genre/index.md'];
return ret;
}
};