Skip to content

Commit

Permalink
fix: use content to read markdown files instead of pages (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Jun 1, 2021
1 parent 23571b1 commit 1c7b622
Show file tree
Hide file tree
Showing 23 changed files with 3 additions and 8 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/core/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function isUrl(string) {

export default <Module>async function docusModule() {
// Wait for nuxt options to be normalized
const { nuxt, addServerMiddleware, addPlugin, addModule } = this
const { nuxt, addServerMiddleware, addPlugin, addModule, $docus } = this
const { options } = nuxt
const isSSG = options.dev === false && (options.target === 'static' || options._generate || options.mode === 'spa')

Expand Down Expand Up @@ -89,7 +89,7 @@ export default <Module>async function docusModule() {
const { storage, lazyIndex } = initStorage({
drivers: [
{
base: resolve(options.srcDir, options.dir.pages),
base: resolve(options.srcDir, $docus.settings.contentDir),
mountPoint: 'pages'
},
{
Expand Down
5 changes: 0 additions & 5 deletions src/core/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ export const docusDriver = defineDriver((options: DriverOptions) => {
// unify key format
key = key.replace(/\//g, ':')

// ignore vue files
if (key.endsWith('.vue')) {
return null
}

const document = await parser.parse(key, content)

if (document.extension === '.md') {
Expand Down
2 changes: 1 addition & 1 deletion src/settings/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DocusSettings } from '../types'

export const docusDefaults: DocusSettings = {
title: 'Docus',
contentDir: 'pages',
contentDir: 'content',
url: '',
description: '',
template: 'docs',
Expand Down

1 comment on commit 1c7b622

@vercel
Copy link

@vercel vercel bot commented on 1c7b622 Jun 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

Please sign in to comment.