bashblog but less
Bashlessblog is a simple static site generator that outputs a blog.
It is a .net port of the excellent bash script bashblog which was originally written by Carlos Fenollosa.
This project aims to take everything that makes bashblog great and apply it to a different workflow. Namely decoupling the editing and publishing process from a remote server and instead having a local first workflow and publishing the output more like a traditional static site generation workflow. Basically I wanted more freedom in text editors, more compatibility with syncing using git, and more cross platform support.
- Install the .NET 8 Runtime on your target platform.
- Create a directory where the blog artifacts will live (config, inputs, outputs, etc.)
- Copy the bashlessblog utility to this directory
- Run the command
bashlessblog init
to initialize the default blog structure - Edit the
.config
file, theGlobalUrl
setting is especially important as this defines the base URL for the blog. I also suggest changing the license to something more permissive like a Creative Commons license. - Run the command
bashlessblog new
to create a new draft in the drafts directory - Edit your new post using your favorite text editor
- Publish the post using
bashlessblog post drafts\title-on-this-line.md
- don't worry the filename will be updated with the title you supplied when you edited the post - Check out your new post in the
output
directory - Publish the contents of the
output
directory to your favorite web host
bashlessblog init
Initializes a new blog structure in the current directory
bashlessblog new [-html] [title]
Creates a new draft in the drafts folder, using commonmark flavored markdown
'-html' overrides the default behavior and creates an HTML draft
'title' will override the default title with the supplied title, the title must be in quotes
bashlessblog edit [filename]
Creates a draft from a published post and depublishes the post
bashlessblog post [filename]
Publishes a draft post to the blog
bashlessblog delete [filename]
Deletes a published post
bashlessblog rebuild [-all]
Regenerates all the pages and posts, preserving the content of the entries
'-all' will regenerate the CSS, title, header, and footer files (caution: custom and edited files will be deleted!)
bashlessblog list
Lists all posts
bashlessblog tags [-n]
Lists all tags in alphabetical order
Use '-n' to sort list by number of posts
For more information and advanced features, please check the comments and configuration options in Config.cs
This project largely maintains compatibility with bashblog and can be used with an existing bashblog blog. The differences are:
- Writing a post is separated into two distinct steps, creating a draft and publishing that draft
- The editing of a draft is an external step and is done outside of the program flow
- Post dates are generated from the embedded timestamps in the post content, this preserves post dates from being mangled when used with git
- The directory structure is organized into inputs and outputs instead of everything being in a single directory
- Social media and third party tracking support is removed
- Removed
reset
command, see:man rm
While I did port the functionality for static pages and personalized headers and body, these features are untested.
To use bashlessblog with an existing bashblog, add the following items to .config
so bashlessblog will use the single directory structure
BackupDir=""
IncludeDir=""
OutputDir=""
CssInclude=('main.css' 'blog.css')
HeaderFile=".header.html"
FooterFile=".footer.html"
- Create three new directories in the bashblog directory
backup
includes
output
- Move any backup archives to the
backup
directory - Move
.footer.html
,.header.html
,.title.html
,blog.css
andmain.css
to theincludes
directory - Combine the contents of
blog.css
andmain.css
into a singleblog.css
, deletingmain.css
- Move everything EXCEPT
bashlessblog(.exe)
and.config
into theoutput
directory
This software is a port of bashblog and uses Markdig for it's markdown support.
Thanks to:
Carlos Fenollosa for creating bashblog
Alexandre MUTEL aka xoofx author of Markdig