Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit728c5ec

Browse files
committed
feat: Start creating docs content.
1 parentc2721f0 commit728c5ec

File tree

7 files changed

+60
-0
lines changed

7 files changed

+60
-0
lines changed

‎src/content/config.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import{z,defineCollection}from'astro:content';
2+
3+
constdocsCollection=defineCollection({
4+
type:'content',
5+
schema:z.object({
6+
title:z.string(),
7+
}),
8+
});
9+
10+
exportconstcollections={
11+
docs:docsCollection,
12+
};

‎src/content/docs/index.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title:Vue
3+
---
4+
5+
##Vue
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title:Was ist Vue?
3+
---

‎src/content/docs/me.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title:Über mich
3+
---
4+
5+
##Über mich

‎src/env.d.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
/// <reference path="../.astro/types.d.ts" />
12
/// <reference types="astro/client" />

‎src/layouts/SiteLayout.astro‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
const { title }=Astro.props;
3+
---
4+
<!DOCTYPEhtml>
5+
<htmllang="de">
6+
<head>
7+
<metacharset="utf-8">
8+
<metaname="viewport"content="width=device-width, initial-scale=1.0">
9+
<title>{title} - Lean Vue Docs</title>
10+
</head>
11+
<body>
12+
<slot />
13+
</body>
14+
</html>

‎src/pages/docs/[...slug].astro‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
import {getCollection }from'astro:content';
3+
importSiteLayoutfrom'../../layouts/SiteLayout.astro';
4+
5+
exportasyncfunction getStaticPaths() {
6+
const docEntries=awaitgetCollection('docs');
7+
returndocEntries.map((entry)=> ({
8+
params: { slug:entry.slug },
9+
props: {entry },
10+
}));
11+
}
12+
13+
const { entry }=Astro.props;
14+
const { Content }=awaitentry.render();
15+
---
16+
17+
<SiteLayouttitle={entry.data.title}>
18+
<h1>{entry.data.title}</h1>
19+
<Content />
20+
</SiteLayout>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp