You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+30
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,35 @@
1
1
# Powdr Labs Website
2
2
3
+
## Adding posts
4
+
5
+
You can write blog posts in Extended Markdown (`.mdx`) format nicely. Create a `.mdx` file under `data/blog`. The file name will be the slug of the post. E.g. if you create `my-blog-post.mdx` the post will be at `powdr.org/blog/my-blog.post.mdx`. Alternatively you can create a folder `/my-blog-post` and add an `my-blog-post/index.mdx`.
6
+
7
+
Easisest is to check out some examples. See https://tailwind-nextjs-starter-blog.vercel.app/ for example posts. Source code of the posts are [here](https://github.com/timlrx/tailwind-nextjs-starter-blog/tree/main/data/blog).
8
+
9
+
The part above the `.mdx` file is called a "frontmatter":
10
+
11
+
```
12
+
---
13
+
title: Deriving the OLS Estimator
14
+
date: '2020-12-21'
15
+
draft: false
16
+
summary: 'How to derive the OLS Estimator with matrix notation and a tour of math typesetting using markdown with the help of KaTeX.'
17
+
layout: PostBanner
18
+
bibliography: references-data.bib
19
+
authors: ['default', 'sparrowhawk']
20
+
images: ['/static/images/canada/mountains.jpg']
21
+
---
22
+
```
23
+
24
+
Each post must contain a `title` and a `date`, rest is optional.
25
+
26
+
Some additional notes about blog posts:
27
+
28
+
- you can set `draft:true` to see it in your developement environment but not publish it.
29
+
- The default author is "Powdr Labs", you can add additional authors in `data/authors` and refer them in `authors` in the frontmatter.
30
+
- The default post layout is `PostLayout`. You can see the layouts in directory `layouts/`.
31
+
To have a post with a banner image use `layout: PostBanner` and add images (typically only one image) in `images: ['/static/images/canada/mountains.jpg']`. The images should be under the directory `public/static`.
0 commit comments