+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+.
+```
+
+
+## Acknowledgements
+
+The Arise CI/CD workflow calls for the use of a GitHub Action [s0/git-publish-subdir-action by Sam Lanning](https://github.com/s0/git-publish-subdir-action). This GitHub Action is not bundled or redistributed in this repository, so it is not part of the Arise Contents. However, just in case it is necessary, the copyright notice for s0/git-publish-subdir-action by Sam Lanning is reproduced below for your review:
+
+```
+MIT License
+
+Copyright (c) 2018 Sam Lanning
+
+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.
+```
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..f8b844a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,94 @@
+![ARISE](./docs/logo/arise-logo_transparent.png)
+
+# Arise // Bash Static Site Generator
+*Cyberpunk websites for the modern web.*
+
+---
+
+## Overview
+
+There was a time before React, before Wordpress, and before even javascript and php. And the webmasters who ran the 'net back then made do with what they had. They wrangled their webservers to the fullest and they hacked together sites that could do what they need-- somehow.
+
+The web has grown up a lot since then, but unfortunately many of the modern tools we've built on top of are just way too complicated to maintain on the day-to-day without a fully staffed corporate webdev team.
+
+The goal of Arise is to take the lessons of yesteryear and make something novel. Arise is a cloud-native static site generator written in Bash, designed to be a fusion of ultra-stable timeless 90s technology and modern DevOps paradigms. Arise is designed around use cases like individual blogs and personal websites.
+
+## Why Use Arise
+
+Arise is written in Bash with very few dependencies outside of the standard GNU toolchain. Arise is designed with longterm simplicity and maintainability in mind. It is unlikely that the core code Arise runs on will break in the near future due to language or dependency updates.
+
+Arise supports modern SEO features that are built into your pages out of the box without any extra effort necessary:
+- [OpenGraph](https://ogp.me/) and [TwitterCard](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards) support for rich embed details
+- Dynamically generated RSS feed
+- Dynamically generated search engine sitemap
+
+Arise is built to be practical and let you build a website that actually has real content on it and isn't just a single-page placeholder. Arise uses a modular page architecture with support for dynamically generated metadata-rich index pages to keep your site hierarchy traversable by end users.
+
+## Live Example
+
+A live demo of Arise can be found at https://ari.se.net
+
+The example site is actually deployed straight from this repository, so the contents you see there are exactly what you get if you were to fork this exact repo and host it yourself.
+
+## Getting Started / Documentation
+
+All of the documentation for getting started with Arise can be found within this repository.
+
+- [Getting Started with Arise](docs/guides/getting-started/README.md)
+ - [Cloudflare Pages](docs/guides/getting-started/cloudflare/README.md)
+ - [DigitalOcean](docs/guides/getting-started/digitalocean/README.md)
+ - [GitHub Pages](docs/guides/getting-started/github-pages/README.md)
+- [Creating Arise Pages](docs/guides/creating-arise-pages/README.md)
+- [Running Arise Locally](docs/guides/running-arise-locally/README.md)
+
+## Dependencies
+- Bash 5.1
+ - **Used for:** 😐
+ - **Why:** Do you see what language this program is written in?
+- [pandoc](https://pandoc.org/)
+ - **Used for:** `build_page` - Function that builds pages from a `.md` source file
+ - **Why:** Arise uses Pandoc for conversion of Markdown to HTML. If your source pages are already in HTML and you don't need Markdown conversion, you can disable Markdown conversion on individual pages with the use of an Arise page option (see above).
+- GNU `date`
+ - **Used for:** `build_rss` - RSS feed generator function
+ - **Why:** You see, RSS is kind of ridiculous because it asks for dates in RFC-822 (stupid) rather than the usual ISO 8601 format used by developers who weren't dropped on their head as a child. GNU's implementation of the date command has a flag to accomodate this, but it's not available on BSD/macOS.
+- GNU `find`
+ - **Used for:** `build_toc` - Function that builds TOC/index pages
+ - **Why:** Only the GNU version supports `-maxdepth`. This flag is used for the TOC indexer function to ensure that only folders in the current directory (and not subfolders of those) get put into your indices.
+- GNU `awk`
+ - **Used for:** `evaluate_inline` - Function that performs inline bash snippet evaluations. This is disabled by default because this functionality is still WIP.
+ - **Why:** Using `awk` in any capacity is the equivalent of staring into a horrific eldrich abyss not meant for mere mortals. Making those commands portable is another story entirely.
+- GNU `sed`
+ - **Used for:** `build_header` - Function that populates headers with metadata from page source files
+ Dependency for the header metadata tag population.
+ - **Why:** This script makes use of the GNU version of the '-i' flag. BSD sed will not let you run inline sed replacements without forcing you to do an extra file write to create a backup of the original file, which you then have to run ANOTHER command to delete (literally why).
+
+## Wishlist / To-Do / Feature Ideas
+- Refactor inline bash evaluation function and enable its usage. Right now it only works on very tiny/simple snippets. The main reason I wrote the logic was because I thought it would be funny to implement (it was). Some refactoring is absolutely necessary to make this feature practical/useful and not just a good meme.
+ - Allow inline bash evaluations in the site headers and footers
+- Add support for metadata tag usage in the site footer.
+- Move the hardcoded TOC formatting in `build_toc` into a configurable template within `.config`
+- Bundle and implement [Markdown.pl](https://daringfireball.net/projects/markdown/) as a fallback rendering engine for systems that do not have pandoc installed.
+- Add support for inline include statements for html snippets saved in the `/config` folder so that it's possible to write reusable little bits for pages.
+- Implement better error handling. Right now it's wishy washy and in many ways basically nonexistent-- most stuff will silently error or otherwise not gracefully cause an abort.
+ - As far as dependency checks, right now it only checks if your bash version is good. Maybe could consider implementing checks for the other dependencies. It's really hard to determine if something is GNU or not, though.
+
+## License, Disclaimers, and Acknowledgements
+All the legal bulldrek relevant to this repository can be found [here](LICENSE/README.md).
+
+A summary\* of the license terms (which is not a substitute for the above-linked licensing information itself) is:
+- The example site is MIT License
+ - **TL;DR:** You can edit and do whatever with it. Go crazy, choom. You can license your own website built off my example however you damn please.
+- The logo is Creative Commons CC-BY-SA 4.0
+ - **TL;DR:** You can do what you want with it as long as you let anyone else do the same with any derivatives you redistribute.
+- All the Arise code itself is AGPL 3.0
+ - **TL;DR:** You have to give people a copy of your version of the source code if you modify and/or redistribute it in any way when you use it to create and deploy your website.
+ - If you don't modify the Arise software code itself and don't redistribute it, you don't need to host the source code for other people. But, to be clear, removing the link to this repository from the help function constitutes as modification as far as AGPL is concerned.
+ - AGPL scares a lot of people. I'm not a lawyer and this is not legal advice, but check out [this cool article about AGPL](https://writing.kemitchell.com/2021/01/24/Reading-AGPL.html) and maybe it will make it a little less scary for you :)
+
+\*This summary highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material. Also, I am not a lawyer and none of this is legal advice.
+
+---
+
+*Made with 💙 by [Spectra Secure](https://twitter.com/spectrasecure)*
+
+*Inspired by the geniuses over at [motherfuckingwebsite.com](https://motherfuckingwebsite.com/)*
diff --git a/arise b/arise
new file mode 100644
index 0000000..4eb863a
--- /dev/null
+++ b/arise
@@ -0,0 +1,159 @@
+#!/bin/bash
+######################################
+# ARISE
+# https://github.com/neonspectra/arise
+arise_version="1.0.0"
+######################################
+
+##############################################################
+# Begin main script function
+# Don't edit below this line unless you know what you're doing
+##############################################################
+
+cd "$(dirname $0)"
+
+# Set the site config directories. Don't touch this-- changing the config location is not supported at this time
+config="arise-out/config"
+source arise-source/config/arise.conf
+
+# Check if we're running a current version of bash before potentially causing code that won't run properly on ancient bash versions
+[ "$BASH_VERSINFO" -lt 5 ] && echo -e 'ERROR: Arise requires Bash version 5 or greater to run. Please install a newer version of Bash or ensure that you are using the newest version installed on your computer.\n\nYour current version of Bash is: '"$BASH_VERSINFO"'\n\nYou can verify the current running version of Bash by running the following command: echo "$BASH_VERSINFO"' && exit 1
+
+# Makes sure that our paths have or don't have a '/' as expected regardless of user input.
+## Favicon should have a '/' at the start of the path.
+[[ $favicon != '' ]] && [[ ${favicon:0:1} != '/' ]] && favicon='/'"$favicon"
+## Base URL should not have a '/' at the end.
+[[ ${base_url: -1} == '/' ]] && base_url=${base_url::-1}
+
+# Source functions
+for FILE in lib/functions/inline/* ; do [[ $FILE == *.sh ]] && source $FILE ; done
+for FILE in lib/functions/subshell/* ; do [[ $FILE == *.sh ]] && source $FILE ; done
+
+# Display our pretty logo no matter what when the program is run :)
+arise_logo
+
+# Set default build settings
+force_overwrite=false
+keep_source=false
+
+# Read our arguments and set the build mode for processing. Display help if an invalid option is made.
+if [[ $@ == "build" ]]; then
+ arise_build="full"
+ echo "Starting site deploy. Building full site."
+elif [[ $@ == "build -k" ]]; then
+ arise_build="full"
+ keep_source=true
+ echo "Starting site deploy. Building full site. Source .md files will be retained in the final output."
+elif [[ $@ == "build -f" ]]; then
+ arise_build="full"
+ echo "Starting site deploy. Building full site."
+ echo;
+ read -p 'WARNING: Specifying "-f" will DELETE the current contents of '"$(realpath arise-out)"'. Proceed? [y/N]: ' -n 1 -r;
+ echo;
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
+ force_overwrite=true;
+ else
+ echo 'Aborting.';
+ exit 1;
+ fi;
+elif [[ $@ == "build -kf" ]] || [[ $@ == "build -fk" ]]; then
+ arise_build="full"
+ keep_source=true
+ echo "Starting site deploy. Building full site. Source .md files will be retained in the final output."
+ echo;
+ read -p 'WARNING: Specifying "-f" will DELETE the current contents of '"$(realpath arise-out)"'. Proceed? [y/N]: ' -n 1 -r;
+ echo;
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
+ force_overwrite=true;
+ else
+ echo 'Aborting.';
+ exit 1;
+ fi;
+else
+ while getopts ":psrkf" options; do
+ case "${options}" in
+ p)
+ [[ -n "$arise_build" ]] && { arise_help; echo -e '\n\nERROR: Multiple exclusive build options detected. Aborting.'; exit 1; }
+ arise_build="pages_only";
+ echo "Starting site deploy. Building pages only.";
+ ;;
+ s)
+ [[ -n "$arise_build" ]] && { arise_help; echo -e '\n\nERROR: Multiple exclusive build options detected. Aborting.'; exit 1; }
+ arise_build="sitemap_only";
+ echo "Starting site deploy. Building sitemap only.";
+ ;;
+ r)
+ [[ -n "$arise_build" ]] && { arise_help; echo -e '\n\nERROR: Multiple exclusive build options detected. Aborting.'; exit 1; }
+ arise_build="rss_only";
+ echo "Starting site deploy. Building RSS feed only.";
+ ;;
+ k)
+ keep_source=true;
+ echo "Source .md files will be retained in the final output."l
+ ;;
+ f)
+ echo;
+ read -p 'WARNING: Specifying "-f" will DELETE the current contents of '"$(realpath arise-out)"'. Proceed? [y/N]: ' -n 1 -r;
+ echo;
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
+ force_overwrite=true;
+ else
+ echo 'Aborting.';
+ exit 1;
+ fi;
+ ;;
+ esac
+ done
+fi
+
+[[ -z "$arise_build" ]] && { arise_help; exit 1; }
+echo
+
+# Make sure "arise_out" is empty and copy the source files over there to work from during the build process.
+[[ -d arise-out ]] && [[ "$force_overwrite" == true ]] && rm -rf arise-out
+mkdir -p arise-out
+[[ -n "$(ls -A arise-out)" ]] && echo -e 'ERROR: The build output directory "/arise-out" is not empty. Program aborted to prevent overwrite of existing data.\n\nPlease empty the output directory before running Arise again or run your command with the "-f" flag to overwrite the existing output (dangerous).' && exit 1
+cp -r "arise-source/". "arise-out"
+## Set an absolute path for $config
+config=$(realpath $config)
+
+# Define a temporary file for a list of all source files for post-build cleanup
+removelist="arise-out/arise-remove-$RANDOM.tmp"
+touch $removelist
+removelist=$(realpath $removelist)
+
+# Run the build process depending on whatever options have been set
+if [[ "$arise_build" == "full" ]] || [[ "$arise_build" == "pages_only" ]]; then
+ echo -n "Building pages..."
+ build_page_tree arise-out || { echo "ERROR: An error was encountered while building pages. Aborting build cycle."; exit 1; }
+ echo " DONE."
+fi
+
+if [[ "$arise_build" == "full" ]] || [[ "$arise_build" == "rss_only" ]]; then
+ echo -n "Building RSS feed..."
+ build_rss arise-out/rss.xml || { echo "ERROR: An error was encountered while building the RSS feed. Aborting build cycle."; exit 1; }
+ echo " DONE."
+fi
+
+if [[ "$arise_build" == "full" ]] || [[ "$arise_build" == "sitemap_only" ]]; then
+ echo -n "Building sitemap..."
+ build_sitemap arise-out/sitemap.xml || { echo "ERROR: An error was encountered while building the sitemap. Aborting build cycle."; exit 1; }
+ echo " DONE."
+fi
+
+if [[ "$keep_source" == false ]]; then
+ echo -n "Cleaning up build source files from output..."
+ # Remove every page that we built from as part of the build cycle
+ while read fname; do
+ [[ -f "$fname" ]] && rm "$fname"
+ done <$removelist
+ # Remove site config templates
+ rm "$config/header.html"
+ rm "$config/content_header.html"
+ rm "$config/footer.html"
+ rm "$config/arise.conf"
+ echo " DONE."
+fi
+
+rm $removelist
+echo -e '\nBuild completed! Built artefacts have been generated at:\n'"$(realpath arise-out)"
diff --git a/arise-source/arise-icon.png b/arise-source/arise-icon.png
new file mode 100644
index 0000000..3a0c9dc
Binary files /dev/null and b/arise-source/arise-icon.png differ
diff --git a/arise-source/config/arise.conf b/arise-source/config/arise.conf
new file mode 100644
index 0000000..b24d0bc
--- /dev/null
+++ b/arise-source/config/arise.conf
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+##############################################################
+# ARISE SITE CONFIG - Edit these variables to fit your website
+##############################################################
+
+# Set your base website URL here.
+export base_url='https://ari.se.net'
+
+# Set the path to your favicon. This should be an absolute path with reference to your siteroot.
+# This variable is only used for your RSS feed, hence why it only allows up to a singular image to be set. Your primary site favicons should be configured by editing the /config/header.html file.
+export favicon="/config/favicon/favicon.ico"
+
+# Set the global human-readable site name for your website. This string is usable in your site header as {{global_name}}. This is also used as the title for your RSS feed.
+export global_name="Arise"
diff --git a/arise-source/config/content_header.html b/arise-source/config/content_header.html
new file mode 100644
index 0000000..332168c
--- /dev/null
+++ b/arise-source/config/content_header.html
@@ -0,0 +1 @@
+// {{published_date}} // by {{author}}
diff --git a/arise-source/config/favicon/android-chrome-192x192.png b/arise-source/config/favicon/android-chrome-192x192.png
new file mode 100644
index 0000000..e39412a
Binary files /dev/null and b/arise-source/config/favicon/android-chrome-192x192.png differ
diff --git a/arise-source/config/favicon/android-chrome-256x256.png b/arise-source/config/favicon/android-chrome-256x256.png
new file mode 100644
index 0000000..764d962
Binary files /dev/null and b/arise-source/config/favicon/android-chrome-256x256.png differ
diff --git a/arise-source/config/favicon/apple-touch-icon.png b/arise-source/config/favicon/apple-touch-icon.png
new file mode 100644
index 0000000..410c13e
Binary files /dev/null and b/arise-source/config/favicon/apple-touch-icon.png differ
diff --git a/arise-source/config/favicon/browserconfig.xml b/arise-source/config/favicon/browserconfig.xml
new file mode 100644
index 0000000..14d054e
--- /dev/null
+++ b/arise-source/config/favicon/browserconfig.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+ #00aba9
+
+
+
diff --git a/arise-source/config/favicon/favicon-16x16.png b/arise-source/config/favicon/favicon-16x16.png
new file mode 100644
index 0000000..c73aa23
Binary files /dev/null and b/arise-source/config/favicon/favicon-16x16.png differ
diff --git a/arise-source/config/favicon/favicon-32x32.png b/arise-source/config/favicon/favicon-32x32.png
new file mode 100644
index 0000000..88eeb84
Binary files /dev/null and b/arise-source/config/favicon/favicon-32x32.png differ
diff --git a/arise-source/config/favicon/favicon.ico b/arise-source/config/favicon/favicon.ico
new file mode 100644
index 0000000..bcd4b86
Binary files /dev/null and b/arise-source/config/favicon/favicon.ico differ
diff --git a/arise-source/config/favicon/mstile-150x150.png b/arise-source/config/favicon/mstile-150x150.png
new file mode 100644
index 0000000..05c2c4c
Binary files /dev/null and b/arise-source/config/favicon/mstile-150x150.png differ
diff --git a/arise-source/config/favicon/safari-pinned-tab.svg b/arise-source/config/favicon/safari-pinned-tab.svg
new file mode 100644
index 0000000..0df0ee0
--- /dev/null
+++ b/arise-source/config/favicon/safari-pinned-tab.svg
@@ -0,0 +1,30 @@
+
+
+
diff --git a/arise-source/config/favicon/site.webmanifest b/arise-source/config/favicon/site.webmanifest
new file mode 100644
index 0000000..53521b0
--- /dev/null
+++ b/arise-source/config/favicon/site.webmanifest
@@ -0,0 +1,19 @@
+{
+ "name": "",
+ "short_name": "",
+ "icons": [
+ {
+ "src": "/config/favicon/android-chrome-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "/config/favicon/android-chrome-256x256.png",
+ "sizes": "256x256",
+ "type": "image/png"
+ }
+ ],
+ "theme_color": "#ffffff",
+ "background_color": "#ffffff",
+ "display": "standalone"
+}
diff --git a/arise-source/config/footer.html b/arise-source/config/footer.html
new file mode 100644
index 0000000..9fe5c3e
--- /dev/null
+++ b/arise-source/config/footer.html
@@ -0,0 +1,10 @@
+
+
+
+
+
+