Invariable is a straightforward, easy-to-use application designed to help you create and manage static websites. Crafted with love in Elixir, it incorporates a few select tools to ensure your website building process is as smooth and efficient as possible:
- Nimble Publisher for managing your content with ease,
- Tailwind CSS for stylish, responsive designs, managed via a Mix task in the
mix.ex
file at the root, - DaisyUI for adding a splash of user-friendly components, managed through NPM in the
package.json
file within the assets directory.
- A simple system for pages and blog posts, utilizing static Markdown files for content creation.
- YAML-driven navigation, making it straightforward to customize your site's main navigation menu.
- Automatic deployment via GitHub Actions, enabling content updates directly through GitHub.
- A collection of convenient styles and components courtesy of Tailwind CSS and DaisyUI.
Invariable aims to simplify the website creation process, allowing you to use GitHub Actions to automatically generate a static site. This site can then be hosted directly from your GitHub repository as a GitHub Page, following the straightforward setup process detailed below.
- Fork this repository to create a new repo under your account or organization.
- Copy the contents of
/example_content_src/
and put them in/content_src
cp -r example_content_src/* content_src
- Compile the content
mix site.build
- Server the content locally
mix run --no-halt
-
Generate a Personal Access Token (PAT) for CI/CD:
- Navigate through: User Settings → Developer Settings → Personal Access Tokens → Tokens (classic).
- Click on "Generate new token (classic)," add a note for clarity, and choose 'No Expiration' for longevity. Remember, security is key, so be sure to understand and manage the risks associated with this token.
- Copy the newly generated PAT for later use.
-
Create a Secret for Your Repository:
- Go to Repo Settings → Secrets and variables → Repository secrets → New Repository secret.
- Name it
PAT
and paste in your generated token.
-
Prepare Your Content:
- Create a new branch named
web
. - Update the
content_src/site_config.yml
with your site's name, description, and clean up any placeholder navigation links.
- Create a new branch named
-
Configure GitHub Actions:
- In the
web
branch, adjust the.github/workflows/deploy.yml
file to trigger on pushes to theweb
branch.
- In the
-
Launch Your Site:
- After your changes trigger the GitHub Actions, a
gh-pages
branch will be created. - Set your GitHub Pages source to the
gh-pages
branch in your repository settings.
- After your changes trigger the GitHub Actions, a
Congratulations! 🎉 Your site should now be live.
- Custom Domain: If you're using a custom domain, update the CNAME in
.github/workflows/deploy.yml
. Uncomment and modify thecname
field as needed. If not using a custom domain, ensure your repository name meets GitHub Pages' requirements.
Invariable is all about making web development accessible and manageable, whether you're a seasoned developer or new to the scene. Enjoy building your site!