# ElmStatic with GitLab pages (and Netlify CMS)?

**URL:** https://discourse.elm-lang.org/t/elmstatic-with-gitlab-pages-and-netlify-cms/3880
**Category:** Learn
**Created:** [June 26, 2019, 4:26pm UTC](https://discourse.elm-lang.org/t/elmstatic-with-gitlab-pages-and-netlify-cms/3880 "2019-06-26T16:26:30Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![heyakyra](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/heyakyra/32/2295_2.png) [@heyakyra](https://discourse.elm-lang.org/u/heyakyra)
#### Post date: [June 26, 2019, 4:26pm UTC](https://discourse.elm-lang.org/t/elmstatic-with-gitlab-pages-and-netlify-cms/3880/1 "2019-06-26T16:26:30Z")

</div>

I’m new to Elm and Elmstatic but I’m excited to use them for a few projects. I’d like to be able to manage it with Netlify CMS and host it on GitLab pages.

_ **Side note:** The [documentation for the former](https://www.netlifycms.org/docs/add-to-your-site/#app-file-structure) now lists Elmstatic after I created a merge request_ to do so! Hopefully that brings more attention to Elm and Elmstatic from Netlify CMS users 🙂  
\* github netlify/netlify-cms/pull/2399

I filed a [bug report](https://github.com/alexkorban/elmstatic/issues/6) for this, but I’m wondering if anyone has already gotten Elmstatic to build with the GitLab CI, and whether they could share a yml config file to do so!

---

<div class="post-metadata">

### Author: ![RyanNHG](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/ryannhg/32/5162_2.png) [@RyanNHG](https://discourse.elm-lang.org/u/RyanNHG)
#### Post date: [June 27, 2019, 1:21pm UTC](https://discourse.elm-lang.org/t/elmstatic-with-gitlab-pages-and-netlify-cms/3880/2 "2019-06-27T13:21:15Z")

</div>

Hey Kyra! 👋

I’m Ryan and I commented on your Elmstatic thread a few days ago in the #elm-dev channel! Thanks again for sharing it with the community!

I’m currently building an architecture site with a friend, and I somehow convinced him that we should build the frontend using Elm, instead of JavaScript. Muahahaha 😈

For us, it was also important for us to provide a solution like Netlify CMS so that our client could easily update content through a UI. For this project, we’re using Forestry, but it does the same thing. (I’ve used Netlfiy CMS on my last project, and they’re both great tools!)

Instead of using Elmstatic (which you taught me about a few days ago 😅), I decided to use a slightly more popular static site generator called Hugo.

Hugo turns the markdown files into HTML and JSON API endpoints for me, and passes the content in as flags to the Elm application. Having the JSON API allows me to do client-side navigation and cool things like page transitions!

The site build is still in progress, so the repo is private for now. but if you’re interested in learning more, I’d be happy to walk you through how I set it up!

Just reach out on the Elm Slack 😄

Long term, I’d like to share my experience with the rest of the Elm community. Maybe that’s a blog post or YouTube tutorial, but I want to wrap up the project first haha.

I figured your use case was more time sensitive so I should post here!

Here’s the stack I’m using:  
Hosting: [Netlify](https://www.netlify.com)  
Backend: [Hugo](https://www.gohugo.io)  
CMS: [Forestry](https://www.forestry.io)  
Frontend: [Elm](https://elm-lang.org)

**Have a great day!**  
Ryan

---

<div class="post-metadata">

### Author: ![dirkbj](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/dirkbj/32/3162_2.png) [@dirkbj](https://discourse.elm-lang.org/u/dirkbj)
#### Post date: [June 27, 2019, 9:31pm UTC](https://discourse.elm-lang.org/t/elmstatic-with-gitlab-pages-and-netlify-cms/3880/3 "2019-06-27T21:31:38Z")

</div>

I’d be interested in reading about your experience with this project.

---

<div class="post-metadata">

### Author: ![dnk8n](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/dnk8n/32/2131_2.png) [@dnk8n](https://discourse.elm-lang.org/u/dnk8n)
#### Post date: [June 29, 2019, 3:25pm UTC](https://discourse.elm-lang.org/t/elmstatic-with-gitlab-pages-and-netlify-cms/3880/4 "2019-06-29T15:25:14Z")

</div>

Also keen to follow this. Using Hugo as a backend, with Elm as a front-end is an interesting approach and not one I thought was possible (I need to learn more about Hugo though).  
Does Elm produce some more robust html/css/JavaScript than Hugo does?

Can you point me to docs that show how to generate a static JSON API using Hugo (or am I misunderstanding? Also, by JSON API, is that the same as REST?).

I found this by searching “Elm” and “NetlifyCMS” in Google just now.

I want to produce minimal elm that will open up all the features of NetlifyCMS. What does Elmstatic add that Elm doesn’t on its own? I am guessing the ability to drop in a markdown file to a directory and have it rendered according to the rest of the App?

I am going to research Elmstatic more now (only just found out about it. If I get to my own questions before anyone else, I will include some answers as I understand them.

---

<div class="post-metadata">

### Author: ![RyanNHG](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/ryannhg/32/5162_2.png) [@RyanNHG](https://discourse.elm-lang.org/u/RyanNHG)
#### Post date: [July 2, 2019, 8:32pm UTC](https://discourse.elm-lang.org/t/elmstatic-with-gitlab-pages-and-netlify-cms/3880/5 "2019-07-02T20:32:53Z")

</div>

Hey @dnk8n!

I created a JSON API endpoint by following this tutorial:

> **[Build a JSON API With Hugo's Custom Output Formats](https://forestry.io/blog/build-a-json-api-with-hugo/)**
>
> In this article, we create simple read-only API with the static site generator Hugo to build a JSON API using its Custom Output Formats feature.

Hopefully, the project will be open source soon, and you can check out a real example then.

Thanks,  
Ryan

---

<div class="post-metadata">

### Author: ![heyakyra](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/heyakyra/32/2295_2.png) [@heyakyra](https://discourse.elm-lang.org/u/heyakyra)
#### Post date: [July 3, 2019, 1:54am UTC](https://discourse.elm-lang.org/t/elmstatic-with-gitlab-pages-and-netlify-cms/3880/6 "2019-07-03T01:54:32Z")

</div>

> [@heyakyra](#):
>
> I’m wondering if anyone has already gotten Elmstatic to build with the GitLab CI, and whether they could share a yml config file to do so!

I struggled it out on my own, and the files needed are listed in the [aforementioned ticket](https://github.com/alexkorban/elmstatic/issues/6#issuecomment-507506280).

> [@heyakyra](#):
>
> I’d like to be able to manage it with Netlify CMS

Digging a bit deeper into this, Netlify CMS is a bit coupled with their hosted services, although the necessary bits are the identity services which are thankfully Free Software. There are a couple of things that require hosting by someone, other than the website itself. I really wish there was a user-friendly (for non-coders) desktop app for editing markdown files and committing them to a git repository.

So I have to decide if it’s worth hosting the [Git Gateway and GoTrue API microservice](https://www.netlifycms.org/docs/authentication-backends/#git-gateway-without-netlify) (or some other identity service) on my own and give that a shot.

---

<div class="post-metadata">

### Author: ![dnk8n](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/dnk8n/32/2131_2.png) [@dnk8n](https://discourse.elm-lang.org/u/dnk8n)
#### Post date: [July 6, 2019, 1:19pm UTC](https://discourse.elm-lang.org/t/elmstatic-with-gitlab-pages-and-netlify-cms/3880/7 "2019-07-06T13:19:02Z")

</div>

> [@heyakyra](#):
>
> I really wish there was a user-friendly (for non-coders) desktop app for editing markdown files and committing them to a git repository.

Do you mean something like [HokusCMS](https://youtu.be/o9A50oX0Y0I)? That is coupled with Hugo though. But that kind of workflow I mean?

- A desktop app that can start a local server (for preview)
- manipulate the underlying files from a nice looking CMS
- Handle how to commit (CI takes care of the rest for live deployment)

---

<div class="post-metadata">

### Author: ![heyakyra](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/heyakyra/32/2295_2.png) [@heyakyra](https://discourse.elm-lang.org/u/heyakyra)
#### Post date: [July 8, 2019, 12:04pm UTC](https://discourse.elm-lang.org/t/elmstatic-with-gitlab-pages-and-netlify-cms/3880/8 "2019-07-08T12:04:06Z")

</div>

Yes, [https://getpublii.com/](https://getpublii.com/) is another example!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)
#### Post date: [July 18, 2019, 12:04pm UTC](https://discourse.elm-lang.org/t/elmstatic-with-gitlab-pages-and-netlify-cms/3880/9 "2019-07-18T12:04:08Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
