Example nikola website using GitLab Pages.
Table of Contents generated with DocToc
image: registry.gitlab.com/paddy-hack/nikola test: script: - nikola build except: - master pages: script: - nikola build artifacts: paths: - public only: - master
This uses the
registry.gitlab.com/paddy-hack/nikola Docker image,
which provides Nikola with all its extras, to build the site.
To work locally with this project, you can follow the steps below:
- Fork, clone or download this project
- Install Nikola
- Generate the website:
- Preview your project:
- Add content
Read more at Nikola's documentation.
Alternatively, you can use the
Docker image. See the associated project's README for
GitLab User or Group Pages
To use this project as your user/group website, you will need one additional
step: just rename your project to
groupname. This can be done by navigating to your
Using a different branch
If you keep code on the
master branch and want the website on a different one,
for example a
blog branch, then you must make the corresponding change
pages job in the
only: - blog
Did you fork this project?
If you forked this project for your own use, please go to your project's Settings and remove the forking relationship, which won't be necessary unless you want to contribute back to the upstream project.
CSS is missing! That means one of two things:
Either that you have set up the CSS URL in your templates incorrectly, or your static generator has a configuration option that needs to be set explicitly in order to serve static assets under a relative URL.
Building passes but deploy stage fails.
Nikola's default configuration will by default build the site in the
outputdirectory, but GitLab expects it in
public. So you must change
OUTPUT_FOLDER = "public"in
conf.pyor deploying will fail.
Alternatively, you can add
mv output publicin the
.gitlab-ci.ymlfile after the
If you cloned this project as your starting point, then
conf.pyis already updated to build in the
I get a strange lexer exception
You are probably using extensions that require software not included in the
registry.gitlab.com/paddy-hack/nikolaimage. For example, if your site has Ipython/Jupyter posts (that is,
conf.py) GitLab build won't be able to compile them, even if you locally can.
registry.gitlab.com/paddy-hack/nikolaimage includes the
nikola[extras]but not any additional software (like
latex, or any software you may have on your local system) that your extensions may require.
The fix is to install any extra software you need before building. In the case of
.ipynbsupport, edit the
.gitlab-ci.ymlfile and change
pages: script: - pip3 install jupyter - nikola build
Forked from @sukiletxe