muskanmahajan37 / ob

A Blog & RSS system written in Rust based on Luke Smiths LB.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


OB - Oliver's Blog Script

A Blog and RSS system written in Rust.

Features

  • Converts blog entries written in Markdown into HTML.   βœπŸ»
  • Keeps a rolling blog page.   πŸ”Ž
  • Creates entries in the rolling blog page that are easily modifiable with CSS.   πŸš€
  • Updates an rss feed which includes blog posts in full.   πŸ“°
  • One command to delete entries from the RSS feed, rolling blog and standalone entries simultaneously.   πŸ’°
  • Works on MacOS, Linux and Windows.   πŸ–₯
  • Less than 350 lines of code.   πŸ–
  • Blazingly Fast.   πŸ”₯

Installation

Install Rust:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Install ob:

cargo install ob

Setup

You will need to create four files:

  • A Rolling Blog File where the blog entries will be listed.
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Your Blog</title>
    <meta charset="utf-8"/>
  </head>
  <body>
    <h1>Blog Updates</h1>
    <ul>
      <!-- OB -->
    </ul>
  </body>
</html>
  • A Template to be filled out with the content of a blog post.
<!DOCTYPE html>
<html lang="en">
  <head>
    <title></title>
	<meta charset="utf-8"/>
  </head>
  <body>
    <!-- OB -->
  </body>
</html>
  • An RSS feed.
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="rss.css" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blog Title</title>
    <description>Description</description>
    <language>en-us</language>
    <link>https://your_blog.com/rss.xml</link>
    <atom:link href="https://your_blog.com/rss.xml" rel="self" type="application/rss+xml" />

    <!-- OB -->
  </channel>
</rss>
  • A configuration file containing the paths to your blog index, template and rss files.
    It should also include the address of where the blog entries will be hosted, the maximum number of posts on the rss feed and whether to include images or not.
{
    "blog": "index.html",
    "template": "template.html",
    "rss": "rss.xml",
    "items": 4,
    "blog_address": "https://your_blog.com/blog/",
    "images": true
}

Markers

For the system to work, add the following comment line to the Rolling Blog File, the Template and RSS feed (as above).

<!-- OB -->

When you publish a blog post, it will be added directly below that line in the proper format.

Usage

USAGE:
    ob [FLAGS]

FLAGS:
    -d, --delete     Delete a draft
    -h, --help       Prints help information
    -n, --new        Create a new draft
    -p, --publish    Publish a daft
    -V, --version    Prints version information

Example:

ob --new

The first time ob is used it will create a folder at: /blog.

When you create a new draft it will be located at: /blog/drafts.
When you publish a new draft it will be located at: /blog/example.html.

About

A Blog & RSS system written in Rust based on Luke Smiths LB.

License:GNU General Public License v3.0


Languages

Language:Rust 100.0%