GitLab Pages
How to deploy Lotus Docs on GitLab Pages
Overview
With GitLab Pages, you can publish your Lotus Docs themed site directly from a repository in GitLab.
- Use for any personal or business website.
- Native support for Hugo.
- Create websites for your projects, groups, or user account.
- Host your site on your own GitLab instance or on GitLab.com for free.
- Connect your custom domains and TLS certificates.
- Attribute any license to your content.
GitLab Pages makes it easy to build, deploy, and host your Lotus Docs website.
Prerequisites
Procedure
Use the following steps to get your Lotus Docs site up and running on GitLab Pages.
Create a new repo on GitLab e.g.
https://gitlab.com/colinwilson/colinwilson.gitlab.io
. SelectGitLab Pages
as theProject deployment target
:Create a new Hugo project using the
hugo new
command:Initialize your project as a Hugo Module using the hugo mod init command:
Update your site’s config file (
hugo.toml
/hugo.yaml
/hugo.json
) to include the required theme modules and update yourbaseURL
to your intended GitLab Pages domain e.g.colinwilson.gitlab.io
. You can also configure a[[menu.primary]]
item. This creates a link on the landing page to thedocs/
section.Refer to the quickstart guide if you wish install the Lotus Docs theme in a manner other than Hugo Modules (below).
Create some example content.
Update the front matter
draft
parameter in the createdexample-page.md
file tofalse
.Create an empty
.gitlab-ci.yml
file at the root of your local repository.Copy and paste the YAML below into the job file you created.
Create a
.gitignore
file. Copy the contents below into it. This prevents your local/public
directory (and other resources) being committed to to your GitLab repository.Your site structure should now look similar to the one below:
Use
git int
to initialize your project as a repository, then commit all the changes to your local repository with a commit message of something like “🎉 initial commit”. Push your local repo to the repository you created on GitLab instep 1
.Revisit your repository on GitLab, navigate to Build > Pipelines, and you should see that your Hugo site was successfully built.
- You should now be able to see your site at the
baseURL
(e.g.https://colinwilson.gitlab.io
) defined in yourhugo.toml
/hugo.yaml
/hugo.json
config file
Last updated 2 months ago.