Sign inSign up

suckowbiz/simplepast

By suckowbiz

•Updated 3 months ago

SimplePast is a HTML/CSS/JavaSript based framework to publish a weblog on the World Wide Web.

Image
0

1.1K

suckowbiz/simplepast repository overview

⁠SimplePast

CI/CD Status License

SimplePast is a HTML/CSS/JavaSript based framework to publish a weblog on the World Wide Web.

It comes with a CLI called articlectl to create file based news posts.

⁠Features

The intention to implement SimplePast was to have a weblog that is easy to maintain and to setup. Further it should be able to run for months/years without relevant need for changes. This is achieved by:

  • Lean architecture to apply KISS.
  • Convention-over-configuration to keep configuration simple.
  • Relying on containerized infrastructure to isolate the framework and package all requirements.
  • File based storage to avoid database maintenance.
  • Vanilla JavaScript and no external JS frameworks to keep the dependencies low.
  • A handfull of freely available (MIT licensed) libraries to not reinvent the wheel.
  • Semantic Versionning to enable a transparent release process.

⁠How it Works

SimplePast publishes text entries (articles) together with multimedia files such as images and/ or videos. Articles are displayed in reverse chronological order so that the most recent post appears first, at the top of the web page. Articles are grouped in years.

SimplePast runs in a Docker container, based on Caddy webserver. It mounts a configuration file to set up properties and an article folder that contains all postings.

JavaScript is executed on the client side, only. The client requests meta information from the server. This information is made available via JSON files.

⁠Basic Usage

Steps, to configure and run SimplePast:

  1. Create a configuration file to set up SimplePlast:

    $ wget https://raw.githubusercontent.com/suckowbiz/simplepast/main/blueprints/config.json
    
  2. Create a local file storage as a root for articles. Consider current year as initial article folder:

    $ mkdir --parent articles/2023
    
  3. Bootstrap the first article to have content to display:

    $ docker run \
        --tty \
        --user $(id -u):$(id -g) \
        --volume $PWD/articles:/articles \
        suckowbiz/articlectl bootstrap /articles/2023/1
    
    $ .
      └── articles
          └── 2023
              └── 1
                  ├── content.txt
                  ├── date.txt
                  ├── heading.txt
                  ├── img
                  └── vid
    
  4. Provide news content to customize the bootstrapped article:

    $ vi articles/2023/1/content.txt
    $ vi articles/2023/1/heading.txt
    # (optional) place images into articles/2023/1/img/
    # (optional) place video(s) into articles/2023/1/vid/
    
  5. Use articlectl to create thumbnails and resize images of the created article.

    $ docker run \
        --tty \
        --user $(id -u):$(id -g) \
        --volume $PWD/articles:/articles \
        suckowbiz/articlectl mogrify /articles/2023/1
    
  6. Run SimplePast to publish the created article:

    # This example follows the basic Caddy example as of https://hub.docker.com/_/caddy.
    $ docker run \
        --rm \
        --name simplepast \
        --publish 80:80 \
        --volume $PWD/articles:/usr/share/caddy/articles \
        --volume $PWD/config.json:/usr/share/caddy/config.json \
        suckowbiz/simplepast
    
  7. Visit: https://localhost

⁠Customization

⁠(Caddy) Webserver Configuration

The SimplePlast Dockerfile is directly inheriting the official Caddy Dockerfile. Thus all options/examples of the official Caddy Dockerfile apply. See https://hub.docker.com/_/caddy⁠ for configuration options.

⁠SimplePast Configuration

The configuration options are:

OptionDescriptionExample
archiveStartThe first entry for the drop down list to switch the year. It will be filled in until the current year is reached.2022
btnAllTitleTitle of the button to load all articles of the current year."All"
btnPrevTitleTitle of the button to load a previous article."Next"
copyrightYour copyright information."All rights reserved."
googleSiteVerificationGoogle site verification content to verify ownership of a site."loremipsum"
linkArchiveTitleTitle of the dropdown list to switch the year"Archive"
linkHomeTitleTitle of the text link to jump to the start page."Home"
pageHeadingFrontpage heading."Dairy"
pageTitleHTML title of the webpage."My newsblog"
⁠Frontpage Banner

Replace the default frontpage banner with a new one to customize it. It is assumed the new banner image is located at ./banner.png:

$ docker run -p 80:80 \
    --volume $PWD/articles:/usr/share/caddy/articles \
    --volume $PWD/config.json:/usr/share/caddy/config.json \
    --volume $PWD/banner.png:/usr/share/caddy/banner.png \
    suckowbiz/simplepast
⁠Google Site Verification

E.g. to verify ownership of a domain, Google requires a HTML site. SimplePast support verification meta tag. It can be configured with the SimplePast config option: googleSiteVerificationContent.

⁠3rd Party Software

SimplePast uses third party libraries to provide a web GUI:

⁠SimplePast License

SimplePast is licensed under MIT license.

Tag summary

Content type

Image

Digest

sha256:cbdefb83d…

Size

18.1 MB

Last updated

about 1 year ago

docker pull suckowbiz/simplepast