-
-
Notifications
You must be signed in to change notification settings - Fork 635
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Sébastien Chopin <[email protected]> Co-authored-by: nobkd <[email protected]>
- Loading branch information
1 parent
6c5350a
commit 3d8a553
Showing
7 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
John | ||
Joes | ||
Jessi | ||
Jason |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { resolve } from 'path' | ||
import { defineNuxtModule } from '@nuxt/kit' | ||
|
||
export default defineNuxtModule({ | ||
setup (_options, nuxt) { | ||
nuxt.options.nitro.externals = nuxt.options.nitro.externals || {} | ||
nuxt.options.nitro.externals.inline = nuxt.options.nitro.externals.inline || [] | ||
nuxt.options.nitro.externals.inline.push(resolve('./my-module')) | ||
// @ts-ignore | ||
nuxt.hook('content:context', (contentContext) => { | ||
contentContext.transformers.push(resolve('./my-module/my-transformer.ts')) | ||
}) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { defineTransformer } from '@nuxt/content/transformers' | ||
|
||
export default defineTransformer({ | ||
name: 'my-transformer', | ||
extensions: ['.names'], | ||
parse (_id, rawContent) { | ||
return { | ||
_id, | ||
body: rawContent.trim().split('\n').map(line => line.trim()).sort() | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineNuxtConfig } from 'nuxt' | ||
import MyModule from './my-module/my-module' | ||
|
||
export default defineNuxtConfig({ | ||
modules: [ | ||
MyModule, | ||
'@nuxt/content' | ||
] | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "example-hello-world", | ||
"private": true, | ||
"scripts": { | ||
"build": "nuxt build", | ||
"dev": "nuxt dev", | ||
"generate": "nuxt generate", | ||
"preview": "nuxt preview" | ||
}, | ||
"devDependencies": { | ||
"@nuxt/content": "npm:@nuxt/content-edge@latest", | ||
"nuxt": "npm:nuxt3@latest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<template> | ||
<div class="content-page"> | ||
<ContentDoc v-slot="{ doc }"> | ||
<div> | ||
{{ doc }} | ||
</div> | ||
</ContentDoc> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
definePageMeta({ | ||
layout: 'default', | ||
layoutTransition: false | ||
}) | ||
</script> | ||
|
||
<style> | ||
.content-page { | ||
height: calc(100vh - 60px); | ||
max-height: calc(100vh - 60px); | ||
padding: 1rem; | ||
margin: 0; | ||
} | ||
</style> |