https://github.com/kjaymiller/render-engine-microblog
MIcroblog custom collection for Render Engine
https://github.com/kjaymiller/render-engine-microblog
render-engine
Last synced: 2 months ago
JSON representation
MIcroblog custom collection for Render Engine
- Host: GitHub
- URL: https://github.com/kjaymiller/render-engine-microblog
- Owner: kjaymiller
- License: mit
- Created: 2023-01-13T06:02:37.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-27T21:20:26.000Z (almost 2 years ago)
- Last Synced: 2024-05-28T07:29:33.866Z (almost 2 years ago)
- Topics: render-engine
- Language: Python
- Homepage: https://kjaymiller.github.io/render-engine-microblog/
- Size: 103 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Render Engine Microblog Parser
This is a parser to create a microblog using Render Engine. This is based on the [`Blog` Custom Collection](https://github.com/kjaymiller/render_engine/blob/main/src/render_engine/blog.py).
This follows the guidance used by [Micro.blog](https://micro.blog) which is to be a post with no title. Slugs by default are the slugified datetime string in `YYYYMMDDHHMMSS` format.
This also create an RSS feed that you can use to syndicate your microblog posts to other services.
Your content is expected to use [render engine's `MarkdownPageParser`](https://github.com/render-engine/render-engine-markdown/edit/main/README.md#quickstart) or a derivative which is markdown with frontmatter. A `date` field is the only required metadata for the page object.
```markdown
---
date: 2023-01-01 12:00:00
---
Hello **World**!
```
## Installation
Install using pypi. If you haven't already, install [`render-engine`](https://pypi.org/project/render-engine/)
```bash
pip install render-engine render-engine-microblog
```
## Usage
### Import the parser and collection
In your render_engine config file import the `MicroBlog` collection class.
```python
from render_engine import Site
from render_engine_microblog import MicroBlog
```
### Create a collection for your site
Create your collection like you would a blog. You will need to pass a `content_path`.
```python
site = Site()
@site.collection
class MicroBlog(MicroBlog):
content_path = "content/microblog"
```