/README.md

https://gitlab.com/jtojnar/hakyll · Markdown · 107 lines · 79 code · 28 blank · 0 comment · 0 complexity · dce4ef3a5ebea379fce1303fda6941b2 MD5 · raw file

  1. ![Build Status](https://gitlab.com/pages/hakyll/badges/master/build.svg)
  2. ---
  3. Example [Hakyll] website using GitLab Pages.
  4. Learn more about GitLab Pages at https://pages.gitlab.io and the official
  5. documentation http://doc.gitlab.com/ee/pages/README.html.
  6. ---
  7. <!-- START doctoc generated TOC please keep comment here to allow auto update -->
  8. <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
  9. **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
  10. - [GitLab CI](#gitlab-ci)
  11. - [Building locally](#building-locally)
  12. - [GitLab User or Group Pages](#gitlab-user-or-group-pages)
  13. - [Did you fork this project?](#did-you-fork-this-project)
  14. - [Getting help](#getting-help)
  15. <!-- END doctoc generated TOC please keep comment here to allow auto update -->
  16. ## GitLab CI
  17. This project's static Pages are built by [GitLab CI][ci], following the steps
  18. defined in [`.gitlab-ci.yml`](.gitlab-ci.yml):
  19. ```
  20. stages:
  21. - build_image
  22. - pages
  23. build_image:
  24. stage: build_image
  25. image: docker:git
  26. services:
  27. - docker:dind
  28. script:
  29. - export site_hash=`find src .gitlab-ci.yml stack.yaml *.cabal Dockerfile | LC_ALL=C sort | cpio -o --quiet | sha512sum | cut -c 1-128`
  30. - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
  31. - docker pull registry.gitlab.com/$CI_PROJECT_SLUG:$site_hash || docker build -t registry.gitlab.com/$CI_PROJECT_SLUG . ; docker push registry.gitlab.com/$CI_PROJECT_SLUG:$site_hash
  32. only:
  33. - master
  34. pages:
  35. stage: pages
  36. image: registry.gitlab.com/$CI_PROJECT_SLUG:$site_hash
  37. cache:
  38. paths:
  39. - _cache
  40. script:
  41. - site build
  42. artifacts:
  43. paths:
  44. - public
  45. only:
  46. - master
  47. ```
  48. Initial build and each time you change the Haskell source may take some time (rebuilding the Docker image takes around 30 minutes), following builds will be significantly faster.
  49. It is recommended to follow changes in this repository, in case we come up with a better way to build the hakyll site. Any improvement ideas are, of course, welcome.
  50. ## Building locally
  51. To work locally with this project, you'll have to follow the steps below:
  52. 1. Fork, clone or download this project
  53. 1. [Install][] Hakyll.
  54. 1. Generate the website: `stack exec site build`
  55. 1. Preview your project: `stack exec site watch`
  56. 1. Add content
  57. Read more at Hakyll's [documentation][hakyll].
  58. ## GitLab User or Group Pages
  59. To use this project as your user/group website, you will need one additional
  60. step: just rename your project to `namespace.gitlab.io`, where `namespace` is
  61. your `username` or `groupname`. This can be done by navigating to your
  62. project's **Settings**.
  63. Read more about [user/group Pages][userpages] and [project Pages][projpages].
  64. ## Did you fork this project?
  65. If you forked this project for your own use, please go to your project's
  66. **Settings** and remove the forking relationship, which won't be necessary
  67. unless you want to contribute back to the upstream project.
  68. ## Getting help
  69. * [Tutorials](https://jaspervdj.be/hakyll/tutorials.html)
  70. * [Google discussion group](https://groups.google.com/forum/#!forum/hakyll)
  71. * [Hakyll on StackOverflow](https://stackoverflow.com/questions/tagged/hakyll)
  72. ---
  73. Forked from https://gitlab.com/jtojnar/hakyll
  74. [ci]: https://about.gitlab.com/gitlab-ci/
  75. [hakyll]: https://jaspervdj.be/hakyll/
  76. [install]: https://jaspervdj.be/hakyll/tutorials/01-installation.html
  77. [documentation]: http://link-to-main-documentation-page
  78. [userpages]: http://doc.gitlab.com/ee/pages/README.html#user-or-group-pages
  79. [projpages]: http://doc.gitlab.com/ee/pages/README.html#project-pages