8

So I know that GitLab pages can be employed to generate a static website from a project's repository. What I'd like to do however, is generate a static site from a project's wiki, which is a separate repository.

I also know that I could hook a static site generator to the webhook event for notifying wiki changes. I am trying to work out if this obvious (to me) use-case was anticipated and made possible via GitLab's pages feature, which has a simpler set-up, or if I really do need to resort to webhooks.

So far as I can tell, it wasn't, and I do, but possibly there are ways which just haven't been well described anywhere I can find.

Finally: the reason I want to do this is, GitLab's wiki seems to have a UI tailored to make it work more like a wiki than the repository's UI. This will I hope make it more useful/less hostile to the potentially non-technical users I foresee using it.

wu-lee
  • 749
  • 4
  • 17

1 Answers1

6

I don't think this feature is available yet, even though it would definitely be very useful.

You could try the following workaround:

Set up your project wiki's repository as an external repository.
https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/

This will setup repository mirroring, enabling automatic pull updates from your wiki repository to a new regular GitLab project repository. You can then use the regular GitLab CI and GitLab Pages feature to generate a static site from the wiki.

More information about repository mirroring: https://docs.gitlab.com/ee/workflow/repository_mirroring.html


Example Project (Edit)

I have now made a basic (open-source) example for doing this, it actually works very well, you can browse its source and have a look at the wiki at https://gitlab.com/tkainrad/wiki2docs.
The generated site is located at https://tkainrad.gitlab.io/wiki2docs

You might even find that having a layer between your Wiki and the actual live site is useful.

This workaround together with GitLab Pages provides a lot of possibilities, and enables completely free hosting of wiki or documentation sites, while maintaining an easy EDIT-interface for non-technical contributors.

Thomas Kainrad
  • 2,542
  • 21
  • 26
  • 1
    Thanks - I'm not sure if that's simpler or not though. I'll need to read those pages carefully. – wu-lee Jan 31 '19 at 16:46
  • 1
    I have now made an example project, creating a static documentation page from a project's wiki. The whole thing works surprisingly well. – Thomas Kainrad Feb 09 '19 at 16:38
  • @ThomasKainrad Thank you for these examples, I succeeded to serve it locally however I have one question. In my case I created a repo only for the wiki. Can I generate the static website by only adding the docs folder, the mkdocs config file and the .gitlab-ci.yml in the main repo? Or do I have to do a first file push to the wiki to update the website. I am struggling on this repository mirroring thing. – Paul Endymion Sep 30 '21 at 10:21