Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit b323b4a

Browse files
committed
feat: "edit this page" button
1 parent e44215a commit b323b4a

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ The development server will be running at [http://localhost:3000](http://localho
4545
- [x] Allow each guide to toggle features
4646
- [ ] Allow each guide to configure file filter
4747
- [ ] Solution for each guide
48-
- [ ] A button of "Edit this page"
48+
- [x] A button of "Edit this page"
4949
- [ ] Verification for tutorial tasks
5050
- [ ] Search feature
5151
- [ ] Embedded Nuxt Docs (update CORS headers)
5252
- [ ] Command K System
5353
- [ ] About Page
5454
- [ ] Welcome Screen
55+
- [ ] Try https://ark-ui.com/docs/components/splitter
5556
- [x] Show release time for the playground
5657
- [x] Show Nuxt and Vue versions from the container
5758
- [x] Custom bundler for templates (replaces `import.meta.glob`, create static virtual modules)

components/PanelDocs.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
<script setup lang="ts">
2+
const { page } = useContent()
23
4+
const sourceUrl = computed(() => `https://github.com/nuxt/learn.nuxt.com/edit/main/content/${page.value._file}`)
35
</script>
46

57
<template>
6-
<div h-full grid="~ rows-[min-content_1fr]">
8+
<div h-full grid="~ rows-[min-content_1fr_min-content]">
79
<div flex="~ gap-2 items-center" border="b base dashed" bg-faded px4 py2>
810
<div i-ph-book-duotone />
911
<span text-sm>Guide</span>
1012
</div>
1113
<article class="max-w-none prose" of-auto p6>
1214
<ContentDoc />
1315
</article>
16+
<div border="t base dashed" px6 py2>
17+
<NuxtLink
18+
:to="sourceUrl" target="_blank"
19+
flex="~ items-center gap-2" op50 hover="text-primary op100"
20+
>
21+
<div i-ph-note-pencil-duotone />
22+
Edit this page
23+
</NuxtLink>
24+
</div>
1425
</div>
1526
</template>

nuxt.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export default defineNuxtConfig({
6767
defineModel: true,
6868
},
6969
content: {
70+
documentDriven: true,
7071
highlight: {
7172
theme: {
7273
default: 'vitesse-light',

0 commit comments

Comments
 (0)