a4885598fa | ||
---|---|---|
files | ||
galleries/demo | ||
images | ||
listings | ||
pages | ||
posts | ||
themes/custom | ||
.gitignore | ||
.gitlab-ci.yml | ||
conf.py | ||
readme.md |
readme.md
hope this works...
Example nikola website using GitLab Pages.
Learn more about GitLab Pages at https://pages.gitlab.io and the official documentation https://docs.gitlab.com/ce/user/project/pages/.
Table of Contents generated with DocToc
GitLab CI
This project's static Pages are built by GitLab CI, following the steps
defined in .gitlab-ci.yml
:
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.
Building locally
To work locally with this project, you can follow the steps below:
- Fork, clone or download this project
- Install Nikola
- Generate the website:
nikola build
- Preview your project:
nikola serve
- Add content
Read more at Nikola's documentation.
Alternatively, you can use the registry.gitlab.com/paddy-hack/nikola
Docker image. See the associated project's README for
more information.
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 namespace.gitlab.io
, where namespace
is
your username
or groupname
. This can be done by navigating to your
project's Settings.
Read more about user/group Pages and project Pages.
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
on the pages
job in the .gitlab-ci.yml
file.
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.
Troubleshooting
-
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
output
directory, but GitLab expects it inpublic
. So you must changeOUTPUT_FOLDER = "public"
inconf.py
or deploying will fail.Alternatively, you can add
mv output public
in the.gitlab-ci.yml
file after thenikola build
line.If you cloned this project as your starting point, then
conf.py
is already updated to build in thepublic
directory. -
I get a strange lexer exception
You are probably using extensions that require software not included in the
registry.gitlab.com/paddy-hack/nikola
image. For example, if your site has Ipython/Jupyter posts (that is,.ipynb
format viaPOSTS
orPAGES
inconf.py
) GitLab build won't be able to compile them, even if you locally can.The
registry.gitlab.com/paddy-hack/nikola
image includes thenikola[extras]
but not any additional software (likeipython
,pandoc
,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
.ipynb
support, edit the.gitlab-ci.yml
file and changepages: script: - pip3 install jupyter - nikola build
Forked from @sukiletxe