barely is a lightweight, but highly extensible static site generator written in pure python.

Overview

Contributors Forks Stargazers PyPI - Downloads PyPI Issues barely test Lines of code MIT License Website


barely

barely is a lightweight, but highly extensible static site generator.
Explore the docs »

Quickstart · See available Plugins · Report Bug · Request Feature

  1. About barely
  2. Quickstart
  3. Usage
  4. Roadmap
  5. Contributing
  6. Built with & Inspired by
  7. License
  8. Contact
  9. Changelog

barely has a website now!

see it here: buildwithbarely.org - of course also built with barely!

Demo

Short demo of barely's live reloading capabilities:

barely live demo gif

About barely

barely was built out of frustration with the readily available site generators, frameworks and CMS, which mostly fall into two categories: not providing crucial features; or providing such an overload of them that getting started with the system takes longer than just building the site by hand.

barely reduces static website development to its key parts, by automatically rendering jinja2 templates and Markdown content into HTML. A simple plugin interface allows for easy extensibility, and the built-in live web server makes on-the-fly development as comfortable as possible.

Since building performant and SEO-friendly websites is always important, barely comes bundled with a Google Lighthouse CLI option, letting you quickly generate reports about your sites health.

For more on barely's design philosophy, and to see whether barely might be right for your project, see here in the docs.

Quickstart

Good news: Getting started with barely is super easy! So we will keep this quick. For more info on Getting Started, see this page in the docs.

Prerequisites

Make sure you have python >= 3.9 installed:

$ python -V
Python 3.9.x

(On Windows: py -V)

It is highly recommended to create a virtual environment for barely, otherwise some parts may not work:

$ python -m venv .venv
$ . .venv/bin/activate
(.venv) $

(On Windows: py -m venv .venv and .venv\Scripts\activate)

Installation

Now, simply install barely like any other package:

(.venv) $ pip install barely

(On Windows: py -m pip install barely)

That's it! Congrats!

Usage

Basics

Now let's get familiar with using barely!

  1. Create a new project with barely new:

    $ barely new
    [barely][  core][ INFO] :: setting up new project with parameters:
                            ->   webroot: webroot
                            ->   devroot: devroot
                            -> blueprint: default
    [barely][  core][ INFO] :: setting up basic config...
    [barely][  core][ INFO] :: done.

    Sweet! barely created two new subdirectories, devroot and webroot. The project was also created with a blueprint, namely default, which is why our devroot is not empty. We will learn about blueprints in a second.

  2. Now let's build the project!

    $ cd devroot
    $ barely rebuild
    [barely][  core][ INFO] :: registering plugins...
    [barely][  core][ INFO] :: 7 plugins registered.
    [barely][  core][ INFO] :: rebuilding devroot...
                            -> deleted /[...]/webroot
    [barely][  core][ INFO] :: event at /[...]/devroot/template.md
                            -> rendered, highlighted /[...]/devroot/template.md -> /[...]/webroot/index.html
    [barely][  core][ INFO] :: rebuild complete.
    [barely][  core][ INFO] :: Finalizing plugin ReadingTime...
    [barely][  core][ INFO] :: Finalizing plugin ToC...
    [barely][  core][ INFO] :: Finalizing plugin AutoSEO...
    [barely][  core][ INFO] :: Finalizing plugin Highlight...
    [barely][  core][ INFO] :: Finalizing plugin Forms...
    [barely][  core][ INFO] :: Finalizing plugin Minify...
    [barely][  core][ INFO] :: Finalizing plugin Gallery...
    [barely][  core][ INFO] :: ..
                            -> Do you want to Publish / Backup / do both?
                            -> *[n]othing | [p]ublish | [b]ackup | [Y]do both :: n
    [barely][  core][ INFO] :: exited.

    And then start the live server:

    $ barely
    [barely][  core][ INFO] :: registering plugins...
    [barely][  core][ INFO] :: 7 plugins registered.
    [barely][  core][ INFO] :: started tracking...

    Your favorite browser should open, and you will be greeted with the rendered version of template.md.

    We could also have combined those two steps with the -s flag like this: barely rebuild -s, to start the live server immediately after rebuilding.

    Now is a good time to play around a bit with your sample project - make some changes to the contents, the templates or add a stylesheet and watch the page update in real time!

    For a more thorough explanation, make sure to check out Getting Started in the docs!

Core Mechanics

There are a couple of things that are important to know about how barely works. If you've used similar frameworks before, you'll probably already be familiar with most of these things. barely doesn't try to reinvent the wheel.

  • the structure of your site is defined in jinja2 templates. By default, these are stored in the templates/ folder
  • you write the contents of your pages with Markdown
  • each page can individually be configured using YAML notation
  • global level configuration of barely happpens in the config.yaml file, global variables to be used in your templates are stored in metadata.yaml

This just scratches the surface; please, do yourself a favor and read the Detailed Overview in the docs.

Modular Pages

Pages can be modular, meaning they contain subpages with their own contents and templates. To define a modular page, simply put the "modular" argument into that pages configuration:

---
title: My Parent Page
modular:
  - about
  - services
  - contact
---

To see how, when, and why to use them, see here: Modular Pages

Plugins

barely offers rather limited functionality on its own: "use some templates to render some contents into static HTML files". That's it.

But most of the time, you will want at least a little more functionality. That's where plugins come in!

barely comes with 10 plugins by default:

For more information on how to enable and configure a plugin, click on its respective name.

To learn how to install new plugins or write your own, see the Plugins page in the docs.

Blueprints

Back in the Basics, we have already briefly covered blueprints. They are pretty much exactly what you would expect: re-usable project templates that you can instantiate into new projects. Other frameworks might call them themes.

You can list all available blueprints with:

$ barely blueprints
[barely][  core][ INFO] :: found 2 blueprints:
                        -> default
                        -> blank

To learn how to create and use your own blueprints, see Blueprints in the docs.

Roadmap

barely is currently released as version 1.0.0. That means that while everything works and the project is feature complete (in regards to its initial vision), there are still a lot of improvements to be made. The current wishlist is:

  • performance improvements. barely is fast enough for every-day use, but not exactly optimized. The biggest performance win could probably be made by letting barely interact with a model of the current project, instead of constantly opening / closing the same files. That's a major rework though, and maybe something for version 2.0.0...

  • a good demo blueprint, showcasing all of barelys features and plugins

  • the docs could use some love :)

Contributing

Contributors are highly appreciated! Check out CONTRIBUTING.md for more info!

If you have written a plugin or created a blueprint and think others might benefit, please do create a pull request!

Built With & Inspired By

This project would not have been possible without a lot of amazing FOSS projects. Most notable are:

barely simply stitches them togehter in an exciting manner.

The various inspirations for barely should also not stay concealed:

  • flask doesn't need an introduction
  • grav is probably the closest (spiritual) relative

License

Distributed under the GNU General Public License. See LICENSE for more information.

Contact

Telegram: @smiletolerantly - [email protected]

Official Website Link: https://buildwithbarely.org Github Project Link: https://github.com/charludo/barely

Changelog

Most recent entry:

[1.0.4] - 2021-09-06

Added

  • "--desktop" flag for lighthouse (default is mobile)

Fixed

  • autoSEO: no longer crashes when no image can be found; ignores modular subpages
  • pixelizer: save original image without blowing up its size
  • minify: configuring minify no longer disables it
  • toc: don't generate tocs for modular subpages
  • highlight: regex non-greedy, previously wrong behaviour when multiple code blocks on a page; eliminated duplicate stylesheet generation

Changed

  • enabled git plugin by default
  • higher resilience against errors (non-critical errors get logged instead of excepted)
  • autoSEO: use site_name as fallback for title
  • highlight: accepts more conventional / markdown-style lexer notation; un-escape code before highlighting
  • collections: category & overview pages now passed through enabled plugins; use summary as preview, if it exists; preview-image does no longer have to be in the same directory

See the full changelog here

You might also like...
a static website generator to make beautiful customizable pictures galleries that tell a story
a static website generator to make beautiful customizable pictures galleries that tell a story

Prosopopee Prosopopee. Static site generator for your story. Make beautiful customizable pictures galleries that tell a story using a static website g

A static website generator for people who enjoy the simpler things in life.

A static website generator for people who enjoy the simpler things in life.

Hobby Project. A Python Library to create and generate static web pages using just python.

PyWeb 🕸️ 🐍 Current Release: 0.1 A Hobby Project 🤓 PyWeb is a small Library to generate customized static web pages using python. Aimed for new deve

The lektor static file content management system
The lektor static file content management system

Lektor Lektor is a static website generator. It builds out an entire project from static files into many individual HTML pages and has a built-in admi

Makes dynamic linked shit "static". Amazing

static.py What does it do? You give it a dynamically linked binary and it will make a directory that has all the dependencies (recursively). It also f

A declarative website generator designed for high-quality websites, with a focus on easy maintenance and localization.

Grow Grow is a declarative tool for rapidly building, launching, and maintaining high-quality static HTML. Easy installation Jinja template engine Con

A Python media index

pyvideo https://pyvideo.org is simply an index of Python-related media records. The raw data being used here comes out of the pyvideo/data repo. Befor

A python-based static site generator for setting up a CV/Resume site
A python-based static site generator for setting up a CV/Resume site

ezcv A python-based static site generator for setting up a CV/Resume site Table of Contents What does ezcv do? Features & Roadmap Why should I use ezc

Simple, lightweight, and magic-free static site/blog generator for Python coders

makesite.py Take full control of your static website/blog generation by writing your own simple, lightweight, and magic-free static site generator in

AutoLoader is a plugin for Pelican, a static site generator written in Python.

AutoLoader AutoLoader is a plugin for Pelican, a static site generator written in Python. AutoLoader is designed to autoload the other Pelican plugins

Scan Site -       Tools For Scanning Any Site and Get Site Information
Scan Site - Tools For Scanning Any Site and Get Site Information

Site Scanner Tools For Scanning Any Site and Get Site Information Example Require - pip install colorama - pip install requests How To Use Download Th

Django-static-site - A simple content site framework that harnesses the power of Django without the hassle

coltrane A simple content site framework that harnesses the power of Django with

Static site generator that supports Markdown and reST syntax. Powered by Python.

Pelican Pelican is a static site generator, written in Python. Write content in reStructuredText or Markdown using your editor of choice Includes a si

Static site generator that supports Markdown and reST syntax. Powered by Python.

Pelican Pelican is a static site generator, written in Python. Write content in reStructuredText or Markdown using your editor of choice Includes a si

Static site generator for designers. Uses Python and Django templates.

News Cactus 3 is out! We're happy to announce Cactus 3. It brings a set of great new features like asset fingerprinting, an asset pipeline, pretty url

Kaktos is a python static site generator
Kaktos is a python static site generator

Python static site generator κάκτος Kaktos is a python static site generator. The idea is create a simple static site generator for people that don't

Robust, highly tunable and easy-to-integrate in-memory cache solution written in pure Python, with no dependencies.

Omoide Cache Caching doesn't need to be hard anymore. With just a few lines of code Omoide Cache will instantly bring your Python services to the next

A simple static site generator with deployment to S3/Cloudfront.

Stasis A simple static site generator with deployment to S3/Cloudfront. Features Stasis is a static website generator written in Python, using Pandoc

dirmaker is a simple, opinionated static site generator for quickly publishing directory websites.
dirmaker is a simple, opinionated static site generator for quickly publishing directory websites.

