234 lines
5.9 KiB
Markdown
234 lines
5.9 KiB
Markdown
# GSL: Statique Littérateur
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
GSL is a multiple blogs/websites generator based on their domain,
|
|
written in bash, for minimal dependancies. The websites are nearly all
|
|
static, except for some includes pages, like listing posts, that nginx
|
|
can easily get, in your webserver.
|
|
|
|
# Dependancies
|
|
------------------------------------------------------------------------
|
|
|
|
- bash
|
|
- coreutils
|
|
- curl (to check Posts links response)
|
|
|
|
|
|
# GSL: Installation
|
|
|
|
------------------------------------------------------------------------
|
|
In your System /
|
|
```
|
|
git clone URL .
|
|
```
|
|
|
|
GSL does NOT use any sudo. To avoid errors, you must give permissions
|
|
to USER with chown -R to folders.
|
|
|
|
## --Prefix for DOMAIN configuration (set according to user choice):
|
|
- HOME: ~/.config/gsl
|
|
- GLOBAL: /var/lib/gsl
|
|
- Folder: --Prefix/domains/ (created with $ gsl new)
|
|
|
|
### DOMAIN Datas from Prefix:
|
|
- Folder: --Prefix/DOMAIN/ (Created by GSL)
|
|
- - Files: DOMAIN.conf, authors.db (Created by GSL)
|
|
- - Folder: --Prefix/DOMAIN/templates/ (css, logos...) (Created by GSL)
|
|
|
|
## Destination Folder: /etc/gsl/
|
|
- File: gsl.conf
|
|
|
|
## Destination Folder: /var/lib/gsl/
|
|
- Folder: db (Created by GSL)
|
|
- Folder: helps
|
|
- Folder: scripts
|
|
- File: README.md
|
|
|
|
## Destination Folder: /var/log/gsl
|
|
- File: gsl.log (Created and managed by GSL $ gsl log clean...)
|
|
|
|
## Destination Folder: /usr/local/bin
|
|
- File: gsl
|
|
|
|
## Destination Folder: /usr/share/bash-completion/completions/gsl
|
|
- File: gsl
|
|
|
|
# How to configure a DOMAIN folder, and create a Post
|
|
------------------------------------------------------------------------
|
|
|
|
When Adding a DOMAIN (example.com), GSL will ask you some questions.
|
|
Datas will be used to create a DOMAIN.conf file. GSL will also ask you
|
|
to set a folder where you will put your Posts, but you can create or add
|
|
ones too.
|
|
|
|
## Set a DOMAIN
|
|
- add a DOMAIN name (if not alrady done)
|
|
```
|
|
gsl new
|
|
```
|
|
|
|
Follow instructions when adding DOMAIN or see them again with
|
|
```
|
|
gsl help new
|
|
gsl help install
|
|
```
|
|
|
|
## Set a DOMAIN folder for Posts (if not already done by GSL or You)
|
|
|
|
- Add/Create or go into your folder of choice
|
|
- Save into that folder a blank file named gsl.DOMAIN (gsl.example.org)
|
|
so that GSL, knows this folder is for this DOMAIN website.
|
|
|
|
## Create a new Post
|
|
The engine is written from scratch and looks like a mix of markdown and
|
|
ReStructuredText. It's very easy to learn and use.
|
|
|
|
- Write a post in a file, using some "metas" that GSL will catch.
|
|
- Save your file with .gsl extension
|
|
- Start checking it, using:
|
|
|
|
```
|
|
gsl check
|
|
```
|
|
|
|
## Convert one or all Posts
|
|
If your Post has no error, you will have to deploy html
|
|
files and folders. You could install nginx, or lightweight darkhttpd
|
|
webserver on your PC to preview the website. You can also just open
|
|
index.html in your server folder, but you won't be able to see some extra
|
|
includes page, like Posts listing.
|
|
|
|
To convert your Posts in HTML, use
|
|
|
|
```
|
|
gsl make
|
|
```
|
|
|
|
You can select a specific post, with autocompletion to check and make
|
|
only that specified one.
|
|
|
|
# Create a Templates
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
You will have to create some CSS (styles.css) in your /DOMAIN/templates/
|
|
- HOME: ~/.config/gsl/domains/DOMAIN/templates/
|
|
- GLOBAL: /var/lib/gsl/domains/DOMAIN/templates/
|
|
|
|
# How to Write a Post
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
Post has 2 sections : Before and After #1. #1 is the FIRST Title of your
|
|
post. #(1-6) are HTML titles.
|
|
- Before #1 is used to set METAs HEADERS to configure your Post.
|
|
- From #1 is the CONTENT of your Post
|
|
|
|
## NEEDED HEADERS (before #1)
|
|
Register METAs for HTML Page content
|
|
|
|
```
|
|
title: POST TITLE
|
|
slug: POST-TITLE (if space in slug GSL will convert them)
|
|
info: DESCRIPTION (about the Post)
|
|
author: NAME (must be registred ($ gsl author add)
|
|
date: YYYY-MM-DD
|
|
tags: TAG1,OTHER TAG2,TAG3 (comma separated)
|
|
```
|
|
|
|
### Admin Header
|
|
Admin can define specific type of content. If no type defined, GSL will
|
|
add at first line the default value: "type: post".
|
|
|
|
TYPE:
|
|
- post < classic content
|
|
- page < used to define main index, 404, about...
|
|
|
|
```
|
|
type: TYPE
|
|
```
|
|
|
|
GSL will create html file according to slug. Do not add .html to slug.
|
|
- post < /slug/index.html
|
|
- page < /slug.html
|
|
|
|
## Optional HEADERS (before #1)
|
|
Register METAs for CONTENT. " : " field separator
|
|
|
|
```
|
|
abbr: SHORT : LONG
|
|
file: NAME : FILENAME : Alt Text
|
|
link: NAME : URL : Alt Text
|
|
code: NBR : FILENAME : Alt Text
|
|
image: NBR : FILENAME : ALT-TEXT
|
|
```
|
|
|
|
## CONTENT Post:
|
|
In Content Post, markers (i.e. __My Great file) must be on the SAME line.
|
|
For ABBRs, just write SHORT in your content
|
|
|
|
```
|
|
# Paragraphs
|
|
At begining of new line, open with ( and close with )
|
|
Set till 3 different classes with ( 1 ( 2 ( 3
|
|
( 2
|
|
This is a paragraph with class 2
|
|
)
|
|
|
|
# Register in Header. link: My Great Link : URL : Alt text
|
|
_My Great Link
|
|
_My Great Link+ # Open in new tab
|
|
|
|
# Register in Header. file: My Great file : FILENAME : ALT-TEXT
|
|
__My Great file
|
|
|
|
# Register in Header. image: 1 : FILENAME : ALT-TEXT
|
|
_image:1:[OPT l|r|c (left, right, center, alignment)]
|
|
_image:1:r
|
|
|
|
# Block-Code File: Register in Header. code: 1 : FILENAME : Alt Text
|
|
_code:1
|
|
|
|
# Write in STRONG
|
|
**this strong content**
|
|
this un**believe**able content
|
|
this border**line** content
|
|
|
|
# BOLD
|
|
*this bold content*
|
|
...
|
|
|
|
# Write in ITALIC
|
|
/this em text/
|
|
|
|
# Inline-code (¤ = alt-gr + $ on FR keyboard)
|
|
¤push()¤
|
|
|
|
# Simple Blockquote
|
|
---
|
|
(
|
|
A simple great quote
|
|
)
|
|
---
|
|
|
|
# Advanced Blockquote
|
|
---
|
|
_cite : Richard Matthew Stallman
|
|
_link : https://stallman.org/
|
|
_lang : en
|
|
(
|
|
In the free/libre software movement, we develop software that respects
|
|
users' freedom, so we and you can escape from software that doesn't. I
|
|
could have made money this way, and perhaps amused myself writing code.
|
|
But I knew that at the end of my career, I would look back on years of
|
|
building walls to divide people, and feel I had spent my life making the
|
|
world a worse place
|
|
)
|
|
---
|
|
|
|
# For advanced blockquotes, you can also add, if known:
|
|
_year: 2021
|
|
_book: Esperanza 64
|
|
```
|