GithubHelp home page GithubHelp logo

muskanmahajan37 / ob Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oliverbrotchie/ob

1.0 0.0 0.0 41 KB

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

License: GNU General Public License v3.0

Rust 100.00%

ob's Introduction


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.

ob's People

Contributors

oliverbrotchie avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.