The source code of Psensor is moving to GitLab at: https://gitlab.com/jeanfi/psensor
Psensor v1.2.0 has been released.
The source can be download at: https://wpitchoune.net/psensor/files
The news can be read at: https://wpitchoune.net/gitweb/?p=psensor.git;a=blob_plain;f=NEWS.html
In order to ease the edition of this website and the management of the server, I want it to be purely static and generated from Asciidoctor documents.
The news part of the website is also written as Asciidoctor
asciidoctor_to_rss is converting them into static
HTML pages and generates a RSS 2.0 file.
Installation of asciidoctor_to_rss
Howto write news
Each news must be written in an Asciidoctor document and all documents must be dropped into a directory.
There is not any restriction concerning the syntax because
the utility is based on the Java bridge of Asciidoctor.
I have added an attribute
date which allows the utility
to know the publication date of the news.
Here is an example of news:
= Asciidoctor to RSS Jean-Philippe Orsini <firstname.lastname@example.org> :date: 2016-11-07 :icons: font In order to ease the edition of this website and the management of the server, I want it to be purely static and generated from http://asciidoctor.org[Asciidoctor] documents. The _news_ part of the website is also written as Asciidoctor documents, `asciidoctor_to_rss` is converting them into static HTML pages and generates a RSS 2.0 file. == Installation of asciidoctor_to_rss It is required to install: * http://maven.apache.org/download.cgi[Apache Maven] (3.3.9) * http://www.oracle.com/technetwork/java/javase/downloads/index.html[Java] (Sun JDK >=1.8)
You can see few examples at https://wpitchoune.net/gitweb/?p=www.git;a=tree;f=src/news;hb=HEAD. The source document of this news is at https://wpitchoune.net/gitweb/?p=www.git;a=blob;f=src/news/asciidoctor_to_rss.adoc;hb=HEAD.
The configuration file of
asciidoctor_to_rss is text file containing key/value pairs.
feed.title=News feed.description=News of the wpitchoune.net website. feed.link=https://wpitchoune.net/news/feed.xml feed.baseurl=https://wpitchoune.net/news html.header.file=src/header.html
feed.title: the title used for the feed, in the RSS 2.0 and
feed.description: the description used in the RSS 2.0 file.
feed.link: URI of the RSS 2.0 file.
feed.baseurl: base URI where the HTML news files will be located.
html.header.file: the content of the denoted file will be added in the
head block of
the generated HTML documents.
Run the utility
The command line usage is:
asciidoctor_to_rss.sh <IN_DIR> <OUT_DIR> <CFG_FILE>
IN_DIR: the directory containing the news as Asciidoctor documents.
OUT_DIR: the output directory which contains all generated files.
CFG_FILE: the path to the configuration file.
OUT_DIR will contain:
It is now possible to follow news and announces of the website with the following RSS feed: https://wpitchoune.net/news/feed.xml
Under the bridge it is automaticaly generated with a very simple program from Asciidoctor documents. You can get the sources from the GIT repository: https://git.wpitchoune.net/asciidoctor_to_rss.git .
The version 1.2.0 of psensor is going to be released in the coming weeks. This release will include many changes which impact the translations. If you want to contribute to the translation of psensor it is now the good timeframe. See the instructions.
With the help of Atom and a couple of addons dedicated to Asciidoctor, it is easy and quick to write content. I am happy to no more have to worry about the painful admistration of Wordpress, upgrading it, taking care of security, spamming of comments and bot account creation, and backup of databases.
If you want to know how the website is built, everything is on a GIT repository: http://git.wpitchoune.net/gitweb/?p=www.git. It is simple, really simple… but enough for my needs.