Eleventy and Cloudron
-
Hello folks,
I've been experimenting with the shiny 11ty static site generator locally deploying it using github + netlify.
But I wonder if something like this can be done using my Cloudron infrastructure. I've been reading some blogposts related here in the forum but I haven't found a clear way to do it.
An ideal scenario would be to edit the files locally, being able to push those files to Gitea (although my understanding is that this is not possible) and then being served in Surfer. Or something like this.
Would something like this possible? Any guidance is appreciated. Thanks!
-
Assuming this is just for you, and not that you want to build out a hosting infrastructure for many people...
Not quite what you're looking for, but you could
- Render the 11ty site locally.
- Push it to a LAMP stack or similar on Cloudron.
https://forum.cloudron.io/topic/4042/beginner-s-guide-hugo-gitlab-ci-surfer
suggests a path where you're hosting both Gitlab and runners, which feels heavy. I think Nebulon wrote about this:
https://forum.cloudron.io/topic/1118/hugo-cms/3?_=1717342765687
with Hugo. He used Surfer
https://docs.cloudron.io/apps/surfer/
which would, potentially, do everything you need. You could do your build, and then push the resulting build outputs (
_site
or similar; I forget what 11ty spits out) to your server using the Surfer CLI.I've done this for many sites over the years; typically, it's been a recursive
scp
to sync the build output to the remote host. I've wondered about a setup like you describe, but ultimately, I'm just as happy:- Having a git(tea/lab) instance that hosts my code
- Doing the test and build locally.
- Taking the resulting build product and pushing it to the web host.
The number of moving pieces to connect up Gitlab/Netlify (now Decap) is more than I would want to do on any given evening, but your mileage may vary. I've been wondering about moving a domain to cloudron, and all it has is one static website. This might be the path I go (that is, use Surfer on Cloudron to be my webhost).
-
Thanks. Yeah, that worked.
Just for other people confused as I was: for the Surfer option there's not a need to deploy the site for make it public (such as in using Netlify), but just upload the public folder (just the public folder) to the root in Surfer such as:
surfer put public/* /
(the
*
is important because otherwise it will upload the public folder to the root and not the files within it)In case you want to optimize that I'm sure there are ways with a cron and such, but that's another story. For instance, I decided to just use my private Gitea instance for keeping the code hosted outside.
-
If you want some CI/CD inspiration with GitLab + static asset hosting, you can look at our docs repo. It builds using mkdocs and then pushes the build to surfer . See https://git.cloudron.io/cloudron/docs/-/blob/master/.gitlab-ci.yml?ref_type=heads .
The build server is a separate VM running gitlab runner (but only costs around 5 a month).
-
-