-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
452 additions
and
18 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 |
---|---|---|
@@ -1,9 +1,48 @@ | ||
// 1. Import utilities from `astro:content` | ||
import { defineCollection } from 'astro:content'; | ||
import { z, defineCollection } from 'astro:content'; | ||
import { optional } from 'zod'; | ||
// 2. Define your collection(s) | ||
const dokumentasiCollection = defineCollection({ /* ... */ }); | ||
const blogCollection = defineCollection({ | ||
type: 'content', | ||
schema: z.object({ | ||
title: z.string(), | ||
tags: z.array(z.string()), | ||
image: z.array(z.string().optional()) | ||
}) | ||
}); | ||
const docCollection = defineCollection({ | ||
type: 'content', | ||
schema: z.object({ | ||
title: z.string(), | ||
tags: z.array(z.string()), | ||
image: z.array(z.string().optional()) | ||
}) | ||
}); | ||
const newsCollection = defineCollection({ | ||
type: 'content', | ||
schema: z.object({ | ||
title: z.string(), | ||
author: z.string(), | ||
description: z.string(), | ||
tags: z.array(z.string()), | ||
}) | ||
}); | ||
const tutorialCollection = defineCollection({ | ||
type: 'content', | ||
schema: z.object({ | ||
title: z.string(), | ||
author: z.string(), | ||
description: z.string(), | ||
tags: z.array(z.string()), | ||
image: z.array(z.string().optional()) | ||
}) | ||
}); | ||
|
||
// 3. Export a single `collections` object to register your collection(s) | ||
// This key should match your collection directory name in "src/content" | ||
export const collections = { | ||
'dokumentasi': dokumentasiCollection, | ||
'blogs': blogCollection, | ||
'documents': docCollection, | ||
'newsletter': newsCollection, | ||
'tutorials': tutorialCollection | ||
}; |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
--- | ||
--- | ||
|
||
# Collection | ||
|
||
Ini dokumen mengenai Astro Collections. | ||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
--- | ||
title: Food Blogs Template By W3.CSS | ||
author: FX. Adi Lima | ||
description: Contoh template dari W3.CSS | ||
tags: [blogs, collections, content] | ||
image: [/images/rompi-berduri.jpg] | ||
--- | ||
|
||
# W3.CSS Template Food Blogs | ||
|
||
Belum ditulis, [kembali ke Astro Collections](/docs/astro-collections). | ||
|
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
/// <reference path="../.astro/types.d.ts" /> | ||
/// <reference types="astro/client" /> |
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,38 @@ | ||
--- | ||
import { getEntry } from 'astro:content'; | ||
const entry = await getEntry('tutorials', 'template-1'); | ||
const { Content, headings } = await entry.render(); | ||
--- | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
<title>{entry.data.title}</title> | ||
<meta name="generator" content={Astro.generator} /> | ||
<meta name="author" content="FX. Adi Lima" /> | ||
<meta name="description" content="Astro description"> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | ||
<link href="/styles/w3.css" rel="stylesheet"/> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/> | ||
</head> | ||
<body> | ||
<main class="w3-main"> | ||
<div class="w3-content"> | ||
<div class="w3-container"> | ||
<article class="w3-panel"> | ||
<p><strong>{entry.data.title}</strong></p> | ||
<p>Tags: { | ||
entry.data.tags.forEach(element => { | ||
<span class="w3-tag">${element}</span> | ||
})} | ||
</p> | ||
<Content /> | ||
</article> | ||
</div> | ||
</div> | ||
</main> | ||
</body> | ||
</html> | ||
|
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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
{ | ||
"extends": "astro/tsconfigs/base" | ||
} | ||
"extends": "astro/tsconfigs/base", | ||
"compilerOptions": { | ||
/* Null Check */ | ||
"strictNullChecks": true, | ||
"allowJs": true | ||
} | ||
} |