ONEPAGE
Overview
A simple static site genertor, convert md posts to html.
- Read markdown files
- Parse md to html by pulldown cmark
- Render into tera template
- styled by picocss and highlightjs
Online demo
Usage
from repo
- clone this repo, and:
cargo run -- buildto build pagescargo run -- serveto build pages, and make a server at localhost
from cargo
cargo install onepageonepage init [dir]: download template files from githubonepage serveonepage buildonepage new {filename}: create new post
Structure
/pages: markdown source fileindex.md=> index page/posts/*.md=> post page/imageimages used in markdown file
/dist: generated site/static: static resources/assets: img/css/font/faviconfavicon files
/templates: html templates/src: rust src
New post
- make a
.mdfile in/pages/posts/ - you can copy from demo md files
- at present, post page must have a fontmatter header, including
title(required),date(required),tags(optional) - or you can use
onepage new {filename}to create new post.
---
title: hello world
date: 2020-03-15 10:54:39
---
---
title: hello world
date: 2020-03-15 10:54:39
tags:
- awesome-tag
- more-awesome-tag
---
Todo
- custom site config file (maybe not)
- generate new page
- live reload
- site initialize to new path
- css style
- add command line
- serve /dist
- watch /pages and rebuild