Read favorites list from logseq
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 58s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 58s
This commit is contained in:
parent
34f8298829
commit
6f7bea47fb
2 changed files with 12 additions and 7 deletions
2
Garden
2
Garden
|
@ -1 +1 @@
|
||||||
Subproject commit cac2da059dcb8de206ddffa13ea6bfb5e01c08eb
|
Subproject commit b7020e42eaf4a4713f74bab539ebe087ddd4a4e5
|
|
@ -1,6 +1,16 @@
|
||||||
import { SearchPlugin } from "vitepress-plugin-search";
|
import { SearchPlugin } from "vitepress-plugin-search";
|
||||||
import { defineConfig } from "vitepress";
|
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 = {
|
module.exports = {
|
||||||
lang: "en-US",
|
lang: "en-US",
|
||||||
title: 'The Paper Pilot',
|
title: 'The Paper Pilot',
|
||||||
|
@ -53,12 +63,7 @@ module.exports = {
|
||||||
sidebar: [
|
sidebar: [
|
||||||
{
|
{
|
||||||
text: "Recommended Pages",
|
text: "Recommended Pages",
|
||||||
items: [
|
items: favorites
|
||||||
{ 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" },
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{ text: "Changelog", link: "/changelog" }
|
{ text: "Changelog", link: "/changelog" }
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue