Package: braindead
BraindeadBraindead is a braindead simple static site generator for minimalists, that has support for markdown and code highlighting.
I created this package simply to have a bit of fun and because I'm tired of bloated software.You can read more about the idea behind it onmediumormy blogCan't we just havesimple software nowadaysthat does what it needs to do and nothing more?
Existing solutions felt like they are too much for my needs. So I built this thing. It's still under active development.Live example:grski.plOne of my main ideals here is to create template that is as fast as it gets. Generated pages take around 10-15 KB in total.
No JavaScript used here, at least in the base template. Just css/html.You are free to change that though by creating your own templates. More on that below.Benefits of simple approach:Default template scores 100/100 on Google PageSpeed Insights and has very fast load times.Default template design looks like this:It's based on:Kiss template, slightly modified - with minimized styles. In the future I'll probably slim them down even more.It's also eco friendly - it uses less power by not being a bloatware.CarbonReport of the demoInstallationpip install braindeadPyPi pageUsageCreateindex.mdand runbraindead runthat's it. You'll find your generated site indistdirectory and the site being served atlocalhost:1644.
To get more context/help and available commands runbraindeadorbraindead help.Known commands so far:run,build,serve.It can be empty or not - your choice. If you want index  to contain just the posts - leave it empty.That's the minimal setup you need. That'll generate index.html for you, but well, it's not enough, right?
More robust structure you can use is:pages/page.md
posts/post.md
index.md
pyproject.tomlThe url for generated html will be{DIR_LOCATION}/{FILENAME}.html,
so url generated will be{config.base_url}/{DIR_LOCATION}/{FILENAME}.htmlin order to change that, addSlug: custom-locationTo your post/page header - then the location will be{BASE_URL}/{SLUG}.htmlExample post/page structure:Title: Title of the post or of the page 
Date: 2018-03-22
Authors: Olaf Górski
Description: Description of the post/page. If not provided it'll default to first 140 chars of the content. 

CONTENT GOES HERE...All of the metadata used here will be available during given page rendering. You can add more keys and metadata if you'd like.ConfigAll of the variables that are used to generate the page can be overwritten by creatingpyproject.tomlfile, but it's not required to get started.
Example of yourpyprojecttool.braindead.sitesection (these are also the defaults):[tool.braindead.site]base_url=""# give full url ending with slash here - eg. if you host your blog on https://grski.pl/ enter it there.author="Olaf Górski"# author/owner of the site <- will be appended to the titletitle="Site generated with braindead"# base title of the websitedescription="Just a description of site generated in braindead"# description used in the meta tagscontent=""# this will display under headingname="braindeadsite"# og tagslogo="logo_url"# url to the logo for og tagsheading="Braindead Example"# heading at the top of the sitegithub="https://github.com/grski"# link to your githublinkedin="https://linkedin.com/in/olafgorski"# link to your licopy_text="Olaf Górski"# copy text in the footercopy_link="https://grski.pl"# and copy link of the footerlanguage="en"# default language set in the top level html lang propertyjust_titles=0# if set to 1 the index page will only display titles without descriptions on default templateNone of these are required. You can overwrite none, one or more. Your choice.Code higlightingJust do```python
Your code here
```List of languages supported by pygments can be found here.Creating your own templatesTODOTechnologyThis bases ontoml,markdownandjinja2.Toml is used for configuration.
Markdown to render all the .md and .markdows into proper html.
Lastly jinja2 to add some contexts here and there.Formatting of the code is done usingblack,isort.flake8,autoflakeandbanditto check for potential vulns.Versioning is done withbumpversion.
Patch for merges to develop, minor for merged to master. Merge to master means release to pypi.And wonderfulpoetryas dependency manager. BTW pipenv should die.Code highligthing is done withpygments.CLI is done withcleoI use type hinting where it's possible.To start developing you need to install poetrypip install poetry==0.1.0and then justpoetry install.Known make commandsflake
isort
isort-inplace
bandit
black
linters
bumpversion
black-inplace
autoflake-inplace
format-inplaceMost important ones aremake lintersandmake format-inplace. Before each commit it's required to run these checks.LicenseMIT