pages/INSTALL.md
George cc6284d18f
Improve readme, add site-wide CSP (#3485)
This pull request significantly expands and clarifies the documentation
for the al-folio Jekyll theme, focusing on improved file structure
explanations, enhanced quick reference guides, and the addition of a
comprehensive analytics setup guide. The changes make it easier for
users and contributors to understand the project organization, available
features, and configuration options, especially regarding CV formats,
teaching pages, and analytics integration.

**Key documentation and structure improvements:**

*Expanded file and collection structure:*
- The file structure documentation in
`.github/agents/customize.agent.md` and `.github/agents/docs.agent.md`
now details all major directories, including new and existing
collections such as `_books/`, `_teachings/`, `_scripts/`, `_plugins/`,
and expanded `assets/` subdirectories. It also covers new configuration
and utility files, making it easier for users to locate and understand
the purpose of each file or folder.
[[1]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L24-R66)
[[2]](diffhunk://#diff-961a46180ce568ce43c20bf7129dc5e4926a9aa4e0d7bc19926ca5ee3ff95cd0L17-R58)

*Documentation and quick reference enhancements:*
- The quick reference table in `.github/agents/customize.agent.md` has
been updated to include new actions like adding teaching pages, setting
up analytics, improving SEO, and ensuring accessibility, with more
precise documentation links.
- The documentation map now lists all major guides (e.g.,
`QUICKSTART.md`, `INSTALL.md`, `TROUBLESHOOTING.md`, `ACCESSIBILITY.md`,
`ANALYTICS.md`, `SEO.md`), providing a clearer overview of available
resources.
[[1]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L58-R110)
[[2]](diffhunk://#diff-961a46180ce568ce43c20bf7129dc5e4926a9aa4e0d7bc19926ca5ee3ff95cd0L17-R58)

**Feature and configuration documentation updates:**

*CV/resume format guidance:*
- The CV documentation now clarifies that users can maintain both
RenderCV and JSONResume formats simultaneously, with clear instructions
on switching between them and deleting unused files if desired.
[[1]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L139-R185)
[[2]](diffhunk://#diff-52f2a9488bfe4177d1f1d01120859dad0b3e2d087283ded68f72d47b4f183391L291-R291)

*Teaching pages and new collections:*
- Adds documentation for the new `_teachings/` collection, including
required frontmatter and support for course materials, as well as
updates to enable/disable teaching and books pages via `_config.yml`.
[[1]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L180-R252)
[[2]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L24-R66)

*Analytics integration:*
- Introduces a new `ANALYTICS.md` guide with detailed setup instructions
for Google Analytics, privacy-friendly alternatives (Plausible, Pirsch,
Openpanel, GoAccess), GDPR considerations, and a comparison table to
help users choose the right analytics provider.
- The configuration documentation now references analytics setup and
related configuration options.
[[1]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L180-R252)
[[2]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L479-R550)

These updates collectively make the documentation more comprehensive,
actionable, and user-friendly for both new and advanced users.

**References:**
[[1]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L24-R66)
[[2]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L58-R110)
[[3]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L139-R185)
[[4]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L180-R252)
[[5]](diffhunk://#diff-15864f2655921f50a97689076e3b8feba0da320463750845be6a76eb2e30bfe4L479-R550)
[[6]](diffhunk://#diff-961a46180ce568ce43c20bf7129dc5e4926a9aa4e0d7bc19926ca5ee3ff95cd0L17-R58)
[[7]](diffhunk://#diff-0967e840631a541bb95e057e1c6d4884274cf56d5a217d7fee2eb7223b6b4c0dR1-R268)
[[8]](diffhunk://#diff-52f2a9488bfe4177d1f1d01120859dad0b3e2d087283ded68f72d47b4f183391L291-R291)

---------

Signed-off-by: George Araújo <george.gcac@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-28 21:22:27 -03:00

16 KiB

Installing and Deploying

The recommended approach for using al-folio is to first create your own site using the template with as few changes as possible, and only when it is up and running customize it however you like. This way it is easier to pinpoint what causes a potential issue in case of a bug.

For the quickest setup, follow the Quick Start Guide, which will have you up and running in 5 minutes.

Important Notes for GitHub Pages Sites

If you plan to upload your site to <your-github-username>.github.io, the repository name ⚠️ MUST BE ⚠️ <your-github-username>.github.io or <your-github-orgname>.github.io, as stated in the GitHub pages docs.

When configuring _config.yml, set url to https://<your-github-username>.github.io and leave baseurl empty (do NOT delete it), setting it as baseurl:.

Automatic Deployment

Starting version v0.3.5, al-folio will automatically re-deploy your webpage each time you push new changes to your repository!

Local Development

Once everything is deployed, you can download the repository to your machine and start customizing it locally:

$ git clone git@github.com:<your-username>/<your-repo-name>.git

See Local setup using Docker or other sections below for local development options.

Local setup on Windows

If you are using Windows, it is highly recommended to use Windows Subsystem for Linux (WSL), which is a compatibility layer for running Linux on top of Windows. You can follow these instructions to install WSL and Ubuntu on your machine. You only need to go up to the step 4 of the tutorial (you don't have to enable the optional systemd nor the graphical applications), and then you can follow the instructions below to install docker. You can install docker natively on Windows as well, but it has been having some issues as can be seen in #1540, #2007.

Using Docker to install Jekyll and Ruby dependencies is the easiest way.

You need to take the following steps to get al-folio up and running on your local machine:

  • First, install docker and docker-compose.
  • Finally, run the following command that will pull the latest pre-built image from DockerHub and will run your website.
$ docker compose pull
$ docker compose up

Note that when you run it for the first time, it will download a docker image of size 400MB or so. To see the template running, open your browser and go to http://localhost:8080. You should see a copy of the theme's demo website.

Now, feel free to customize the theme however you like (don't forget to change the name!). Also, your changes should be automatically rendered in real-time (or maybe after a few seconds).

Beta: You can also use the slimmed docker image with a size below 100MBs and exact same functionality. Just use docker compose -f docker-compose-slim.yml up

Build your own docker image

Note: this approach is only necessary if you would like to build an older or very custom version of al-folio.

Build and run a new docker image using:

$ docker compose up --build

If you want to update jekyll, install new ruby packages, etc., all you have to do is build the image again using --force-recreate argument at the end of the previous command! It will download Ruby and Jekyll and install all Ruby packages again from scratch.

If you want to use a specific docker version, you can do so by changing latest tag to your_version in docker-compose.yaml. For example, you might have created your website on v0.10.0 and you want to stick with that.

Have Bugs on Docker Image?

Sometimes, there might be some bugs in the current docker image. It might be version mismatch or anything. If you want to debug and easily solve the problem for yourself you can do the following steps:

docker compose up -d
docker compose logs

Then you can see the bug! You can enter the container via this command:

docker compose exec -it jekyll /bin/bash

Then you can run the script:

./bin/entry_point.sh

You might see problems for package dependecy or something which is not available. You can fix it now by using

bundle install
./bin/entry_point.sh

Most likely, this will solve the problem but it shouldn't really happen. So, please open a bug report for us.

Local Setup with Development Containers

al-folio supports Development Containers. For example, when you open the repository with Visual Studio Code (VSCode), it prompts you to install the necessary extension and automatically install everything necessary.

Local Setup (Legacy, no longer supported)

For a hands-on walkthrough of running al-folio locally without using Docker, check out this cool blog post by one of the community members!

Assuming you have Ruby and Bundler installed on your system (hint: for ease of managing ruby gems, consider using rbenv), and also Python and pip (hint: for ease of managing python packages, consider using a virtual environment, like venv or conda).

$ bundle install
# assuming pip is your Python package manager
$ pip install jupyter
$ bundle exec jekyll serve

To see the template running, open your browser and go to http://localhost:4000. You should see a copy of the theme's demo website. Now, feel free to customize the theme however you like. After you are done, remember to commit your final changes.

Deployment

Deploying your website to GitHub Pages is the most popular option. Starting version v0.3.5, al-folio will automatically re-deploy your webpage each time you push new changes to your repository main branch!

For personal and organization webpages

  1. The name of your repository MUST BE <your-github-username>.github.io or <your-github-orgname>.github.io.
  2. In _config.yml, set url to https://<your-github-username>.github.io and leave baseurl empty.
  3. Set up automatic deployment of your webpage (see instructions below).
  4. Make changes to your main branch, commit, and push!
  5. After deployment, the webpage will become available at <your-github-username>.github.io.

For project pages

  1. In _config.yml, set url to https://<your-github-username>.github.io and baseurl to /<your-repository-name>/.
  2. Set up automatic deployment of your webpage (see instructions below).
  3. Make changes to your main branch, commit, and push!
  4. After deployment, the webpage will become available at <your-github-username>.github.io/<your-repository-name>/.

Enabling automatic deployment

  1. Click on Actions tab and Enable GitHub Actions; do not worry about creating any workflows as everything has already been set for you.
  2. Go to Settings -> Actions -> General -> Workflow permissions, and give Read and write permissions to GitHub Actions
  3. Make any other changes to your webpage, commit, and push to your main branch. This will automatically trigger the Deploy action.
  4. Wait for a few minutes and let the action complete. You can see the progress in the Actions tab. If completed successfully, in addition to the main branch, your repository should now have a newly built gh-pages branch. Do NOT touch this branch!
  5. Finally, in the Settings of your repository, in the Pages section, set the branch to gh-pages (NOT to main). For more details, see Configuring a publishing source for your GitHub Pages site.

If you keep your site on another branch, open .github/workflows/deploy.yml on the branch you keep your website on and change on->push->branches and on->pull\_request->branches to the branch you keep your website on. This will trigger the action on pulls/pushes on that branch. The action will then deploy the website on the branch it was triggered from.

Manual deployment to GitHub Pages

If you need to manually re-deploy your website to GitHub pages, go to Actions, click "Deploy" in the left sidebar, then "Run workflow."

Deploy on Netlify

  1. Use this template -> Create a new repository.

  2. Netlify: Add new site -> Import an existing project -> GitHub and give Netlify access to the repository you just created.

  3. Netlify: In the deploy settings

    • Set Branch to deploy to main
    • Base directory is empty
    • Set Build command to sed -i "s/^\(baseurl: \).*$/baseurl:/" _config.yml && bundle exec jekyll build
    • Set Publish directory to _site
  4. Netlify: Add the following two environment variables

    • Key Value
      JEKYLL_ENV production
      RUBY_VERSION set to the Ruby version found in .github/workflows/deploy.yml (for example, 3.3.5)
  5. Netlify: Click Deploy and wait for the site to be published. If you want to use your own domain name, follow the steps in this documentation.

Deployment to another hosting server (non GitHub Pages)

If you decide to not use GitHub Pages and host your page elsewhere, simply run:

$ bundle exec jekyll build

which will (re-)generate the static webpage in the _site/ folder. Then simply copy the contents of the _site/ directory to your hosting server.

If you also want to remove unused css classes from your file, run:

$ purgecss -c purgecss.config.js

which will replace the css files in the _site/assets/css/ folder with the purged css files.

Note: Make sure to correctly set the url and baseurl fields in _config.yml before building the webpage. If you are deploying your webpage to your-domain.com/your-project/, you must set url: your-domain.com and baseurl: /your-project/. If you are deploying directly to your-domain.com, leave baseurl blank, do not delete it.

Deployment to a separate repository (advanced users only)

Note: Do not try using this method unless you know what you are doing (make sure you are familiar with publishing sources). This approach allows to have the website's source code in one repository and the deployment version in a different repository.

Let's assume that your website's publishing source is a publishing-source subdirectory of a git-versioned repository cloned under $HOME/repo/. For a user site this could well be something like $HOME/<user>.github.io.

Firstly, from the deployment repo dir, checkout the git branch hosting your publishing source.

Then from the website sources dir (commonly your al-folio fork's clone):

$ bundle exec jekyll build --destination $HOME/repo/publishing-source

This will instruct jekyll to deploy the website under $HOME/repo/publishing-source.

Note: Jekyll will clean $HOME/repo/publishing-source before building!

The quote below is taken directly from the jekyll configuration docs:

Destination folders are cleaned on site builds

The contents of <destination> are automatically cleaned, by default, when the site is built. Files or folders that are not created by your site will be removed. Some files could be retained by specifying them within the <keep_files> configuration directive.

Do not use an important location for <destination>; instead, use it as a staging area and copy files from there to your web server.

If $HOME/repo/publishing-source contains files that you want jekyll to leave untouched, specify them under keep_files in _config.yml. In its default configuration, al-folio will copy the top-level README.md to the publishing source. If you want to change this behavior, add README.md under exclude in _config.yml.

Note: Do not run jekyll clean on your publishing source repo as this will result in the entire directory getting deleted, irrespective of the content of keep_files in _config.yml.

Maintaining Dependencies

al-folio uses Bundler (a Ruby dependency manager) to keep track of Ruby packages (called "gems") needed to run Jekyll and its plugins. For detailed information about dependency management, updating safely, testing, and handling breaking changes, see MAINTENANCE.md § Dependency Management.

Quick reference:

$ bundle update --all

After updating, test locally to ensure everything still works. If your site fails after updating, check the FAQ for troubleshooting.

Upgrading from a previous version

If you installed al-folio as described above, you can manually update your code by following the steps below:

# Assuming the current directory is <your-repo-name>
$ git remote add upstream https://github.com/alshedivat/al-folio.git
$ git fetch upstream
$ git rebase v0.16.3

If you have extensively customized a previous version, it might be trickier to upgrade. You can still follow the steps above, but git rebase may result in merge conflicts that must be resolved. See git rebase manual and how to resolve conflicts for more information. If rebasing is too complicated, we recommend re-installing the new version of the theme from scratch and port over your content and changes from the previous version manually. You can use tools like meld or winmerge to help in this process.