Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jmaczan/xiexie
π Static site generator
https://github.com/jmaczan/xiexie
china chinese rust ssg static-site static-site-generator web xiexie
Last synced: 13 days ago
JSON representation
π Static site generator
- Host: GitHub
- URL: https://github.com/jmaczan/xiexie
- Owner: jmaczan
- Created: 2022-08-14T15:36:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-16T12:44:42.000Z (over 1 year ago)
- Last Synced: 2024-08-13T07:15:45.713Z (3 months ago)
- Topics: china, chinese, rust, ssg, static-site, static-site-generator, web, xiexie
- Language: Rust
- Homepage:
- Size: 65.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Citation: CITATION.cff
Awesome Lists containing this project
- jimsghstars - jmaczan/xiexie - π Static site generator (Rust)
README
# `xiexie θ°’θ°’`
Static site generator δΈͺηιζη½η«ηζε¨## Quick start
If you like learning by example, you can check out a [xiexie blog template](https://github.com/jmaczan/xiexie-blog-template) and play with it to get an intuition. To start you only need to know that the dynamic values are rendered by prefixing with `xiexie::` and each html needs a JSON config file, most of them are more or less copy-paste of another.For a real-world usage of xiexie, you can check my [technical blog](https://maczan.pl/).
## Install
Download xiexie from [releases](https://github.com/jmaczan/xiexie/releases)To use it globally, copy xiexie to `/usr/bin`
## Run
```
xiexie --source path/to/source/directory --target path/to/target/directory
```## Documentation
For each page named i.e. `about`, you create 3 files:
- HTML with content and `xiexie::`-prefixed tags (`about.html`)
- CSS with page specific styles (`about.css`)
- JSON (`about.json`)JSON file needs a specific schema, which is defined below.
### Body tag
This is where content of a `template` is rendered.
```HTML
xiexie::body
```### CSS tag
It is replaced with a `` pointing to a page's CSS file.
```HTML
xiexie::css
```### Aggregation tag
Use aggregations when you want to make copies of some HTML structure multiple times. For example, when you want to render a collection of posts on a blog.
```HTMLxiexie::aggregation:aggregationName::fieldName
```
### JSON configuration schema
This is how your JSON file is structured.A file has a `purpose`. If it's a template for other pages, set it to `template`. If it renders a collection of pages, set it to `aggregator`. If it's a page (like `about.html`), set it to `"page"`.
If a file is a regular page, it needs a `template`. Put a name of a template as a value, i.e. `"blog-post"`.
```py
{
"purpose": "template" | "aggregator" | "page",
"template": templateFileName,
"fields": [
{
fieldFileName: "value of field name"
},
{
anotherFieldFileName: ""
}
],
"aggregations": [
{
aggregationName: [
{
fieldFileName: ""
},
{
anotherFieldFileName: ""
}
]
}
]
}
```## Build
If you don't want to use a released binary version, build xiexie on your own. [Clone](https://github.com/jmaczan/xiexie.git) this repositoryRun `cargo build --release` in a project root directory. You need Rust and Cargo to build it
A binary file will be available in `target/release/xiexie`
## License
Free for personal use. [Email me](mailto:[email protected]) for a commercial license.Β© Copyright [JΔdrzej PaweΕ Maczan](https://maczan.pl/). Made in [Poland](https://en.wikipedia.org/wiki/Poland), 2022