Read favorites list from logseq
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 58s

This commit is contained in:
thepaperpilot 2024-06-13 23:45:52 -05:00
parent 34f8298829
commit 6f7bea47fb
2 changed files with 12 additions and 7 deletions

2
Garden

@ -1 +1 @@
Subproject commit cac2da059dcb8de206ddffa13ea6bfb5e01c08eb
Subproject commit b7020e42eaf4a4713f74bab539ebe087ddd4a4e5

View file

@ -1,6 +1,16 @@
import { SearchPlugin } from "vitepress-plugin-search";
import { defineConfig } from "vitepress";
const fs = require("fs");
const path = require("path");
const filePath = path.resolve("./Garden/logseq/config.edn");
const data = fs.readFileSync(filePath).toString();
let favorites = [];
for (const match of data.matchAll(/:favorites \["([^\]]+)"\]/g)) {
favorites = match[1].split("\" \"").map(page => ({ title: page, link: `/garden/${page.toLowerCase().replaceAll(' ', '-')}` }));
}
module.exports = {
lang: "en-US",
title: 'The Paper Pilot',
@ -53,12 +63,7 @@ module.exports = {
sidebar: [
{
text: "Recommended Pages",
items: [
{ text: "My Projects", link: "/garden/my-projects" },
{ text: "Guide to Incrementals", link: "/garden/guide-to-incrementals" },
{ text: "The Small Web", link: "/garden/the-small-web" },
{ text: "Fedi v2", link: "/garden/fedi-v2" },
]
items: favorites
},
{ text: "Changelog", link: "/changelog" }
]