Static Website Generator ? - Want to learn Elixir

Hello everyone, I’m new here and I’ve no experience with Elixir at all.
My coding experience = beginner, I’ve done some basic Python in past while studing it. I’ve still to learn a lot. I’m doing some C++ too but, I’m just following some Unreal Engine tutorials.

I would like to learn a functional programming language and, to me, Elixir seems a good choice.
I’m not looking for a job as developer, but I want to do the best I can.

Right now I need to do a simple website.
I was looking for a static website generator and thought about using Hugo, Go lang, and host it on Netlify, because of basic free hosting and SSL.

Is there a good static website generator for Elixir ? Would Elixir with Phoenix be overkill for this simple project ?
I would like to avoid Go, Hugo since I’ve no plans, actually, to use it later.

I also admit that I’m a bit confused when I’ve to compare Elixir with Python, both general purpose languages.
I mean, I know Python is being used everywhere and is easy to understand what could be done with the language, It is just not so clear to me if Elixir could be used for the same “tasks” too.

Have a nice day.

1 Like

Have a look at this

Yes, Elixir with Phoenix would be overkill for this, since you would have to setup Erlang and Elixir environment on the server.

Phoenix is fast, but it will not beat simple Nginx rendering static content. Do not know how Netlify’s CDN is optimized though :slight_smile:

2 Likes

How big will the static site be? If only a few pages why not just create a html/css site perhaps with something like foundation css?

1 Like

Honestly it will be really small, just few pages, a simple basic business website to show what the “client” do, and a page for contact info.
You’re right I can do it with just html/css, didn’t know about foundation css, thank you.

This simple projects was more an excuse to practicing with Elixir :blush:

1 Like

Generators may help to structure the source, remove code duplication, simplify content population, automate build and deploy tasks.

1 Like

For note, I use Elixir and Phoenix (mostly its template helpers) on a static site generator that I built though it does handle an on-going API endpoint. Specifically:

It listens for incoming maven publish requests at a special url and dies very quickly if the user authentication is wrong or they try to publish to a place their user cannot access. When it receives the files from the maven publish it tells the generator process, which then reads the files that was added/changed, builds up a tree of everything that should update because those changed recursively, until it knows everything that needs an update, then regenerates, calls asciidoc to format the special files uploaded via the process, internal markdown for markdown files, processes files, processes image sets into galleries, etc… and dumps it all out in a static section (over sftp) based on the templates (which the user can specify their own for their own areas) that is dedicated for static site hosting by nginx, entirely non-dynamic, thus making the output site at https://gregtech.overminddl1.com/ for one of two examples. This replaces an older Python thing that did the same for a few years but was a bit of hell to upkeep, so I took the opportunity to write it in elixir when I refactored it. But as you can see the site is fully maven-capable, you can point, say, gradle to it and grab the jar’s for the API to make addons for it with ease except it also has a pretty human interface that is controlled solely from the maven publish. To actually upload to it you upload to a different subdomain on my site with an appropriate user and so forth. :slight_smile:

But yes, you can easily use Elixir (and phoenix template helpers, or use EEX straight without phoenix) to generate a static site, and putting it all in an escript could make it very easy to bundle too. :slight_smile:

1 Like