Skip to content

Commit ed9403d

Browse files
authored
migrate to new astro config to use mdx, footnotes, etc. (#18)
1 parent 553e7f5 commit ed9403d

82 files changed

Lines changed: 2666 additions & 8606 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,68 @@
1-
# Stuff
1+
# Astro Starter Kit: Blog
22

3-
## How to publish new posts (b/c I'll surely forget)
4-
5-
- Make a new `*.md` file in `/content/blog`
6-
- Add this frontmatter:
3+
```sh
4+
npm create astro@latest -- --template blog
75
```
8-
---
9-
external: <true|false> (true is for external link posts)
10-
title: <title>
11-
date: yyyy-mm-dd
12-
---
6+
7+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/blog)
8+
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/blog)
9+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/blog/devcontainer.json)
10+
11+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
12+
13+
![blog](https://github.com/withastro/astro/assets/2244813/ff10799f-a816-4703-b967-c78997e8323d)
14+
15+
Features:
16+
17+
- ✅ Minimal styling (make it your own!)
18+
- ✅ 100/100 Lighthouse performance
19+
- ✅ SEO-friendly with canonical URLs and OpenGraph data
20+
- ✅ Sitemap support
21+
- ✅ RSS Feed support
22+
- ✅ Markdown & MDX support
23+
24+
## 🚀 Project Structure
25+
26+
Inside of your Astro project, you'll see the following folders and files:
27+
28+
```text
29+
├── public/
30+
├── src/
31+
│   ├── components/
32+
│   ├── content/
33+
│   ├── layouts/
34+
│   └── pages/
35+
├── astro.config.mjs
36+
├── README.md
37+
├── package.json
38+
└── tsconfig.json
1339
```
14-
- Push/merge to `master` branch
40+
41+
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
42+
43+
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
44+
45+
The `src/content/` directory contains "collections" of related Markdown and MDX documents. Use `getCollection()` to retrieve posts from `src/content/blog/`, and type-check your frontmatter using an optional schema. See [Astro's Content Collections docs](https://docs.astro.build/en/guides/content-collections/) to learn more.
46+
47+
Any static assets, like images, can be placed in the `public/` directory.
48+
49+
## 🧞 Commands
50+
51+
All commands are run from the root of the project, from a terminal:
52+
53+
| Command | Action |
54+
| :------------------------ | :----------------------------------------------- |
55+
| `npm install` | Installs dependencies |
56+
| `npm run dev` | Starts local dev server at `localhost:4321` |
57+
| `npm run build` | Build your production site to `./dist/` |
58+
| `npm run preview` | Preview your build locally, before deploying |
59+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
60+
| `npm run astro -- --help` | Get help using the Astro CLI |
61+
62+
## 👀 Want to learn more?
63+
64+
Check out [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
65+
66+
## Credit
67+
68+
This theme is based off of the lovely [Bear Blog](https://github.com/HermanMartinus/bearblog/).

astro.config.mjs

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,29 @@
1-
/* eslint-disable turbo/no-undeclared-env-vars */
21
import { defineConfig } from "astro/config";
2+
import mdx from "@astrojs/mdx";
33
import sitemap from "@astrojs/sitemap";
44

5-
/*
6-
We are doing some URL mumbo jumbo here to tell Astro what the URL of your website will be.
7-
In local development, your SEO meta tags will have localhost URL.
8-
In built production websites, your SEO meta tags should have your website URL.
9-
So we give our website URL here and the template will know what URL to use
10-
for meta tags during build.
11-
If you don't know your website URL yet, don't worry about this
12-
and leave it empty or use localhost URL. It won't break anything.
13-
*/
145
import tailwind from "@astrojs/tailwind";
15-
const SERVER_PORT = 3000;
16-
// the url to access your blog during local development
17-
const LOCALHOST_URL = `http://localhost:${SERVER_PORT}`;
18-
// the url to access your blog after deploying it somewhere (Eg. Netlify)
19-
const LIVE_URL = "https://travisnorthcutt.com";
20-
// this is the astro command your npm script runs
21-
const SCRIPT = process.env.npm_lifecycle_script || "";
22-
const isBuild = SCRIPT.includes("astro build");
23-
let BASE_URL = LOCALHOST_URL;
24-
// When you're building your site in local or in CI, you could just set your URL manually
25-
if (isBuild) {
26-
BASE_URL = LIVE_URL;
27-
}
286

297
// https://astro.build/config
308
export default defineConfig({
31-
server: {
32-
port: SERVER_PORT,
9+
markdown: {
10+
shikiConfig: {
11+
// Choose from Shiki's built-in themes (or add your own)
12+
// https://shiki.style/themes
13+
theme: "github-dark",
14+
// Alternatively, provide multiple themes
15+
// https://shiki.style/guide/dual-themes
16+
// Add custom languages
17+
// Note: Shiki has countless langs built-in, including .astro!
18+
// https://shiki.style/languages
19+
langs: [],
20+
// Enable word wrap to prevent horizontal scrolling
21+
wrap: true,
22+
// Add custom transformers: https://shiki.style/guide/transformers
23+
// Find common transformers: https://shiki.style/packages/transformers
24+
transformers: [],
25+
},
3326
},
34-
site: BASE_URL,
35-
integrations: [sitemap(), tailwind()],
27+
site: "https://travisnorthcutt.com",
28+
integrations: [mdx(), sitemap(), tailwind()],
3629
});

content/blog/archive/3-systems-can-set-grow-business-2014.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)