Photo by Wolfgang Hasselmann on Unsplash
Setup Tips
Welcome!
In this blog post you are going to understand some basics and tips about how to best use this theme, how to install it's required tools and the commands you should get acquainted with.
Understand that this might be a shorter or longer learning journey, that is okay. If you are facing any issues be sure to:
- Talk with your comrades and try to learn together;
- Find a local tech-oriented collective (such as the ones in Riseup Collective radical servers list) and ask them for support;
- Read this theme's documentation and Zola's documentation;
- Open an issue on the theme's repository;
1. Reccomended tools
I personally use Flatpak with Flathub to install most of my software, this and other guides will assume this. Eitherway I will link official installation documentation for what we are reccomending.
Tool 1: git
Git is a distributed version control system, we will use it to control the versions of our website, facilitate collaboration and make it easy to update the theme when needed. Codeberg has great documentation on how to install git (and also free hosting for static websites, more on that later). You can find the official Git documentation here.
Tool 2: A code editor
Altough you can use only the terminal or a simple notepad to edit your static website, code editors exist to simplify the experience. I have 2 reccomendations for private and secure editors - VSCodium or Gram.
VSCodium is more established and common, so we will describe it's installation and setup process. Use whatever you prefer.
To install VSCodium you can:
- Paste the following command into your terminal:
flatpak install flathub com.vscodium.codium; - Open VSCodium's flathub page and click on "Install";
After that there is one setting we must change in order to use the terminal:
- Open VSCodium;
- Open the Settings (on the top-bar click on File > Preferences > Settings );
- On the top right of the Settings window click on the icon "Open Settings (JSON)";
- Copy the
host-spawn(reccomended) orflatpak-spawnconfiguration from here into the Settings JSON;
Altough VSCodium supports extensions, their security practices might worsen your device's security, please refrain from installing extensions.
Tool 3: Zola
This theme was made for the Zola static site generator, you need to have it installed on your device. Their installation page includes a lot of different operating systems, check there for any questions or issues.
To install Zola you can"
- Paste the following command into your terminal:
flatpak install flathub org.getzola.zola; - Open VSCodium's flathub page and click on "Install";
After that there is one thing we should change in order to make it simpler to use:
- Open the file
.bashrcin your user's home folder; - Paste the following at the end of it:
alias zola="flatpak run org.getzola.zola";
This way you can use zola serve instead of flatpak run org.getzola.zola serve.
2. Setting up your project
Now that you have everything you need, let's create a new project.
Start by opening your code editor (VSCodium if you are following this post), look at the top bar, click on File > Open Folder and choose a folder for your website's code, normally I use a folder Projects with individual projects there, for instance this theme is at Projects/conspire. This should open an empty folder.
With your folder open on VSCodium let's create a new Zola project. Open your terminal inside VSCodium, on the top right corner click on the Toggle Panel (or do ctrl + j) and navigate to the Terminal tab.
Initialize your Zola project by typing on the terminal: zola init or flatpak run org.getzola.zola init then anwering the questions that appear (any choices made can be changed by modifying the zola.toml file later):
- What is the URL of your site? (https://example.com): https://your-website.com
- Do you want to enable Sass compilation? [Y/n]: n
- Do you want to build a search index of the content? [y/N]: n
After that let's also initialize our git project and configure it. On the collaboration article you can find how to share your git project so other comrades can also edit it and how to keep it synced. To do that:
- On the terminal type:
git init; - Then type (replace NAME with an alias or the collective's name like "Larus Argentatus", "Anonymous" or "The Flock" ):
git config user.name "NAME"; - Then type (replace EMAIL with an alias or the collective's email ):
git config user.email "EMAIL";
Now that we have everything setup, we just need to install this theme as a git submodule, to do that we only have to type this into the terminal:
git submodule add https://codeberg.org/larus-argentatus.conspire.git themes/conspire
To startup your usage of this theme, do this:
- Make the setup script executable:
chmod +x themes/conspire/scripts/setup.sh; - Run the setup script:
./themes/conspire/scripts/setup.sh;
What will the script do?
- Copy essential files, such as
zola.tomland.gitignore; - Install Git Hooks, such as:
- Pre commit file and image metadata cleaner using mat2;
- Make the other scripts executable;
Short checklist
- Install git, a code editor and Zola;
- Create a new folder;
- Initialize Zola project;
- Initialize git project;
- Install theme as submodule;
- Run setup script;