The https://www.kmx.io/ website relies primarily on a private wiki to translate the website pages from Markdown syntax to HTML. The page slug is included in the page body and div classes for custom CSS per page. The CSS still has to be configured site-wide there are no CSS includes per page for now but it could be easy to add.
To be able to edit a page you must be connected to the website with a login and password that only an admin can setup. Admin users can invite other users and set them as admin too. Admin users can remove other users and can delete pages from the website. Be careful when giving admin permissions to a user on a KC3 wiki.
Now if the user is connected, they can create a page by just visiting a URL that does not exist
on the website and the WikiController.route
will return a nice HTML form to create
the page with Markdown syntax instead of the usual 404 not found. That allows
any connected user to create any page that is not already a registered route on the server.
Once the page is submitted, we are redirected to a WikiController.show
where the url is just
the wiki page slug, meaning that if the wiki page slug is /
then you just created the front page
of the website. The wiki page shows the HTML version of the submitted Markdown so everything
is fine.
There is an Edit button at the top of the wiki show page if the user is still connected. The Edit button links to the wiki edit page which looks the same as the create page. And actually in database (facts) it also behaves the same as create as it generates a full new wiki page (in triples) as creating a new wiki page would, with a nice join on the slug and sort order on time.
Also there is a History button at the top of the wiki show page if the user is still connected. The History button links to the history page. The history page shows all versions of the wiki page from first to last. It is not possible to delete one version of the page. To delete a revision, you must delete the whole page. I'm not sure yet if it is a bug or a feature so I'm not going to fix it for now. But maybe a more sane behaviour is if you are an admin, or if you are the owner of the version, you can also just remove it. We'll see. On the wiki history page you can visit each version of the page by clicking on the Show button. Or you can stay on the history page and select (with an option list) a version to set as the current page version, which will change the wiki page show controller to display the selected version for the given slug (URL).
Any Delete operation on the website requires the admin user to type the full slug of what is to be removed in a web form.
The big idea behind this behaviour is that if users cannot be trusted we must prevent them from removing content from the website. The admins can still clean the data without any loss and figure out what happened with the logs and change all the possibly compromised users password.
Anyway that's how this website was built (except for the Blog, which you are reading). It's all Markdown all the way.
I will add some screen captures soon. Please come back later :) .