This project serves blog posts using the built-in http module provided by the NodeJS standard library. In addition, it parses markdown files to provide page styling and supports a tags for organizing posts. Strlog uses its own github repository as a content repository. When setup with a CI pipeline, publishing a post is as simple as pushing a git commit.
- Pull a release from the release branch. This branch is updated with features but purged of my own personal posts.
- Unzip the archive.
- Navigate to the root directory and run
npm start
. The server will default to port 5000. Unit tests can be run withnpm test
.
- update or remove tests
- refactor: better interface between server.js and format.js
- refactor: pack globals into object
- refactor: better text replace method in format.js
- full markdown parsing
Markdown parsing is an audacious claim for what is really just a series of regex string manipulations. It is not possible to fully cover the mardown spec this way because it is not context-aware. Sufficiently complex Markdown will break the "parser". Someday I'd love to take the time to write a real one.
The repository contains the following important directories:
./posts
: holds directories titled with the date in ISO 8601 format representing a single blog post each. Two files are required:resources
: holds template html files, the favicon, an icon for link embeds, and the CSS file.src
: source code, split roughly into routing / file reading (server.js
) and markdown parsing / html building (format.js
).test
: holds the unit tests.