Skip to content
A blog-compiler, to replace chronicle.
Go Shell HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
_demo
_test Added test-coverage for blog_entry. Oct 12, 2019
cmd/ephemeris
.gitignore Ignore generated builds Oct 12, 2019
HACKING.md Better documentation. Oct 12, 2019
LICENSE
MIGRATION.md
README.md Document command-line flag Oct 23, 2019
blog_comment.go Updated fmt.Printf to use the correct count of arguments Oct 23, 2019
blog_comment_test.go
blog_entry.go
blog_entry_test.go Added test-coverage for blog_entry. Oct 12, 2019
go.mod Use the new library. Oct 8, 2019
go.sum
site.go Updated comment to fix linter Oct 23, 2019
site_test.go Added site-test. Oct 12, 2019

README.md

GoDoc Go Report Card license Release

Ephemeris

Ephemeris is a golang application which will generate a blog from a collection of static text-files, complete with:

  • Archive-view.
  • Tag-cloud.
  • RSS feed

The project is very young, and written primarily to generate my own blog, which was previously generated with the perl-based chronicle blog compiler.

The chronicle blog compiler started life as a simple project, but grew in complexity over time. Part of the reason the complexity grew was because the project was very flexible:

  • It would read a whole bunch flat files, each of which contained a single blog-post.
  • Each parsed post would then be inserted into an SQLite database.
  • Using this intermediary database a series of plugins would each execute in turn:
    • The plugins would run SQL-queries to extract posts of interest.
      • For example building a tag-cloud.
      • For example building an archive-view.
      • For example outputting the front-page (10 most recent posts) & associated RSS-feed.
  • Once complete the SQLite database would be destroyed.

My expectation was that the use of an intermediary SQLite database would allow content to be generated in a very flexible and extensible fashion, however over time it became apparant that I didn't need things to be too flexible!

In short this project was born to replace chronicle, and perform the things I actually need, rather than what I suspected I might enjoy.

Chronicle Migration

There are some brief notes on migration available.

Installation

You can install from source, by cloning the repository and runnign:

cd ephemeris/cmd/ephemeris
go build .
go install .

Or you can visit the release page to download a binary.

Blog Generation

The application has only a couple of configuration values, which must be setup in the ephemeris.json file:

    {
      "Posts":    "posts/",
      "Comments": "/comments/",
      "Prefix":   "http://blog.steve.fi/"
    }

Create a suitable file, then run the application with no arguments:

$ ephemeris

The generated output will be placed in the output/ directory. The configuration-keys in the JSON file are:

  • Posts
    • This is the path to the directory containing your blog-posts.
  • Comments
    • This is the path to the directory containing your comments.
    • If this is empty then no comments will be read/inserted into your output
  • Prefix
    • This is the URL-prefix used to generate all links.

There is a command-line flag which lets you specify an alternative configuration-file, if you do not wish to use the default. Run ephemeris -help to see details.

Blog Format

As with chronicle the input to this program is a directory containing a series of blog-posts. Each post will be stored in a single file, with the entry being prefixed by a header containing meta-data.

A sample post would look like this:

Subject: This is my post
Date: DD/MM/YYYY HH:MM
Format: markdown
Tags: foo, bar baz

This is my post

There are a few things to note here:

  • The date MUST be in the specified format.
  • If there is no format: markdown header then the body will be assumed to be HTML.
    • All my early posts were written in HTML.
    • Later I switched to markdown.

Demo Blog

There is a demo-blog contained within this repository; to use it:

cd _demo
ephemeris

This will generate _demo/output/, and you can then serve that via:

cd output/
python -m SimpleHTTPServer 8000

Finally open http://localhost:8000 in your browser

Feedback

This project is not documented to my usual and preferred standard, no doubt it will improve over time.

However there are many blog packages out there, so I expect this project will only be of interest to those wishing to switch from chronicle.

Hacking

Some brief notes on the theme/output generation are available in HACKING.md.

Steve

You can’t perform that action at this time.