Skip to main content

Simple hackable static website generator with a focus on minimalism

Project description

Rupantar

No-frills website generation, powered by Python

Code style: black Codacy Badge CodeClimate Maintain. Badge

GitHub issues GitHub closed issues Pull Requests

/ɾuːpɑnˈtɔɾ/ (Bengali)

transformation


Table of Contents 🚩
  1. Description
  2. Dependencies
  3. Installation
  4. Usage
  5. Project Structure
  6. Configuration
  7. Contributing
  8. License

Description :ear_of_rice:

Fork of pidgeotto

Rupantar is a command-line tool that enables quick generation of simple, minimally themed, static websites with extensive support for customizations.

(back to top :arrow_up: )

Dependencies :bridge_at_night:

Rupantar has the following dependencies:

  • PyYAML: Config and setting page metadata
  • tomli: Config and setting page metadata, not required if running Python 3.11 (or above)
  • jinja2: Templating engine used to render the HTML/XML pages
  • markdown2: Reading Markdown files
  • xdg-base-dirs: App-runtime data storage location as per XDG Base Dir spec

(back to top :arrow_up: )

Installation :coconut:

  • Rupantar needs Python installed locally.

    • CPython version compatibility: needs Python interpreter (version 3.10 or higher)
  • pip, Python's default package management tool, can be used for either of the methods.

  • Installation from source:

    • Install Git
    • Clone this git repository
    • cd into the rupantar directory
    • $ pip install -r requirements
      
  • Direct installation using Git:

    • $ pip install git+https://github.com/bhodrolok/rupantar
      

(back to top :arrow_up: )

Usage :crab:

  • NB: Rupantar is a pure CLI tool, without any GUI.

To get a comprehensive list of commands and flags:

$ rupantar -h

To initiate a project ( say for example notun):

$ rupantar init notun
  • NB: Some generic questions will be asked running this command in order to set up some configuration values.
  • To avoid this, pass the -s or --skip flag after init.

To add a new post/page (say for example kagoch, to the existing notun):

$ rupantar new notun kagoch

To build the static pages (for notun):

$ rupantar build notun

To preview the website locally:

$ rupantar serve notun
  • Useful for quick and simple testing via a local HTTP web server.

(back to top :arrow_up: )

Project Structure :fork_and_knife:

The overall skeleton of a fully built & ready-to-serve rupantar project looks something like:

rupantar_project/
    ├── config.yml  <-- Config for the page title, CSS file, and other custom config (custom templates, etc.)
    ├── content/  <-- Directory to store Markdown files.
    │   ├── header.md
    │   ├── footer.md
    │   ├── home.md
    │   └── notes/  <-- Directory to store Markdown files for content of extra pages.
    │       └── example_blog.md
    └──static/  <-- Directory to store static content eg: CSS, images, etc.
    │   └── demo.css
    ├── public/   <-- Directory to store generated static files.
    └── templates/  <-- Directory to store Jinja2 layouts for the pages.
        ├── home_template.html
        ├── note_template.html
        └── feed_template.xml

Rupantar itself is developed with a "src layout" so as to follow a more standardized and organized way of managing everything. To read more about that, click here.

A :construction: roadmap of this Python project can be found here.

(back to top :arrow_up: )

Development & Configuration :plate_with_cutlery:

  • It is recommended to use Poetry for better dependency management, packaging, and release.

    • A big reason is the ease in managing virtual environments.
    • Why consider venvs in the first place? Well you get an isolated environment, better reproducibility, better dependency management, and (most importantly!) minimize risk of any conflicts with other existing Python projects/dependencies locally on the system. Especially if they were installed globally system-wide using pip.
    • Just overall makes the development process more smoother.
  • After forking and cloning the repository:

    • Navigate to the cloned project directory.
    • Install all the dependencies, including the optional ones:
      $ poetry install --with=dev,test,docu
      
    • Activate a virtual env:
      $ poetry shell
      
    • Run rupantar:
      $ python src/rupantar/start.py -h
      

(back to top :arrow_up: )

Contributing :scroll:

This is an open source project. Suggestions, bug reports, feature requests, documentation improvements, etc. are more than welcome through Pull Requests (PRs) and Issues.

The usual steps for contributing via a PR are:

  1. Fork this repository to your own GitHub account

  2. Clone the repository to your machine

$ git clone https://github.com/Bhodrolok/rupantar.git
  1. cd to where you cloned the repo and create a local git branch
$ git checkout -b new-feature-branch
  1. Make your changes and commit them to that branch
$ git commit -m "brief description about changes"
  1. Push your changes to your remote fork
$ git push origin new-feature-branch
  1. Create a new Pull Request!

(back to top :arrow_up: )

License :bookmark:

This project is licensed under the MIT License.

tldr is that rupantar is Free and Open Source Software (FOSS)!

(back to top :arrow_up: )

Similar Projects :goat:

  • pidgeotto - Primary inspiration for this project.
  • Pelican - Python-based
  • Jekyll - Ruby-based
  • Hugo - Go-based
  • Zola - Rust-based
  • Eleventy - JavaScript-based alternative to Jekyll
  • Some more Python-based static site generators can be found here.

(back to top :arrow_up: )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rupantar-0.9.5a0.tar.gz (28.7 kB view details)

Uploaded Source

Built Distribution

rupantar-0.9.5a0-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file rupantar-0.9.5a0.tar.gz.

File metadata

  • Download URL: rupantar-0.9.5a0.tar.gz
  • Upload date:
  • Size: 28.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/10

File hashes

Hashes for rupantar-0.9.5a0.tar.gz
Algorithm Hash digest
SHA256 a6b837352a4e48893b94e6df0683eaf57533605182d9ed06865e27ae4dc9caf3
MD5 0f33d4774f78ac420cc507538ad550b3
BLAKE2b-256 b6687a18b1482809f5c77e49fa29f144f969acba8d0a89bc8a75a07eca31974d

See more details on using hashes here.

File details

Details for the file rupantar-0.9.5a0-py3-none-any.whl.

File metadata

  • Download URL: rupantar-0.9.5a0-py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/10

File hashes

Hashes for rupantar-0.9.5a0-py3-none-any.whl
Algorithm Hash digest
SHA256 856ed3d9e7db20c2fcea62c6cd6e3b7166985150ad48c5fd189586dc57a543fc
MD5 3cd92f316ead80521d77ed16f214bdb4
BLAKE2b-256 c13de90257253b967509252780a014a9e0c606001bdf07894f483cab21175bd3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page