csgen/README.md

90 lines
2.8 KiB
Markdown
Raw Normal View History

2024-01-02 03:55:23 +01:00
# CoolSiteGENerator
2024-01-03 10:19:24 +01:00
csgen stands for CoolSiteGEnerator and as the name implies it is a site generator that
generates pages on-the-fly.
2024-01-02 03:55:23 +01:00
2024-01-03 10:19:24 +01:00
## Features
- Articles are written in Markdown, with extra powerful csgen markup
- Very customizable, minimal but modern UI with very little JavaScript
- Account system, including administrators, moderators and registering
- Comments
- GPL licensed (no proprietary software here)
## Dependencies
- php
- sqlite3
2024-02-06 18:24:51 +01:00
- php-mbstring
2024-01-03 10:19:24 +01:00
- Web server
- On Gentoo, you'll need to enable USE flag `sqlite` for package `dev-lang/php`
in case you're testing locally using `php -S`.
- On Debian, you'll need to install the appropriate Apache
plugin if you want to use Apache.
## Installation
1. Set up a web server with php and sqlite3
2. Point it to `index.php`
3. Make sure users cannot access the database or any of the config files (See docs/apache-sample.conf for an example)
2024-01-03 10:19:24 +01:00
When no admin account is set up, you'll be prompted to create one.
## Configuration
See config.def.ini.
## csgen syntax
csgen supports special syntax. This syntax should be entered in the
Markdown document and it can be at any point.
- `@csgen.title = "myTitleHere";`
- `@csgen.description = "myDescriptionHere";`
- `@csgen.favicon = "myFaviconHere";`
2024-01-03 10:19:24 +01:00
- `@csgen.date = "myDateHere";`
- `@csgen.license = "myLicenseHere";`
- `@csgen.displayTitle = "true";`
- `@csgen.displayDate = "true";`
- `@csgen.displaySource = "true";`
- `@csgen.displayLicense = "true";`
2024-03-24 21:19:28 +01:00
- `@csgen.displayAuthors = "true"`
- `@csgen.enableComments = "true";`
2024-03-24 21:19:28 +01:00
- `@csgen.addAuthor = "one author here";`
2024-03-24 22:12:51 +01:00
- `@csgen.markAsFeed = "false";`
- `@csgen.includePage = "/blog/my-awesome-blog-post";`
2024-03-25 22:10:10 +01:00
- `@csgen.redirectTo = "/blog/rss.xml";`
2024-01-03 10:19:24 +01:00
- `@csgen.span<STYLE, TEXT>("color: #0000ff;", "thisIsRedText");`
- `@csgen.span<STYLE, HTML>("color: #0000ff;", "<p>thisIsARedHTMLTag</p>");`
- `@csgen.inline<HTML>("<small>myHtmlHere</small>");`
2024-01-03 10:40:51 +01:00
- `@csgen.inline<CSS>("h1 { color: #0000ff; }");`
- `@csgen.inline<JAVASCRIPT>("alert('Hello world!');");`
2024-01-03 10:19:24 +01:00
- `@csgen.image<SIZE, PATH>("1920x1080", "/attachments/image.png");`
- `@csgen.div<START, NAME>("myFirstDiv");`
- `@csgen.div<END, NAME>("myFirstDiv");`
- `@csgen.div<STYLE, NAME>("text-align: left;", "myFirstDiv");`
2024-01-03 10:40:51 +01:00
- `@csgen.include<HTML>("/attachments/index.html");`
- `@csgen.include<CSS>("/attachments/index.css");`
- `@csgen.include<JAVASCRIPT>("/attachments/index.js");`
2024-01-03 10:19:24 +01:00
There are also special csgen reserved endpoints. These are:
- `/`
- The root document.
- `/_head`
- The header text.
- `/_foot`
- The footer text.
- `/_list`
- Additional items to prepend to the menu.
- `/_404`
- The error to display when no page was found for the endpoint.
## License
GNU Affero General Public License version 3.0. See `LICENSE` for details.
The font included is called Noto Sans, and is licensed under the SIL Open
Font License. See `OFL.txt` for copyright details.