Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content Collections #5291

Merged
merged 183 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
be0c81e
feat: port content plugin as-is
bholmesdev Oct 24, 2022
53889c2
feat: add `fetchContent` to `.astro`
bholmesdev Oct 24, 2022
c83fb22
refactor: move more logic to content-internals
bholmesdev Oct 24, 2022
9b5124d
refactor: move internals -> content dir
bholmesdev Oct 24, 2022
55aeeea
feat: nested dir support
bholmesdev Oct 24, 2022
269d82a
feat: add with-content playground
bholmesdev Oct 24, 2022
f267b58
edit: update README
bholmesdev Oct 24, 2022
1e167b7
fix: serialize route pattern for Netlify edge
bholmesdev Sep 12, 2022
3704dbb
wip: add ?astro-asset-ssr flag
bholmesdev Oct 19, 2022
5619747
wip: exclude astro-ssr-asset styles from build
bholmesdev Oct 19, 2022
6f6c396
revert: SSR asset flag babel changes
bholmesdev Oct 20, 2022
8e68957
feat: only load CSS when mdx is rendered!
bholmesdev Oct 20, 2022
73212ad
fix(vercel): Include all files inside `dist/` instead of only `entry.…
JuanM04 Oct 24, 2022
c11ebd0
chore: only-allow pnpm (#5131)
shengxinjing Oct 24, 2022
2d6aeef
[MDX] Support `recmaPlugins` config (#5146)
bholmesdev Oct 24, 2022
21240d3
removes default content-visibility styles from image components (#5180)
Oct 24, 2022
334363c
wip: check renderContent works
bholmesdev Oct 24, 2022
9a068df
nit: injectDelayedAssetPlugin doesn't need enforce
bholmesdev Oct 24, 2022
7ea7270
feat: render content with generated entries
bholmesdev Oct 24, 2022
1284ed8
feat: renderContent style injection POC
bholmesdev Oct 24, 2022
4fbefa4
wip: scrappy renderContent binding
bholmesdev Oct 25, 2022
39af82f
deps: parse-imports
bholmesdev Oct 25, 2022
24434f0
feat: only bind renderContent when imported
bholmesdev Oct 25, 2022
fdc51a7
feat: new-and-improved render-content
bholmesdev Oct 25, 2022
c7a8eca
fix: update example to use render-content
bholmesdev Oct 25, 2022
c361de2
refactor: extract normalizeFilename helper
bholmesdev Oct 25, 2022
5f0289d
feat: move renderContent to `.astro`
bholmesdev Oct 25, 2022
f1ed391
feat: add `getStaticPaths` demo 👀
bholmesdev Oct 25, 2022
bd596f7
chore: remove console log
bholmesdev Oct 26, 2022
dbe1f2a
refactor: internals -> internal
bholmesdev Oct 26, 2022
019dc44
fix: style bleed on dynamic routes
bholmesdev Oct 26, 2022
bfcfba0
chore: remove console log
bholmesdev Oct 27, 2022
ac5a28f
refactor: move rendercontentmap inside same file
bholmesdev Oct 27, 2022
f74c7cd
fix: style bleed in dev!
bholmesdev Oct 27, 2022
cad294f
feat: clean up example
bholmesdev Oct 28, 2022
bb301ca
refactor: curry generateContent
bholmesdev Oct 28, 2022
7cdb60f
nit: add datetime demo
bholmesdev Oct 28, 2022
34fd494
refactor: rename and move content plugins
bholmesdev Oct 28, 2022
c465b1c
feat: granular content updates in development
bholmesdev Nov 1, 2022
9688b50
chore: console.log
bholmesdev Nov 1, 2022
5c5660c
refactor: move write logic, fix edge cases
bholmesdev Nov 1, 2022
bf7d373
fix: use z.any() when ~schema is missing
bholmesdev Nov 1, 2022
1389ada
refactor: clean up logging
bholmesdev Nov 1, 2022
84d62d0
fix: add delayed asset flag to render map
bholmesdev Nov 2, 2022
43b363c
fix: use new server loader
bholmesdev Nov 2, 2022
7aacd10
chore: import type
bholmesdev Nov 2, 2022
b974c4f
fix: split delayed assets to separate chunks
bholmesdev Nov 3, 2022
2049861
chore: bad merge changesets
bholmesdev Nov 3, 2022
d99d50d
feat: rework content map to Vite globs
bholmesdev Nov 11, 2022
e954a33
fix: formatted errors
bholmesdev Nov 11, 2022
d781192
fix: get `renderContent` working with new APIs
bholmesdev Nov 15, 2022
0d0f8c0
refactor: rename to getCollection, getEntry, renderEntry
bholmesdev Nov 15, 2022
41df912
feat: streamline type alias!
bholmesdev Nov 16, 2022
1f73106
fix: check schema import is an import
bholmesdev Nov 16, 2022
4be299f
refactor: change ~schema -> index with defineCollection
bholmesdev Nov 16, 2022
6e6c95c
feat: auto apply env.d.ts reference
bholmesdev Nov 16, 2022
a2d10ed
feat: expose `headings` on `renderEntry`
bholmesdev Nov 17, 2022
473b7f1
refactor: expose zod from astro/zod
bholmesdev Nov 17, 2022
e98316b
feat: add Collection util type
bholmesdev Nov 17, 2022
aab0d02
refactor: generated types in src/content/
bholmesdev Nov 18, 2022
6906230
edit: remove env.d.ts change from with-content
bholmesdev Nov 18, 2022
5c46dc8
feat: collectionToPaths utility
bholmesdev Nov 18, 2022
383e842
refactor: migrate `examples/blog`
bholmesdev Nov 18, 2022
45b9765
refactor: simplify [...slug]
bholmesdev Nov 18, 2022
809913a
fix: invalid date
bholmesdev Nov 18, 2022
e4e8ad7
fix: renderEntry
bholmesdev Nov 18, 2022
4187908
feat: migrate examples/docs to content!
bholmesdev Nov 18, 2022
8055174
refactor: union -> enum
bholmesdev Nov 18, 2022
18b847b
fix: remove duplicate header
bholmesdev Nov 18, 2022
bc9b598
chore: changeset
bholmesdev Nov 18, 2022
380bb84
Revert "fix: serialize route pattern for Netlify edge"
bholmesdev Nov 18, 2022
d30e49a
fix: lint
bholmesdev Nov 18, 2022
20726e1
fix: include zod in package files
bholmesdev Nov 18, 2022
2fd75a0
chore: push type gen for astro check
bholmesdev Nov 19, 2022
ba18a02
feat: move to single defineCollections file
bholmesdev Nov 22, 2022
2da41f9
feat: move examples to new collections model
bholmesdev Nov 22, 2022
d88e552
chore: type check valid collection names
bholmesdev Nov 22, 2022
14fb7a9
fix: ignore collections path in err logs
bholmesdev Nov 22, 2022
c09712a
refactor: content/index -> content/config
bholmesdev Nov 28, 2022
e3f935a
refactor: defineCollections -> defineCollection
bholmesdev Nov 29, 2022
8589ff0
fix: update docs to defineCollection
bholmesdev Nov 29, 2022
fd1f225
chore: update with-content to new `astro:content` setup
bholmesdev Nov 29, 2022
9d99a82
fix: renderEntry styles
bholmesdev Nov 29, 2022
cacd77c
fix: bad Collection type
bholmesdev Nov 29, 2022
a5359b8
fix: blog types generated
bholmesdev Nov 29, 2022
fc7879f
feat: expose injectedFrontmatter on renderEntry
bholmesdev Nov 29, 2022
c1c9af1
chore: `import type`
bholmesdev Nov 29, 2022
2281047
chore: add MDX to changeset
bholmesdev Nov 29, 2022
9bea655
fix: template package file
bholmesdev Nov 30, 2022
afedd08
fix: unneeded log on content config change
bholmesdev Dec 1, 2022
16292c4
chore: add `injectedFrontmatter` to generated types
bholmesdev Dec 1, 2022
5fb84ba
fix: escape import.meta.env in `body`
bholmesdev Dec 1, 2022
0c848d8
fix: escape import.meta.env in frontmatter
bholmesdev Dec 1, 2022
77e660d
chore: unused import
bholmesdev Dec 1, 2022
3d218ea
fix: use URL for config pathname
bholmesdev Dec 1, 2022
2d35d81
feat: allow zod async transforms
bholmesdev Dec 2, 2022
ee6421c
deps: devalue
bholmesdev Dec 5, 2022
1261711
feat: custom slugs + better type checking
bholmesdev Dec 5, 2022
b4e9602
fix: update types on config added or removed
bholmesdev Dec 5, 2022
e6afdc5
chore: add error msg for MDX preview release
bholmesdev Dec 5, 2022
3ea5392
refactor: restore old normalizeFilename
bholmesdev Dec 5, 2022
917032a
fix: add loadContentConfig error classes back
bholmesdev Dec 5, 2022
28f620b
Add initial tests for renderEntry
matthewp Dec 7, 2022
ab8b19d
add fixture tests
matthewp Dec 7, 2022
ab28fc3
Use head propagation APIs in renderEntry
matthewp Dec 7, 2022
3c6fa40
chore: new type gen
bholmesdev Dec 7, 2022
331e2b9
fix: sort content keys before writing
bholmesdev Dec 9, 2022
0c8fb1c
fix: avoid writing '.' collection with warning
bholmesdev Dec 9, 2022
148a02c
chore: docs types generated
bholmesdev Dec 9, 2022
94e9202
fix: generated types only once in build
bholmesdev Dec 9, 2022
45a3fb3
fix: use relative path to config for git
bholmesdev Dec 9, 2022
0ea90e8
chore: update generated types
bholmesdev Dec 9, 2022
d834a04
fix: glob pattern on valid exts
bholmesdev Dec 9, 2022
69dcf2c
feat: warn on possible collection typos
bholmesdev Dec 9, 2022
f53a1f4
chore: better error on bad lazy import
bholmesdev Dec 9, 2022
cc52f38
fix: clear gray-matter cache for rawData
bholmesdev Dec 12, 2022
25f8451
fix: wait for config file while generating
bholmesdev Dec 12, 2022
125f285
test: get collection and get entry basic
bholmesdev Dec 12, 2022
f73b466
test: multiple collections and entries
bholmesdev Dec 12, 2022
11743b9
test: add publishedDate test on entry
bholmesdev Dec 12, 2022
8c26a02
tests: getStaticPaths integration
bholmesdev Dec 12, 2022
92f1173
test: ssr endpoint integration
bholmesdev Dec 13, 2022
b394bb8
chore: consistent test names
bholmesdev Dec 13, 2022
01a89dd
refactor: simplify generates... test
bholmesdev Dec 13, 2022
4455e1e
chore: tests lockfile
bholmesdev Dec 13, 2022
a9b10d1
feat: add `experimental` flag
bholmesdev Dec 13, 2022
2cfa303
chore: revert blog and docs examples
bholmesdev Dec 13, 2022
4931b9f
chore: add experimental flag to with-content
bholmesdev Dec 13, 2022
ffc0912
refactor: reuse contentFileExts
bholmesdev Dec 13, 2022
a61e017
refactor: make contentCollectionCss required
bholmesdev Dec 13, 2022
d011d65
chore: remove parse-imports dependency
bholmesdev Dec 13, 2022
d7e9b1a
chore: remove unresolved idea redundancy
bholmesdev Dec 13, 2022
6357e15
chore: update changeset to minor v
bholmesdev Dec 13, 2022
8bf35e6
chore: clean up with-content pass 1
bholmesdev Dec 13, 2022
df6ead5
refactor: de-monolith vite-plugin-content
bholmesdev Dec 13, 2022
8b9b388
chore: remove maximum jank warning (it's acceptable jank)
bholmesdev Dec 13, 2022
1310ddd
refactor: extract types-generator to separate file
bholmesdev Dec 13, 2022
e96badb
refactor: onEvent -> handleEvent
bholmesdev Dec 13, 2022
bcdc5df
edit: change content log to "types generated"
bholmesdev Dec 13, 2022
138ec96
fix: more experimental checks in prod build
bholmesdev Dec 13, 2022
d93c102
refactor: 2 jsToTreeNode calls -> 1
bholmesdev Dec 13, 2022
ff95c85
feat: change with-content example to blog example
bholmesdev Dec 13, 2022
a4c2374
fix: Content component type
bholmesdev Dec 13, 2022
41b4e60
Fix use of renderEntry within a slot
matthewp Dec 14, 2022
d9768ea
fix: warn for non-underscore _ files, refine logs
bholmesdev Dec 14, 2022
90d22ca
chore: Content type in tests
bholmesdev Dec 14, 2022
b28f9ec
fix: types no updating with config changes
bholmesdev Dec 14, 2022
ecf490a
fix: remove `result: SSRResult` type
bholmesdev Dec 15, 2022
bd75d7a
chore: entry var shadowing
bholmesdev Dec 15, 2022
624ed0d
fix: bad experimental flag call
bholmesdev Dec 15, 2022
8223323
wip: skip render entry tests
bholmesdev Dec 15, 2022
4baa862
fix: path resolution for .relative on windows
bholmesdev Dec 15, 2022
9a6da5e
chore: remove dead code
bholmesdev Dec 15, 2022
0284ffe
wip: log entryPath into
bholmesdev Dec 15, 2022
0446a3c
fix: use URL for entry
bholmesdev Dec 15, 2022
7b315e5
refactor: getEntryInfo normalization
bholmesdev Dec 15, 2022
c919a67
refactor: move debounce to queueEvent only
bholmesdev Dec 15, 2022
0dac0f0
fix: resolve loader on config error
bholmesdev Dec 15, 2022
4676edd
fix: pathToFileURL -> new URL
bholmesdev Dec 15, 2022
f56abfa
fix: dangerous pathname comparison
bholmesdev Dec 15, 2022
cef0e01
refactor: move rawEvent -> event mapping to queueEvent
bholmesdev Dec 15, 2022
6119ddf
fix: bad type
bholmesdev Dec 15, 2022
c112887
wip: remove mkdir call
bholmesdev Dec 15, 2022
ce850e6
wip: log content paths
bholmesdev Dec 15, 2022
4e48f1b
fix: more bad paths
bholmesdev Dec 15, 2022
63f176a
wip: more logs
bholmesdev Dec 15, 2022
300b4a3
fix: correct glob path
bholmesdev Dec 15, 2022
d4dd336
fix: normalize virtual mod path
bholmesdev Dec 15, 2022
42ffb22
fix: content server file paths
bholmesdev Dec 15, 2022
db7329b
chore: remove render entry test skip
bholmesdev Dec 15, 2022
8a50a97
wip: skip renderEntry tests (windows issues?)
bholmesdev Dec 15, 2022
9af2476
chore: remove console log
bholmesdev Dec 15, 2022
083825b
feat: renderEntry -> render
bholmesdev Dec 15, 2022
989d7ca
chore: add `--experimental-content-collections`
bholmesdev Dec 16, 2022
4476083
refactor: only skip renderEntry tests on windows
bholmesdev Dec 16, 2022
fb97c37
refactor: index.ts barrel export
bholmesdev Dec 16, 2022
db18f6a
fix: cli type error
bholmesdev Dec 16, 2022
5218b8f
fix: proper test skip on windows
bholmesdev Dec 16, 2022
aadece0
refactor: remove collectionToPaths :(
bholmesdev Dec 16, 2022
1a4ba37
refactor: use AstroError for frontmatter error
bholmesdev Dec 16, 2022
6dae520
nit: its schema, .*
bholmesdev Dec 16, 2022
3ca00c9
fix: bad isWindows import
bholmesdev Dec 16, 2022
36ffb39
fix: await mod -> mod = await
bholmesdev Dec 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/heavy-plums-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'astro': minor
'@astrojs/mdx': minor
---

Introduce Content Collections experimental API
- Organize your Markdown and MDX content into easy-to-manage collections.
- Add type safety to your frontmatter with schemas.
- Generate landing pages, static routes, and SSR endpoints from your content using the collection query APIs.
19 changes: 19 additions & 0 deletions examples/with-content/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# build output
dist/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
4 changes: 4 additions & 0 deletions examples/with-content/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions examples/with-content/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
52 changes: 52 additions & 0 deletions examples/with-content/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Astro Content Collections (Experimental)

This demos our Blog Starter using **[the experimental Content Collections API.](https://docs.astro.build/en/guides/content-collections)**

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/with-content)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/s/github/withastro/astro/tree/latest/examples/with-content)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!

## 🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

```
├── public/
├── src/
│ └── content/
│ └── blog/
│ ├── first.md
│ └── second.md
│ └── config.ts
│   ├── components/
│   ├── layouts/
│   └── pages/
├── astro.config.mjs
├── README.md
├── package.json
└── tsconfig.json
```

`src/content/` contains "collections" of related Markdown and MDX documents. Astro will generate a `getCollection` function to retrieve posts from `src/content/`, and type-check your frontmatter using an optional schema (see `src/content/config.ts`).

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :--------------------- | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Check out [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).

## Credit

This theme is based off of the lovely [Bear Blog](https://github.com/HermanMartinus/bearblog/).
13 changes: 13 additions & 0 deletions examples/with-content/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';

import sitemap from '@astrojs/sitemap';

// https://astro.build/config
export default defineConfig({
site: 'https://example.com',
integrations: [mdx(), sitemap()],
experimental: {
contentCollections: true,
},
});
18 changes: 18 additions & 0 deletions examples/with-content/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@example/with-content",
"type": "module",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"astro": "^1.6.15",
"@astrojs/mdx": "^0.12.2",
"@astrojs/sitemap": "^1.0.0"
}
}
13 changes: 13 additions & 0 deletions examples/with-content/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/with-content/public/placeholder-hero.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions examples/with-content/sandbox.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"infiniteLoopProtection": true,
"hardReloadOnChange": false,
"view": "browser",
"template": "node",
"container": {
"port": 3000,
"startScript": "start",
"node": "14"
}
}
38 changes: 38 additions & 0 deletions examples/with-content/src/components/BaseHead.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
// Import the global.css file here so that it is included on
// all pages through the use of the <BaseHead /> component.
import '../styles/global.css';

export interface Props {
title: string;
description: string;
image?: string;
}

const { title, description, image = '/placeholder-social.jpg' } = Astro.props;
---

<!-- Global Metadata -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />

<!-- Primary Meta Tags -->
<title>{title}</title>
<meta name="title" content={title} />
<meta name="description" content={description} />

<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content={Astro.url} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:image" content={new URL(image, Astro.url)} />

<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content={Astro.url} />
<meta property="twitter:title" content={title} />
<meta property="twitter:description" content={description} />
<meta property="twitter:image" content={new URL(image, Astro.url)} />
13 changes: 13 additions & 0 deletions examples/with-content/src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
const today = new Date();
---

<footer>
&copy; {today.getFullYear()} YOUR NAME HERE. All rights reserved.
</footer>
<style>
footer {
padding: 25px;
text-align: center;
}
</style>
25 changes: 25 additions & 0 deletions examples/with-content/src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
import HeaderLink from './HeaderLink.astro';
import { SITE_TITLE } from '../consts';
---

<header>
<h2>
{SITE_TITLE}
</h2>
<nav>
<HeaderLink href="/">Home</HeaderLink>
<HeaderLink href="/blog">Blog</HeaderLink>
<HeaderLink href="/about">About</HeaderLink>
<HeaderLink href="https://twitter.com/astrodotbuild" target="_blank">Twitter</HeaderLink>
<HeaderLink href="https://github.com/withastro/astro" target="_blank">GitHub</HeaderLink>
</nav>
</header>
<style>
header {
margin: 0em 0 2em;
}
h2 {
margin: 0.5em 0;
}
</style>
22 changes: 22 additions & 0 deletions examples/with-content/src/components/HeaderLink.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
export interface Props extends astroHTML.JSX.AnchorHTMLAttributes {}

const { href, class: className, ...props } = Astro.props;

const { pathname } = Astro.url;
const isActive = href === pathname || href === pathname.replace(/\/$/, '');
---

<a href={href} class:list={[className, { active: isActive }]} {...props}>
<slot />
</a>
<style>
a {
display: inline-block;
text-decoration: none;
}
a.active {
font-weight: bolder;
text-decoration: underline;
}
</style>
5 changes: 5 additions & 0 deletions examples/with-content/src/consts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Place any global data in this file.
// You can import this data from anywhere in your site by using the `import` keyword.

export const SITE_TITLE = 'My personal website.';
export const SITE_DESCRIPTION = 'Welcome to my website!';
16 changes: 16 additions & 0 deletions examples/with-content/src/content/blog/first-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: "First post"
description: "Lorem ipsum dolor sit amet"
pubDate: "Jul 08 2022"
heroImage: "/placeholder-hero.jpg"
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.

Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc. Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra massa massa ultricies mi.

Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.

Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id cursus metus aliquam eleifend mi.

Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
102 changes: 102 additions & 0 deletions examples/with-content/src/content/blog/markdown-style-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
title: "Markdown Style Guide"
description: "Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro."
pubDate: "Jul 01 2022"
heroImage: "/placeholder-hero.jpg"
---

Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.

## Headings

The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.

# H1
## H2
### H3
#### H4
##### H5
###### H6

## Paragraph

Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.

Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.

## Images

![This is a placeholder image description](/placeholder-social.jpg)

## Blockquotes

The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations.

#### Blockquote without attribution

> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
> **Note** that you can use *Markdown syntax* within a blockquote.

#### Blockquote with attribution

> Don't communicate by sharing memory, share memory by communicating.<br>
> — <cite>Rob Pike[^1]</cite>

[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.

## Tables

| Italics | Bold | Code |
| -------- | -------- | ------ |
| *italics* | **bold** | `code` |

## Code Blocks

```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
```

## List Types

#### Ordered List

1. First item
2. Second item
3. Third item

#### Unordered List

* List item
* Another item
* And another item

#### Nested list

* Fruit
* Apple
* Orange
* Banana
* Dairy
* Milk
* Cheese

## Other Elements — abbr, sub, sup, kbd, mark

<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.

H<sub>2</sub>O

X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>

Press <kbd><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd></kbd> to end the session.

Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
Loading