Skip to content

Commit fbf62ca

Browse files
authored
Merge pull request #19 from powdr-labs/update-readme
Update readme
2 parents 8f198f1 + 3d0f689 commit fbf62ca

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Powdr Labs Website
22

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`.
32+
333
## Installation
434

535
```bash

0 commit comments

Comments
 (0)