import { SearchPlugin } from "vitepress-plugin-search"; import { defineConfig } from "vitepress"; import wordCounting from "word-counting"; import vueJsx from '@vitejs/plugin-vue-jsx' 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 => ({ text: page, link: `/garden/${page.toLowerCase().replaceAll(' ', '-')}` })); } export default { lang: "en-US", title: 'The Paper Pilot', description: 'The Paper Pilot\'s Digital Garden', appearance: false, vite: { ssr: { noExternal: [ '@nolebase/vitepress-plugin-highlight-targeted-heading' ] }, plugins: [vueJsx()] }, sitemap: { hostname: 'https://thepaperpilot.org' }, head: [ ['link', { rel: 'preconnect', href: 'https://fonts.googleapis.com' }], ['link', { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Itim&family=Roboto+Mono:ital,wght@0,400;0,600;1,400&display=block' }], ['link', { rel: 'manifest', href: '/site.webmanifest' }], ['link', { rel: 'alternate', type: "text/mf2+html", href: '/changelog' }], ['link', { rel: 'alternate', type: "application/rss+xml", title: 'Changelog', href: '/changelog/rss' }], ['link', { rel: 'alternate', type: "application/atom+xml", title: 'Changelog', href: '/changelog/atom' }], ['link', { rel: 'alternate', type: "application/json+xml", title: 'Changelog', href: '/changelog/json' }], ['link', { rel: 'me', href: 'mailto:thepaperpilot@incremental.social' }], ['link', { rel: 'me', href: 'https://incremental.social/u/thepaperpilot' }], ['link', { rel: 'me', href: 'https://matrix.to/#/@thepaperpilot:incremental.social' }], ['link', { rel: 'me', href: 'https://code.incremental.social/thepaperpilot' }], ['link', { rel: 'me', href: 'https://www.linkedin.com/in/anthony-lawn/' }], ['link', { rel: 'me', href: 'https://mastodon.gamedev.place/@thepaperpilot' }], ['link', { rel: 'me', href: 'https://beehaw.org/u/thepaperpilot' }], ['link', { rel: 'me', href: 'https://www.reddit.com/user/ThePaperPilot/' }], ['link', { rel: 'me', href: 'https://github.com/thepaperpilot' }], ['link', { rel: 'me', href: 'https://twitter.com/ThePaperPilot' }], ['meta', { name: 'og:description', content: 'The Paper Pilot\'s Digital Garden' }] ], lastUpdated: false, cleanUrls: 'with-subfolders', themeConfig: { search: { provider: 'local', options: { _render(src, env, md) { const html = md.render(src, env); if (env.frontmatter?.search === false) return ''; if (env.relativePath.startsWith('public')) return ''; if (env.relativePath.startsWith('guide-to-incrementals')) return ''; return html; } } }, outline: 'deep', nav: [ { text: "Profectus", link: "https://moddingtree.com" }, { text: "Incremental Social", link: "https://incremental.social" } ], socialLinks: [ { icon: { svg: `Forgejo` }, link: "https://code.incremental.social/thepaperpilot" }, { icon: { svg: `Matrix` }, link: "https://matrix.to/#/@thepaperpilot:incremental.social" }, { icon: { svg: `Fediverse` }, link: "https://incremental.social/u/thepaperpilot" } ], sidebar: [ { text: "Recommended Pages", items: favorites }, { text: "About Me", link: "/about" }, { text: "/now", link: "/now" }, { text: "Site Changelog", link: "/changelog" } ] }, contentProps: { class: { "h-entry": true } } }