From 6d2ddfd1650f15e991b8acf9f8376747275ea817 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Tue, 16 Feb 2021 15:52:40 +0100 Subject: [PATCH] feat(theme): inject content dir option in config for "Edit on GitHub" link --- theme/components/templates/AppPageBottom.vue | 2 +- theme/module.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/theme/components/templates/AppPageBottom.vue b/theme/components/templates/AppPageBottom.vue index dd49df0ac..76506593a 100644 --- a/theme/components/templates/AppPageBottom.vue +++ b/theme/components/templates/AppPageBottom.vue @@ -41,7 +41,7 @@ export default { 'edit', this.settings.github.branch, this.settings.github.dir, - 'content', + this.$config.contentDir, `${this.document.path}${this.document.extension}`.replace(/^\//g, '') ].filter(Boolean).join('/') } diff --git a/theme/module.js b/theme/module.js index 0e004dc02..c5611da6f 100644 --- a/theme/module.js +++ b/theme/module.js @@ -12,6 +12,8 @@ export default function docusModule () { const { nuxt } = this const { options, hook } = this.nuxt + // Inject content dir in private runtime config + options.publicRuntimeConfig.contentDir = options.content.dir || 'content' // Configure `content/` dir options.content.dir = path.resolve(options.rootDir, options.content.dir || 'content') // Configure `static/ dir