dirmaker is a simple, opinionated static site generator for publishing directory websites (eg: Indic.page, env.wiki It takes entries from a YAML file and generates a categorised, paginated directory website.

Comments
  • no blueprint named default exists

    no blueprint named default exists

    Describe the bug Error while running barely new

    To Reproduce Steps to reproduce the behavior:

    (.venv) ➜  barely-test pip install barely
    (.venv) ➜  barely-test barely        
    [barely][  core][ERROR] :: could not find 'config.yaml'. Exiting
    (.venv) ➜  barely-test barely new
    [barely][  core][ERROR] :: no blueprint named default exists.
    

    Expected behavior

    $ barely new
    [barely][  core][ INFO] :: setting up new project with parameters:
                            ->   webroot: webroot
                            ->   devroot: devroot
                            -> blueprint: default
    [barely][  core][ INFO] :: setting up basic config...
    [barely][  core][ INFO] :: done.
    

    Desktop (please complete the following information):

    ➜  lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 20.04.3 LTS
    Release:        20.04
    Codename:       focal
    

    WSL2

    opened by amalshaji 8
  • Feature minimizer rework

    Feature minimizer rework

    Removed old Minimizer plugin, replaced it with "Minify" (for sass & js) and "Pixelizer" (automatic multi-size webp generation & replacement by )

    opened by charludo 0
Releases(v1.1.4)
  • v1.1.4(Apr 7, 2022)

  • v1.1.2(Apr 5, 2022)

    [1.1.2] - 2022-04-05

    Added

    • "publish: false" in a page can disable rendering of a page. Can also be used as a global toggle
    • Collections: added ORDER_KEY and ORDER_REVERSE options. Can be used to configure the order of posts within collection pages.

    Changed

    • Collections: "created" timestamps take precedence over "edited" timestamps
    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Apr 3, 2022)

    [1.1.0] - 2022-04-03

    Added

    • Collections: the OVERVIEW_CONTENT field allows to specify a markdown file to be used for the Collection overview page's content

    Fixed

    • no longer ignores "meta" fields already set on a page. Previously they were overridden in the meta parsing process
    • Collections: if a page belonging to a collection was not modified after a rebuild, it would not be passed through the plugin pipeline. Among other side effects, this did not allow for Timestamp- and ReadingTime-integration for post previews
    • Timestamp: no longer panics if a file vanishes
    • ToC: indented ToC HTML was not accessibility friendly

    Changed

    • ReadingTime: if the plugin was configured with WPM_FAST and WPM_SLOW values being identical, or if the text was very short, the fast and slow estimate could be identical. In this case, the plugin now simply shows "0" instead of "0 - 0" (for example)
    • the "content_raw" field utilized by some plugins now only contains the unparsed markdown content, where previously it also included the yaml headers
    Source code(tar.gz)
    Source code(zip)
  • v1.0.5(Feb 23, 2022)

    [1.0.5] - 2022-02-23

    Fixed

    • autoSEO: fixed double "/" issue in image URLs

    Changed

    • silently ignores FileNotFound errors instead of throwing an exception, since usually, a temp file is at fault

    [1.0.4] - 2021-09-06

    Added

    • "--desktop" flag for lighthouse (default is mobile)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.4(Sep 6, 2021)

    [1.0.4] - 2021-09-06

    Added

    • "--desktop" flag for lighthouse (default is mobile)

    Fixed

    • autoSEO: no longer crashes when no image can be found; ignores modular subpages
    • pixelizer: save original image without blowing up its size
    • minify: configuring minify no longer disables it
    • toc: don't generate tocs for modular subpages
    • highlight: regex non-greedy, previously wrong behaviour when multiple code blocks on a page; eliminated duplicate stylesheet generation

    Changed

    • enabled git plugin by default
    • higher resilience against errors (non-critical errors get logged instead of excepted)
    • autoSEO: use site_name as fallback for title
    • highlight: accepts more conventional / markdown-style lexer notation; un-escape code before highlighting
    • collections: category & overview pages now passed through enabled plugins; use summary as preview, if it exists; preview-image does no longer have to be in the same directory
    Source code(tar.gz)
    Source code(zip)
  • v1.0.3(Sep 1, 2021)

    [1.0.3] - 2021-09-01

    Fixed

    • faulty system blueprints path made barely unable to find any bleuprints

    Changed

    • to ensure at least somewhat "unique" alt-tags in galleries, include the number-position of the image in the gallery
    • original/fallback images will no longer be processed by PIL in the Pixelizer plugin, but rather just be copied; their filesizes got blown up before, and the step was needless anyways
    Source code(tar.gz)
    Source code(zip)
  • v1.0.2(Aug 27, 2021)

    [1.0.2] - 2021-08-27

    Changed

    • clean up raw_content before AutoSummary consumes it

    Fixed

    • robots.txt no longer weirdly indented
    • sitemap generation now works after fixing a typo (hmtl -> html)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Aug 26, 2021)

    [1.0.0] - 2021-08-26

    Added

    • lighthouse CLI integration
    • AutoSEO plugin
    • AutoSummary plugin
    • Gallery plugin
    • Minify plugin
    • Pixelizer plugin
    • global -d debugging-flag
    • this changelog!

    Changed

    • moved from BETA to STABLE
    • switched version numbering scheme from v_095 to more readable v1.0.0
    • proper logging instead of print()
    • simplified the default blueprint to make it more usable

    Fixed

    • various small performance improvements, largely due to eliminating duplicate function calls

    Removed

    • Minimizer plugin, obsolete thanks to Minify and Pixelizer
    Source code(tar.gz)
    Source code(zip)
