Skip to main content
  1. Documentation/

Installation

3 mins

Getting Hugo #

This theme is meant to be used with the hugo static site generator. To get hugo on your platform, please follow their installation instructions.

Create a new site #

These instructions are taken from the Hugo quick start guide. Creating a new site with Hugo is done via

hugo new site quickstart

replacing quickstart with the actual folder name you want for your site. You can then navigate to the corresponding folder and initialize a git repository

cd quickstart
git init .

Setup the liris theme #

To easily keep a reference and be able to update the theme when bugs are fixed, the easiest is to setup the theme as a git submodule.

git submodule add https://gitlab.liris.cnrs.fr/cell-si/hugo-theme-liris themes/liris

This will populate the themes/liris directory with the theme data. To setup your site with the theme, you can then replace the current site configuration with that of the example site you are presently reading, located at themes/hugo/exampleSite. Assuming you are at the root of the project :

rm -f hugo.toml
cp -r themes/liris/exampleSite/config .

You can now visualize your website by issuing the following command at the root of your site and following the instructions to point a web browser to the served site, usually localhost:1313.

hugo server

You can now go on with the theme configuration.

Optionally commit and push #

Now is probably a good time for your to commit and backup your work. Hugo is a static site generator and therefore automatically generates files from your input. These generated files should not be tracked by git. This can be prevented by adding paths to these files to a .gitignore file. In a simple setting the following commands issued at the root of your project will do that.

echo public/ >> .gitignore
echo .hugo_build.lock >> .gitignore

You can always check the untracked files using git status. You can now add the desired files to your commit, and if everything is to be tracked, this can be done by simply adding the root directory. After adding you can finally create your commit.

git add .
git commit -m "initial commit"

Of course, you can replace initia commit with any other message suited to your needs. If you want to push your website on the LIRIS gitlab for sharing, backup, or to use the webIDE there to edit the website in your web browser, you must first configure a remote for your local git repository.

git remote add origin https://gitlab.liris.cnrs.fr/ada/quickstart

In the above line, replace ada/quickstart by your desired group and repository name on gitlab. By default as a LIRIS member, you have your own group to create your private repositories, so you can replace ada in the above with your LIRIS user. You can then proceed with a push, with an additional option to setup your local main branch to track the remote main branch.

git push --set-upstream origin main

Note that there is no need for an empty repository to be created beforehand on the gitlab, this push will create the repository automatically. If a non empty repository already exists with the provided group and name, the above will fail, requiring a merge.