From eb8baad7ff087e2025600b5569ee0f6c437c57bd Mon Sep 17 00:00:00 2001 From: Mehdi M Date: Sun, 12 Nov 2023 21:18:51 +0100 Subject: [PATCH] Fix missing index content on JavaScript disabled --- vitepress/.vitepress/config.mjs | 12 ++++ vitepress/.vitepress/theme/ArticlesIndex.vue | 51 +++++++++++++--- .../.vitepress/theme/ArticlesIndexClient.vue | 43 -------------- vitepress/.vitepress/theme/NotesIndex.vue | 58 ++++++++++++++++--- .../.vitepress/theme/NotesIndexClient.vue | 49 ---------------- vitepress/.vitepress/theme/index.js | 4 -- 6 files changed, 107 insertions(+), 110 deletions(-) delete mode 100644 vitepress/.vitepress/theme/ArticlesIndexClient.vue delete mode 100644 vitepress/.vitepress/theme/NotesIndexClient.vue diff --git a/vitepress/.vitepress/config.mjs b/vitepress/.vitepress/config.mjs index d2abfc8..ccb1bab 100644 --- a/vitepress/.vitepress/config.mjs +++ b/vitepress/.vitepress/config.mjs @@ -19,6 +19,18 @@ export default defineConfig({ ['link', { rel: 'alternate', type: 'application/rss+xml', title: APP_TITLE, href: `${APP_URL}/feed.xml` }] ], + vite: { + ssr: { + /** + * Prevent “module not found” error. Solution from + * https://github.com/vuejs/vitepress/issues/2832#issuecomment-1689498631 + * or any search using `noExternal` on Vitepress and Vite repos. + * @todo: Shouldn’t be needed on Vite 5. + */ + noExternal: ['datetime-attribute'], + }, + }, + themeConfig: { // https://vitepress.dev/reference/default-theme-config nav: [ diff --git a/vitepress/.vitepress/theme/ArticlesIndex.vue b/vitepress/.vitepress/theme/ArticlesIndex.vue index 675b212..ce4d360 100644 --- a/vitepress/.vitepress/theme/ArticlesIndex.vue +++ b/vitepress/.vitepress/theme/ArticlesIndex.vue @@ -1,13 +1,50 @@ diff --git a/vitepress/.vitepress/theme/ArticlesIndexClient.vue b/vitepress/.vitepress/theme/ArticlesIndexClient.vue deleted file mode 100644 index bb2bf0c..0000000 --- a/vitepress/.vitepress/theme/ArticlesIndexClient.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/vitepress/.vitepress/theme/NotesIndex.vue b/vitepress/.vitepress/theme/NotesIndex.vue index 9cb77f5..790ee0d 100644 --- a/vitepress/.vitepress/theme/NotesIndex.vue +++ b/vitepress/.vitepress/theme/NotesIndex.vue @@ -1,13 +1,57 @@ diff --git a/vitepress/.vitepress/theme/NotesIndexClient.vue b/vitepress/.vitepress/theme/NotesIndexClient.vue deleted file mode 100644 index 4b658fe..0000000 --- a/vitepress/.vitepress/theme/NotesIndexClient.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - diff --git a/vitepress/.vitepress/theme/index.js b/vitepress/.vitepress/theme/index.js index 4057957..f70e8bc 100644 --- a/vitepress/.vitepress/theme/index.js +++ b/vitepress/.vitepress/theme/index.js @@ -1,10 +1,6 @@ import './custom.css' import DefaultTheme from 'vitepress/theme' -// import NotesIndex from './NotesIndex.vue' export default { extends: DefaultTheme, - // enhanceApp({ app }) { - // app.component('notes-index', NotesIndex) - // } }