Owner
null
Simple, lightweight, and magic-free static site/blog generator for Python coders

makesite.py Take full control of your static website/blog generation by writing your own simple, lightweight, and magic-free static site generator in

Sunaina Pai 1.7k Jan 1, 2023
AutoLoader is a plugin for Pelican, a static site generator written in Python.

AutoLoader AutoLoader is a plugin for Pelican, a static site generator written in Python. AutoLoader is designed to autoload the other Pelican plugins

null 2 Nov 7, 2022
Static site generator that supports Markdown and reST syntax. Powered by Python.

Pelican Pelican is a static site generator, written in Python. Write content in reStructuredText or Markdown using your editor of choice Includes a si

Pelican dev team 11.3k Jan 4, 2023
Static site generator for designers. Uses Python and Django templates.

News Cactus 3 is out! We're happy to announce Cactus 3. It brings a set of great new features like asset fingerprinting, an asset pipeline, pretty url

null 3.4k Jan 1, 2023
Kaktos is a python static site generator

Python static site generator κάκτος Kaktos is a python static site generator. The idea is create a simple static site generator for people that don't

Paulo Coutinho 4 Sep 21, 2022
A simple static site generator with deployment to S3/Cloudfront.

Stasis A simple static site generator with deployment to S3/Cloudfront. Features Stasis is a static website generator written in Python, using Pandoc

Scott Czepiel 56 Sep 29, 2022
dirmaker is a simple, opinionated static site generator for quickly publishing directory websites.

dirmaker is a simple, opinionated static site generator for publishing directory websites (eg: Indic.page, env.wiki It takes entries from a YAML file and generates a categorised, paginated directory website.

Kailash Nadh 40 Nov 20, 2022
Simple Static Site Inductor Made in Python

sssimp ?? Simple Static Site Inductor Made in Python How to use Create a folder called input, inside create a folder called content and an empty file

Tina 11 Oct 9, 2022
A Python Static Website Generator

Version 0.8.9 Overview Hyde starter kit by merlinrebrovic is a really nice way to get started with hyde. Hyde layout for bootstrap by auzigog is also

Hyde - Static Website Generator 1.6k Jan 1, 2023
A static website and blog generator

Nikola, a Static Site and Blog Generator In goes content, out comes a website, ready to deploy. Why Static Websites? Static websites are safer, use fe

Nikola, a static site generator 2.4k Jan 5, 2023