Dynamic site generator, written in PHP.
Go to file
2024-05-30 18:21:49 +02:00
docs Fix issue #20, fix issue with page index, remove dependency on .htaccess 2024-03-23 22:34:24 +01:00
md Initial commit. 2024-01-02 03:55:23 +01:00
.gitignore Add support for page credits. 2024-03-24 21:19:28 +01:00
account.php Replace some links with buttons, for aesthetic reasons. 2024-05-25 17:51:17 +02:00
admin.php Replace some links with buttons, for aesthetic reasons. 2024-05-25 17:51:17 +02:00
change.php Wrap some more variables in htmlspecialchars() 2024-02-05 21:46:50 +01:00
comment.php Wrap some more variables in htmlspecialchars() 2024-02-05 21:46:50 +01:00
config.def.ini Add limit to how many accounts can be created per IP address. 2024-02-05 21:12:45 +01:00
config.php Add limit to how many accounts can be created per IP address. 2024-02-05 21:12:45 +01:00
core.php Add /_css and /_js endpoints. 2024-05-30 18:16:41 +02:00
create-user.php Add 'Stay signed in' feature #13 2024-02-05 22:27:22 +01:00
create.php Some minor changes to the UI 2024-02-06 16:17:21 +01:00
edit-page.php Fix issue #25 2024-04-04 10:05:19 +02:00
edit.php Replace some links with buttons, for aesthetic reasons. 2024-05-25 17:51:17 +02:00
font.ttf Initial commit. 2024-01-02 03:55:23 +01:00
index.css Change the a tag color. 2024-05-30 18:21:49 +02:00
index.js Display footer if page is not scrollable 2024-03-31 04:25:30 +02:00
index.php Fix issue #20, fix issue with page index, remove dependency on .htaccess 2024-03-23 22:34:24 +01:00
LICENSE Initial commit. 2024-01-02 03:55:23 +01:00
login.php Fix more typos. 2024-02-27 17:39:43 +01:00
OFL.txt Initial commit. 2024-01-02 03:55:23 +01:00
post-edit.php Fix a bug in post-edit 2024-04-04 10:07:21 +02:00
properties.css Replace some links with buttons, for aesthetic reasons. 2024-05-25 17:51:17 +02:00
README.md Add /_css and /_js endpoints. 2024-05-30 18:16:41 +02:00
register.php Fix more typos. 2024-02-27 17:39:43 +01:00
remove-comment.php Wrap some more variables in htmlspecialchars() 2024-02-05 21:46:50 +01:00
remove-file.php Wrap some more variables in htmlspecialchars() 2024-02-05 21:46:50 +01:00
remove-user.php Wrap some more variables in htmlspecialchars() 2024-02-05 21:46:50 +01:00
remove.php Wrap some more variables in htmlspecialchars() 2024-02-05 21:46:50 +01:00
setup.php Change a bunch of class names, introduce index.js to show/hide header 2024-03-31 04:01:38 +02:00
update.php Fix issue #20, fix issue with page index, remove dependency on .htaccess 2024-03-23 22:34:24 +01:00
upload.php Wrap some more variables in htmlspecialchars() 2024-02-05 21:46:50 +01:00

CoolSiteGENerator

csgen stands for CoolSiteGEnerator and as the name implies it is a site generator that generates pages on-the-fly.

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

  • php-mbstring

  • 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)

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";
  • @csgen.date = "myDateHere";
  • @csgen.license = "myLicenseHere";
  • @csgen.displayTitle = "true";
  • @csgen.displayDate = "true";
  • @csgen.displaySource = "true";
  • @csgen.displayLicense = "true";
  • @csgen.displayAuthors = "true"
  • @csgen.enableComments = "true";
  • @csgen.addAuthor = "one author here";
  • @csgen.author = "author1|author2|author3";
  • @csgen.addTag = "one tag here";
  • @csgen.tag = "tag1|tag2|tag3";
  • @csgen.markAsFeed = "false";
  • @csgen.includePage = "/blog/my-awesome-blog-post";
  • @csgen.redirectTo = "/blog/rss.xml";
  • @csgen.span<STYLE, TEXT>("color: #0000ff;", "thisIsRedText");
  • @csgen.span<STYLE, HTML>("color: #0000ff;", "<p>thisIsARedHTMLTag</p>");
  • @csgen.inline<HTML>("<small>myHtmlHere</small>");
  • @csgen.inline<CSS>("h1 { color: #0000ff; }");
  • @csgen.inline<JAVASCRIPT>("alert('Hello world!');");
  • @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");
  • @csgen.include<HTML>("/attachments/index.html");
  • @csgen.include<CSS>("/attachments/index.css");
  • @csgen.include<JAVASCRIPT>("/attachments/index.js");

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.
  • /_css
    • Stylesheet to append.
  • /_js
    • JavaScript to append.

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.