rublog /rʌblɑg/ is a static blog generator written in Rust

Overview

README

Table of contents generated with markdown-toc

the Chinese version: 中文

About rublog

rublog /rʌblɑg/ is a static blog generator written in Rust, which implements the following functions:

  • Convert markdown to html via pulldown cmark
  • Use toml-rs to implement article properties similar to YAML Front Matter, see [TOML Front Matter](#TOML Front Matter)
  • Implement html template rendering of Django template language through tera
  • Currently using web_server to preview the site (consider rewriting)

[View our development plan] (#development plan).

demo DEMO

My blog: https://candlest.github.io/

demo

Install

Currently not packaged, it can be installed from source code.

in the future ;-)

That is, get the source code from release or directly git clone, and use cargo build --release to compile. After the compilation is complete, add the binary file to the environment variable and use it from the command line. Here is an example for linux:

git clone https://github.com/Candlest/rublog.git
cd ./rublog
cargo build --release
sudo cp ./target/release/rublog /usr/bin/rublog

use

Initialize from rublog-template

We can initialize our project from rublog-template, please see its README for details, so I won’t go into details here.

git clone https://github.com/Candlest/rublog-template.git

rublog command

The help list can be obtained through rublog help or rublog

Build the /public directory: rublog build

Clean up the /public directory: rublog clear

Run from the /public directory: rublog run

Lazy package: clear, build, run in one go: rublog cbr

If you have used hexo, then rublog is very easy to use, because the rublog command is inspired by hexo.

Publishing the web page

The /public directory is the root directory of the generated website, just upload it.

This design is also inspired by hexo.

Development Plan

Since Candlest is preparing for the Chinese college entrance examination in 2024, the development progress is likely to be delayed.

TOML Front Matter related:

  • TOML Front Matter default handling
  • More TOML Front Matter
  • Generate default TOML Front Matter via command line arguments
  • Sort articles by TOML Front Matter, and index articles by tags

Plugins and Extensibility:

  • Use config.toml to manage webpage related parameters
  • Build a plugin management system and use the plugin management system to add gitalk, highlight.js, etc.
  • Build a theme management system and create default themes

Code related:

  • Seriously write error handling instead of unwarp().
  • Write a server implementation that can meet the needs of the blog, or find a library that is both lightweight and high-performance
  • Organize projects and learn the project format of crates.io

Documentation related:

  • Generate list of contributors using GitHub Action
  • Disassemble README

TOML Front Matter

Currently, there are two TOML Front Matter formats: Post and Page.

#[derive(Serialize, Deserialize, Debug)]
pub struct Post {
     title: String,
     datetime: Datetime,
     tags: Vec<String>,
     category: String,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct Page {
     title: String,
}

We can set the properties of the markdown document through TOML Front Matter and access them through the tera templating language.

relevant

  • ONEPAGE gave me great inspiration, especially the part of rendering templates.
  • Hexo, as a static blog generator with both scalability and ease of use, cultivated my user habits and gave me inspiration for command line design.
  • I refer to a lot of information on the Internet, and I will explain the main parts in my Development Record.

Contributors

@Candlest

Any contributions are welcome!

license

This project uses MIT License open source.

You might also like...
Sūshì is a simple but customizable static site generator / blog generator written in Rust

sūshì Sūshì is a simple but customizable static site generator / blog generator written in Rust. Installation Install with Cargo (Recommended) cargo i

Rust-blog - Educational blog posts for Rust beginners

pretzelhammer's Rust blog 🦀 I write educational content for Rust beginners and Rust advanced beginners. My posts are listed below in reverse chronolo

A minimal and flexible blog generator based on GitHub Gists.
A minimal and flexible blog generator based on GitHub Gists.

gisture Utilizing GitHub Gists as a Blogging Platform A minimal and flexible blog generator based on GitHub Gists with SEO, Templating, Syntax Highlig

Static site generator written in Rust
Static site generator written in Rust

Sedum is a static site generator written in Rust. It can be used locally or with a service like Netlify to generate websites on the fly. Usage Local P

A hypersonic static-site generator written in Rust. 🚀 💊 🔥
A hypersonic static-site generator written in Rust. 🚀 💊 🔥

MANDY 🚀 💊 🔥 A hypersonic static-site generator written in Rust. 🚀 💊 🔥 ABOUT 📚 Mandy is fast, easy to use, easy to deploy, and very flexible! Ge

Docker images for compiling static Rust binaries using musl-libc and musl-gcc, with static versions of useful C libraries. Supports openssl and diesel crates.

rust-musl-builder: Docker container for easily building static Rust binaries Source on GitHub Changelog UPDATED: Major updates in this release which m

serve a static site, single page application or just a static file with Rust
serve a static site, single page application or just a static file with Rust

cargo-server tl;dr: Does the same as "python -m http.server" or "npx serve" but for Rust ecosystem. cargo-server helps you serve a static site, single

Serve a static site, single page application or just a static file with Rust
Serve a static site, single page application or just a static file with Rust

cargo-server tl;dr: Does the same as "python -m http.server" or "npx serve" but for Rust ecosystem. cargo-server helps you serve a static site, single

Hot reload static web server for deploying mutiple static web site with version control.

SPA-SERVER It is to provide a static web http server with cache and hot reload. 中文 README Feature Built with Hyper and Warp, fast and small! SSL with

Static Web Server - a very small and fast production-ready web server suitable to serve static web files or assets
Static Web Server - a very small and fast production-ready web server suitable to serve static web files or assets

Static Web Server (or SWS abbreviated) is a very small and fast production-ready web server suitable to serve static web files or assets.

⚡ A Blazingly-Fast Static Site Generator, built with Rust.
⚡ A Blazingly-Fast Static Site Generator, built with Rust.

Stuart A Blazingly-Fast Static Site Generator. Download Now » Stuart is a very fast and flexible static site generator, with build times as low as 0.1

Kurzlink is a simple static site generator built in rust

kurzlink What is kurzlink? Kurzlink is a simple static site generator built in rust.

A fast static site generator in a single binary with everything built-in. https://www.getzola.org

zola (né Gutenberg) A fast static site generator in a single binary with everything built-in. Documentation is available on its site or in the docs/co

static site generator from markdown files.

Mdblog Static site generator from markdown files with features: TeX style math support file path is the post url file name is the post title post can

A fast static site generator in a single binary with everything built-in. https://www.getzola.org

zola (né Gutenberg) A fast static site generator in a single binary with everything built-in. Documentation is available on its site or in the docs/co

the best static site generator

the best static site generator you've ever seen

An ultra simple static site generator designed to appeal to technical as well as non technical users.

Hulk is an ultra simple static site generator designed to appeal to both technical and non technical users.

Oinky - A blazing fast, data-oriented static site generator.

Oinky Oinky is a static site generator, written in Rust, that compiles Handlebars templates and Markdown files into a static site. Oinky also enables

A file format-agnostic static site generator

mksite A file format-agnostic static site generator Installation If you already have Rust and Cargo installed: cargo install mksite Alternatively, you

Comments
  • Native Preview cannot access non-text files

    Native Preview cannot access non-text files

    Every time it read favicon.ico you will get an error:

    thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: 
    Error { kind: InvalidData, message: "stream did not contain valid UTF-8" }', 
    src/options/server.rs:43:99
    

    solution: usebase64 or HTTP 's body to send file

    opened by Candlest 0
Owner
stays most of the time in schools where computers are not available. Probably only after the college entrance examination will I have time.
null
Static site generator written in Rust

Sedum is a static site generator written in Rust. It can be used locally or with a service like Netlify to generate websites on the fly. Usage Local P

Elly 1 Jan 5, 2022
A hypersonic static-site generator written in Rust. 🚀 💊 🔥

MANDY ?? ?? ?? A hypersonic static-site generator written in Rust. ?? ?? ?? ABOUT ?? Mandy is fast, easy to use, easy to deploy, and very flexible! Ge

✭ ANGEL DOLLFACE ✭ 5 Jun 30, 2023
serve a static site, single page application or just a static file with Rust

cargo-server tl;dr: Does the same as "python -m http.server" or "npx serve" but for Rust ecosystem. cargo-server helps you serve a static site, single

Raphael Amorim 18 Oct 14, 2022
Serve a static site, single page application or just a static file with Rust

cargo-server tl;dr: Does the same as "python -m http.server" or "npx serve" but for Rust ecosystem. cargo-server helps you serve a static site, single

Raphael Amorim 18 Oct 14, 2022
A fast static site generator in a single binary with everything built-in. https://www.getzola.org

zola (né Gutenberg) A fast static site generator in a single binary with everything built-in. Documentation is available on its site or in the docs/co

Zola 10.1k Jan 5, 2023
static site generator from markdown files.

Mdblog Static site generator from markdown files with features: TeX style math support file path is the post url file name is the post title post can

Fu 51 Dec 6, 2022
the best static site generator

the best static site generator you've ever seen

Anirudh Balaji 14 Jan 24, 2022
An ultra simple static site generator designed to appeal to technical as well as non technical users.

Hulk is an ultra simple static site generator designed to appeal to both technical and non technical users.

Bilal Tariq 1 Dec 27, 2021
A file format-agnostic static site generator

mksite A file format-agnostic static site generator Installation If you already have Rust and Cargo installed: cargo install mksite Alternatively, you

Michelle S. 5 Nov 25, 2022
😋 Make your own blog!

Leven Leven is a lightweight Markdown-based static site generator for blogs. It's a lot like Jekyll or Hugo, but it's much simpler, much faster, and m

null 55 Oct 6, 2022