- PHP 90.1%
- CSS 7.5%
- Dockerfile 1.9%
- Shell 0.5%
| docker | remove releases | |
| docs | remove releases | |
| src | remove releases | |
| .gitignore | remove releases | |
| dev-notes.md | remove releases | |
| LICENSE | remove releases | |
| README.md | Improvements to README | |
| run-dev.sh | remove releases | |
Lichen-Markdown
Lichen-Markdown is a simple and friendly CMS for making static websites. Lichen-markdown is a fork of the original php version of Lichen.
There is a simple web page with more info about the project at https://lichen.commoninternet.net.
Setup
First, download the latest release of Lichen-Markdown to your server or local development environment:
wget https://codeberg.org/ukrudt.net/lichen-markdown/archive/v1.0.0.zip
A list of all of the releases of Lichen-Markdown is here.
The "src" folder of the downloaded folder contains an example Lichen-Markdown project with everything needed, including the markdown files for each web page, the cms folder (which contains the php files of the cms), and the theme folder, which contains a layout.php file used for rendering all the markdown pages.
This folder can then be served via Apache, Nginx or Docker (using Apache inside).
Instructions for each of these methods are below.
Apache Setup
With an apache web server, use the .htaccess in the src directory of this repository (note that this htaccess file includes settings for .gmi and .md files), and make sure that this folder is in a directory served by Apache.
Nginx Setup
With an nginx web server, copy the nginx config in this repository in docs/nginx.conf to /etc/nginx/sites-enabled.
In nginx.conf you need to replace "root" with the path to your lichen-markdown project, server_name with your actual server name.
There is a also a comment within nginx.conf explaining how to protect the admin panel with http basic auth, if you choose to.
Docker Setup
The Dockerfile in docker/Dockerfile builds a docker image which can be used to serve Lichen-Markdown with apache, via something like this:
docker build -t lichen-markdown:latest ./docker/
docker run -d -p 80:80 -v $(pwd)/src:/var/www/html lichen-markdown:latest
Usage
Navigate to /cms/edit.php to edit pages or add new ones. Changes you make to the raw Markdown on the left are reflected in the live preview on the right.
Links to files with a .md extension will automatically be translated to .html. Links to files with common image, audio, and video extensions are automatically rendered to their respective HTML elements.
Click the green "Save" button at the bottom to save your content and render a fresh HTML file.
The file manager allows you to create new pages and folders, and upload files like images and videos.
Click on a Markdown file (.md) to edit it.
Hover a file and click the 🔗 button to return to the editor and insert a link to that file. It will be inserted at the current cursor position.
Development
Run locally
Use for example apache to serve Lichen-Markdown locally. You can do it with docker by running
bash run-dev.sh
Then go to localhost:6969 to use the app.
Debugging rendering
You can debug rendered html in php with this trick, where $variable is a variable containing an html string.
echo ("<pre><code>" . json_encode($variable) . "</code></pre>");
Contributors
Lichen-Markdown was forked from Lichen, by @abekonge, @soapdog, and @notplants.
License
The original Lichen and this fork are both licensed using MIT License.
The MIT License (MIT)
Copyright © 2022 Sensor Station LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.