-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: clean up Markdoc starter to essentials
- Loading branch information
1 parent
815e2f2
commit a5435f1
Showing
16 changed files
with
147 additions
and
462 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 was deleted.
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,43 @@ | ||
--- | ||
import Aside from './Aside.astro'; | ||
import type { CollectionEntry } from 'astro:content'; | ||
type Props = { | ||
entry: CollectionEntry<'docs'>; | ||
}; | ||
const { entry } = Astro.props; | ||
const { Content } = await entry.render(); | ||
--- | ||
|
||
<Content | ||
config={{ | ||
// Accepts all Markdoc configuration options | ||
// See https://markdoc.dev/docs/config#full-example | ||
tags: { | ||
aside: { | ||
render: 'Aside', | ||
attributes: { | ||
type: { type: String }, | ||
title: { type: String }, | ||
}, | ||
}, | ||
}, | ||
}} | ||
components={{ | ||
// Pass a mapping from the component name | ||
// To an Astro or UI component import | ||
Aside, | ||
}} | ||
/> | ||
|
||
<style is:global> | ||
table { | ||
margin-block: 2rem; | ||
margin-inline: auto; | ||
} | ||
table td { | ||
padding-block: 0.3rem; | ||
padding-inline: 0.5rem; | ||
} | ||
</style> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -1,17 +1,9 @@ | ||
import { defineCollection, z } from 'astro:content'; | ||
|
||
const blog = defineCollection({ | ||
schema: z.object({ | ||
title: z.string(), | ||
}), | ||
}); | ||
|
||
const docs = defineCollection({ | ||
schema: z.object({ | ||
title: z.string(), | ||
description: z.string(), | ||
i18nReady: z.boolean(), | ||
}), | ||
}); | ||
|
||
export const collections = { blog, docs }; | ||
export const collections = { docs }; |
43 changes: 0 additions & 43 deletions
43
examples/with-markdoc/src/content/docs/content-collections.mdoc
This file was deleted.
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,39 @@ | ||
--- | ||
title: Welcome to Markdoc 👋 | ||
--- | ||
|
||
This simple starter showcases Markdoc with Content Collections. All Markdoc features are supported, including this nifty built-in `{% table %}` tag: | ||
|
||
{% table %} | ||
* Feature | ||
* Supported | ||
--- | ||
* `.mdoc` in Content Collections | ||
* ✅ | ||
--- | ||
* Markdoc transform configuration | ||
* ✅ | ||
--- | ||
* Astro components | ||
* ✅ | ||
{% /table %} | ||
|
||
{% aside title="Code Challenge" type="tip" %} | ||
|
||
Reveal the secret message below by adding `revealSecret: true` to your list of Markdoc variables. | ||
|
||
_Hint: Try [adding a `variables` object](https://markdoc.dev/docs/variables#global-variables) to the `config` property under `src/components/DocsContent.astro`._ | ||
|
||
{% if $revealSecret %} | ||
|
||
Maybe the real secret was the Rick Rolls we shared along the way. | ||
|
||
![Rick Astley dancing](https://media.tenor.com/x8v1oNUOmg4AAAAM/rickroll-roll.gif) | ||
|
||
{% /if %} | ||
|
||
{% /aside %} | ||
|
||
Check out [the `@astrojs/markdoc` integration][astro-markdoc] for complete documentation and usage examples. | ||
|
||
[astro-markdoc]: https://docs.astro.build/en/guides/integrations-guide/markdoc/ |
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,35 @@ | ||
--- | ||
export interface Props { | ||
title: string; | ||
} | ||
const { title } = Astro.props; | ||
--- | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | ||
<meta name="generator" content={Astro.generator} /> | ||
<title>{title}</title> | ||
</head> | ||
<body> | ||
<slot /> | ||
</body> | ||
</html> | ||
<style is:global> | ||
html { | ||
font-family: system-ui, sans-serif; | ||
background-color: #f6f6f6; | ||
} | ||
code { | ||
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, | ||
Bitstream Vera Sans Mono, Courier New, monospace; | ||
} | ||
main { | ||
margin: auto; | ||
max-width: 60ch; | ||
} | ||
</style> |
Oops, something went wrong.