README.md 2.51 KB
Newer Older
Achilleas Pipinellis's avatar
Achilleas Pipinellis committed
1
2
3
4
5
![Build Status](https://gitlab.com/pages/mkdocs/badges/master/build.svg)

---

Example [MkDocs] website using GitLab Pages.
morph027's avatar
morph027 committed
6
7

Learn more about GitLab Pages at https://pages.gitlab.io and the official
Achilleas Pipinellis's avatar
Achilleas Pipinellis committed
8
9
10
documentation https://docs.gitlab.com/ce/user/project/pages/.

---
morph027's avatar
morph027 committed
11
12
13
14
15
16
17

## GitLab CI

This project's static Pages are built by [GitLab CI][ci], following the steps
defined in [`.gitlab-ci.yml`](.gitlab-ci.yml):

```
18
image: python:3.8-buster
morph027's avatar
morph027 committed
19
20

before_script:
21
22
23
24
25
26
27
28
29
30
31
  - pip install -r requirements.txt

test:
  stage: test
  script:
  - mkdocs build --strict --verbose --site-dir test
  artifacts:
    paths:
    - test
  except:
  - master
morph027's avatar
morph027 committed
32
33

pages:
34
  stage: deploy
morph027's avatar
morph027 committed
35
  script:
36
  - mkdocs build --strict --verbose
morph027's avatar
morph027 committed
37
38
39
40
41
42
43
44
45
46
47
48
  artifacts:
    paths:
    - public
  only:
  - master
```

## Building locally

To work locally with this project, you'll have to follow the steps below:

1. Fork, clone or download this project
Achilleas Pipinellis's avatar
Achilleas Pipinellis committed
49
50
51
1. [Install][] MkDocs
1. Preview your project: `mkdocs serve`,
   your site can be accessed under `localhost:8000`
morph027's avatar
morph027 committed
52
53
54
1. Add content
1. Generate the website: `mkdocs build` (optional)

Achilleas Pipinellis's avatar
Achilleas Pipinellis committed
55
Read more at MkDocs [documentation][].
morph027's avatar
morph027 committed
56
57
58
59
60
61
62
63
64

## 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**.

You'll need to configure your site too: change this line
Achilleas Pipinellis's avatar
Achilleas Pipinellis committed
65
in your `mkdocs.yml`, from `"https://pages.gitlab.io/mkdocs/"` to
Achilleas Pipinellis's avatar
Achilleas Pipinellis committed
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
`site_url = "https://namespace.gitlab.io"`.

Read more about [user/group Pages][userpages] and [project Pages][projpages].

## 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

1. CSS is missing! That means two things:

    Either that you have wrongly set up the CSS URL in your templates, or
    your static generator has a configuration option that needs to be explicitly
    set in order to serve static assets under a relative URL.

[ci]: https://about.gitlab.com/gitlab-ci/
[mkdocs]: http://www.mkdocs.org
[install]: http://www.mkdocs.org/#installation
[documentation]: http://www.mkdocs.org
[userpages]: https://docs.gitlab.com/ce/user/project/pages/introduction.html#user-or-group-pages
[projpages]: https://docs.gitlab.com/ce/user/project/pages/introduction.html#project-pages

---
morph027's avatar
morph027 committed
92

Achilleas Pipinellis's avatar
Achilleas Pipinellis committed
93
Forked from https://gitlab.com/morph027/mkdocs