73f355ceUpdate theme83ff50c2Use example.com in examples71292134Add alias news > release-notes2e15f642Update theme8eef09d2Add Pygments configuration572b9e75Clean up the code shortcode usea1b2fd3bRemove the code fence language codes1473b1d9Remove redundant textb92c2042Update theme8f439c28Edit contributing section in README8bcf8a19Add contributing section to README4c44ee1cFix broken content file2bdc7710Clarify .Data.Pages sorting in lists.md092271c2Use infinitive mood for main titlesb9b8abefUpdate theme to reflect change to home page contentb897b71bChange copy to use sentence casefd675ee5Enable RSS feed for sections060a5e27Correct movie title in taxonomies.md6a5ca96aUpdate displayed site name for Hub22f4b7a4Add example of starting up the local serverd9612cb3Update themea8c3988aUpdate theme4198189dUpdate theme12d6b016Update theme2b1c4197Update themeb6d90a1eFix News release titlescfe751dbAdd some build info to README git-subtree-dir: docs git-subtree-split:73f355ce0d
2.5 KiB
title, linktitle, description, date, publishdate, lastmod, categories, authors, menu, weight, sections_weight, draft, toc, wip, aliases
| title | linktitle | description | date | publishdate | lastmod | categories | authors | menu | weight | sections_weight | draft | toc | wip | aliases | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Host on GitLab | Host on GitLab | GitLab makes it incredibly easy to build, deploy, and host your Hugo website via their free GitLab Pages service, which provides native support for Hugo. | 2016-06-23 | 2016-06-23 | 2016-06-23 |
|
|
|
40 | 40 | false | true | false |
|
GitLab makes it incredibly easy to build, deploy, and host your Hugo website via their free GitLab Pages service, which provides native support for Hugo, as well as numerous other static site generators.
Assumptions
- Working familiarity with Git for version control
- Completion of the Hugo Quick Start
- A GitLab account
- A Hugo website on your local machine that you are ready to publish
Create .gitlab-ci.yml
cd your-hugo-site
In the root directory of your Hugo site, create a .gitlab-ci.yml file. The .gitlab-ci.yml configures the GitLab CI on how to build your page. Simply add the content below.
{{< code file="gitlab-ci.yml" >}} image: publysher/hugo
pages: script:
- hugo
artifacts:
paths:
- public only:
- master {{< /code >}}
Push Your Hugo Website to GitLab
Next, create a new repository on GitLab. It is not necessary to make the repository public. In addition, you might want to add /public to your .gitignore file, as there is no need to push compiled assets to GitLab or keep your output website in version control.
# initialize new git repository
git init
# add /public directory to our .gitignore file
echo "/public" >> .gitignore
# commit and push code to master branch
git add .
git commit -m "Initial commit"
git remote add origin https://gitlab.com/YourUsername/your-hugo-site.git
git push -u origin master
Wait for Your Page to Build
That's it! You can now follow the CI agent building your page at https://gitlab.com///pipelines.
After the build has passed, your new website is available at https://<YourUsername>.gitlab.io/<your-hugo-site>/.
Next Steps
GitLab supports using custom CNAME's and TLS certificates. For more details on GitLab Pages, see the GitLab Pages setup documentation.