Contains an old blog implementation in Racket.
Zelphir Kaltstahl 6314c8eb40 fixed markdown table in readme | 6 éve | |
---|---|---|
blog | 1 éve | |
INSTALL.md | 1 éve | |
LICENSE | 1 éve | |
README.md | 1 éve | |
example-Dockerfile | 1 éve |
Contains an old blog implementation in Racket.
For this to work you will need to install Racket and a few Racket packages which are required by the blog application.
raco pkg install markdown
(for parsing blog posts)raco pkg install yaml
(for reading metadata from .meta files and reading the blog configuration file)raco pkg install pollen
(for pygments binding) (require pollen/unstable/pygments)
raco pkg install gregor
(Gregorian calendar)raco pkg install sha
(for SHA checksum functions which are used for memoization of rendering of blog posts)You will also need pygments
which is used by the blog application to highlight source code in blog posts.
pygments
for pythonconda install pygments
and using the Miniconda Python environment as the default Python environment or activating it before running the blogpip install pygments
Once you got all these dependencies set up, you are ready to run the blog application by running racket server.rkt
inside the blog
directory.
Visit your blog at localhost:8000
.
You will need to install Docker for this to work. I used the Docker community edition for running the blog application as a Docker container. A guide for installing Docker can be found on Digital Ocean.
docker build -t blog .
in the Dockerfile
directory.Dockerfile
to your purposes. The Dockerfile
in this repository is only an example file which shows how to get a Racket application, in this case the blog application, to run inside a Docker container.docker run -d --publish 8000:8000 blog
, where blog
is the name of the Docker image specified when building the image.localhost:8000
.The Dockerfile provided in this repository uses Racket 6.11, but can be changed to use another version by changing version string and SHA256 checksum of the Racket installer appropriately. Of course, should the installer change significantly, it is possible that the subsequent steps inside the Dockerfile need to be adapted to a new installation process as well.
blog/code-highlighting.rkt
.blog/data/posts
.A metadata file document-your-stuff.meta
could look like the following example:
id: 2
title: "Document your stuff"
creation-date: "2017-11-19"
author: "anonymous"
tags: [
"documentation",
"software-development",
"best-practices"
]
An example markdown file document-your-stuff.md
could look like the following example:
# I have a title
I got some fancy text as well!
There is a YAML configuration file in the blog
directory. Here is an overview of what the contained settings do:
Setting | Description | Example values |
---|---|---|
blog-title | the title which is displayed at the top of the blog | "My new awesome Blog" |
time-zone | the timezone which the | "Europe/Berlin" |
blog-language | the lang attribute in the DOM of the rendered blog |
"en" |
posts-per-page | maximum number of posts to display on a blog page | 4 |
max-posts | maximum number of posts to render | null (for no limitation), 10 |
min-date | minimum datetime for a post to be rendered | 2000-01-01T00:00:00+01:00 |
render-post-separators | whether or not to render separators between posts on one blog page | true , false |
render-post-metadata | whether or not to render metadata of posts | true , false |
render-post-toc | whether or not to render table of contents for posts | true , false |
render-post-content | whether or not to render post contents | true , false |
min-date
at all or only use time-zone
from config and discard timezone from min-date