From b841deafc69ce4d15e07a4dc927d93dfd7d37657 Mon Sep 17 00:00:00 2001 From: octospacc Date: Tue, 30 Aug 2022 00:17:05 +0200 Subject: [PATCH] Updates --- .github/workflows/main.yml | 33 +++++++++++++++++++ .gitlab-ci.yml | 12 +++---- Pages/index.md | 66 ++++++++++++++++++++++++++++++-------- 3 files changed, 92 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1ecb70b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +name: Build and Deploy with staticoso + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + + workflow_dispatch: + +jobs: + page_build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Build + run: | + sudo apt update + sudo apt install -y software-properties-common + sudo add-apt-repository ppa:deadsnakes/ppa + sudo apt update + sudo apt install -y python3.10 curl git + curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3.10 + sudo pip3 install lxml + git clone --depth 1 https://gitlab.com/octtspacc/staticoso + python3.10 ./staticoso/Source/Build.py + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: public diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ce93b11..5b7d7d3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,14 +1,14 @@ image: alpine:latest -before_script: - - apk update - - apk add python3 git +before_script: | + apk update + apk add python3 git pages: stage: deploy - script: - - git clone --depth 1 https://gitlab.com/octtspacc/staticoso - - python3 ./staticoso/Source/Build.py + script: | + git clone --depth 1 https://gitlab.com/octtspacc/staticoso + python3 ./staticoso/Source/Build.py artifacts: paths: - public diff --git a/Pages/index.md b/Pages/index.md index c44cdad..f5003ff 100644 --- a/Pages/index.md +++ b/Pages/index.md @@ -43,7 +43,7 @@ A **full** staticoso site folder looks like this: Keep in mind that the only required files (and, consequently, appropriate folders) for a minimum successful build are at least: one HTML base template, and one page or post. Other elements are optional. A reasonably **minimal** staticoso site folder tree can look like this: -``` +

 .
 ├── Assets
 │   ├── Default.css
@@ -54,17 +54,35 @@ A reasonably **minimal** staticoso site folder tree can look like this:
 │   └── index.md
 └── Posts
     └── 2022-05-16-That-Day.md
-```
+
-## Internal Markup Tags +## Preprocessor Flags -staticoso uses a simple internal markup language that's the essence of its template system. +Preprocessor flags can be included in single-line comments. +They must be prepended by a `%` (percent sign) character, and values are assigned with the [standard Python INI syntax](https://docs.python.org/3/library/configparser.html#supported-ini-file-structure). -Tags are enclosed in square brackets (with colons as token separators), and declared with the form `[staticoso:Name:Values]`. -For some tags, there are no values to be specified, so the last part can be omitted. Starting the declaration with `staticoso` is always required. +_Note: **Markdown** doesn't officially support comments. staticoso thus uses its own syntax: a line starting with `//` (2 slashes) indicates a comment._ -You can use the following tags in your templates or pages, to let everything work as you want. Some are obviously needed for compiling minimum viable pages, like the one for displaying content. +For example: +`// % Flag = Value` + +Supported values: + +- `Template` +- `Style` +- `Type` +- `Index` +- `Feed` +- `Title` +- `HTMLTitle` +- `Description` +- `Image` +- `Macros` +- `Categories` +- `CreatedOn` +- `EditedOn` +- `Order` TODO: Finish writing this @@ -84,23 +102,32 @@ _Note: Some flags are currently CLI-only, while others are file-only. This will ### Site - `Name` (`--SiteName`): The name of your site. +- `BlogName` (`--BlogName`): The name of the blog section of your site. Can be omitted, and the site name will be used instead. +- `Tagline` (`--SiteTagline`): The tagline or motto of your site. + +### Minify + +- `Minify` (`--Minify`): Whether or not to minify the output HTML. Defaults to `False`. +- `KeepComments` (`--MinifyKeepComments`): Optionally keeping comments in minified HTML, instead of removing them. Defaults to `False`. + +### Categories + +- `Automatic` (`--CategoriesAutomatic`): Whether or not to automatically create pages in the `Categories/` directory of your site. Defaults to `False`. +- `Uncategorized` (`--CategoriesUncategorized`): Enabling a custom name for the automatically managed "Uncategorized" category. Defaults to `Uncategorized`. --- TODO: Correctly categorize all the below flags -- `BlogName`: The name of the blog section of your site. -- `SiteTagline`: The tagline or motto of your site. - `SiteRoot`: The root path of your site on your server. Useful if you keep many sites on the same domain/address. Defaults to `/`. - `SiteDomain`: Domain of your website, for use for feeds and sitemaps. - `SiteLang`: The language of your site. Will be used for choosing certain strings. Defaults to `en`. - `SiteTemplate`: Name of the template file to use for the site. Defaults to `Default.html`. -- `Minify`: Whether or not to minify the output HTML. Defaults to `False`. - `NoScripts`: Whether or not to strip out `