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 // Fix links to /now
data = data.replace('NOW', '/now') data = data.replace('NOW', '/now')
// Add header to the top // 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'); 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( data = data.replaceAll(
/---\n\n/gm, /---\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+"); const fd = fs.openSync(filePath, "w+");
fs.writeSync(fd, data); fs.writeSync(fd, data);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -5,7 +5,7 @@ const util = require('node:util');
const exec = util.promisify(require('node:child_process').exec); const exec = util.promisify(require('node:child_process').exec);
export default { export default {
watch: ['site/garden/**/*'], watch: ['site/garden/**/*', 'site/now/**/*'],
async load(files: string[]): Record<string, string> { async load(files: string[]): Record<string, string> {
const ret: Record<string, string> = {}; const ret: Record<string, string> = {};
await Promise.all(files.map(e => new Promise<void>(async (resolve) => { 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}.` : ''}`; ret[e] = `Planted ${firstCommit}.${lastCommit ? ` Last tended to ${lastCommit}.` : ''}`;
resolve(); 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; return ret;
} }
}; };