Skip to content

Commit 1335284

Browse files
committed
chore: add example pages
1 parent 2f55cff commit 1335284

File tree

10 files changed

+76
-6
lines changed

10 files changed

+76
-6
lines changed

playground/components/Docs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
### Markdown as Component
22

3-
This is a components the wrote as markdown
3+
This is a components written as markdown.

playground/layouts/dark.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<template>
2+
<div class="dark">
3+
<code>Dark layout</code>
4+
<slot />
5+
</div>
6+
</template>
7+
8+
<style scoped>
9+
.dark {
10+
background: #eee;
11+
}
12+
</style>

playground/layouts/default.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<template>
2+
<div>
3+
<code>Default layout</code>
4+
<slot />
5+
</div>
6+
</template>

playground/middleware/log.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default defineNuxtRouteMiddleware((to) => {
2+
console.log('[log middleware] Going to ', to.path)
3+
})

playground/pages/about.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
meta:
3+
layout: dark
4+
---
5+
6+
# About page
7+
8+
Go back [home](/)

playground/pages/blog.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: Blog
3+
seo:
4+
title: 'Welcome to my blog'
5+
description: 'A list of article about Vue & Nuxt'
6+
meta:
7+
layout: dark
8+
middleware: log
9+
---
10+
11+
# Blog
12+
13+
Welcome to the blog section.
14+
15+
frontmatter:
16+
17+
<pre>{{ frontmatter }}</pre>
18+
19+
Back [home](/).

playground/pages/dynamic/[slug].md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Hello {{ $route.params.slug }}
2+
3+
This is a dynamic route written in Markdown ✨
4+
5+
- Go to [/dynamic/hello](/dynamic/hello)
6+
- Go to [/dynamic/foo](/dynamic/foo)
7+
- Go to [/dynamic/bar](/dynamic/bar)
8+
9+
Back to [home](/).

playground/pages/foo.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

playground/pages/index.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,24 @@
22

33
Nuxt Page as Markdown
44

5+
- Go to [/blog](/blog)
6+
- Go to [/about](/about)
7+
- Go to [/dynamic/hello](/dynamic/hello)
8+
9+
---
10+
511
<Counter />
612

713
<Docs />
814

9-
Go to [/foo](/foo)
10-
1115
---
1216

1317
For [Nuxt](http://nuxt.com/)
18+
19+
Checkout the [about page](/about) or the [blog](/blog).
20+
21+
```ts
22+
export default defineNuxtConfig({
23+
// Hello World
24+
})
25+
```

src/module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ export default defineNuxtModule<ModuleOptions>({
7777
)
7878
}
7979

80+
options.wrapperClasses = options.wrapperClasses || ''
81+
// Force disabling head (leveraging `seo` key)
82+
options.headEnabled = false
83+
8084
addVitePlugin(() => Markdown.vite(options))
8185
addWebpackPlugin(() => Markdown.webpack(options))
8286
},

0 commit comments

Comments
 (0)