gabrielpoca

gabrielpoca

Hello everyone!

I want to share with you something that I’m really proud of: https://stillstatic.io/

Still is a static site builder for Elixir! Do you need to build a static website? This is what you want! We wanted to take a step back from the complications of building websites nowadays and have something simple and that just works, but that you can extend and grow in complexity if you need. Here are a few highlights:

  • Throw some HTML, Slime, Markdown, CSS, JS, and images into a folder, and it will just work.
  • Out of the box, it works with Slime and Markdown, but you can use EEx almost anywhere, such as in CSS, JS, or HTML files.
  • There’s a development server that watches the file system and refreshes the browser when necessary.
  • There’s an error overlay in the browser where you can see errors, the stacktrace, and more information on the context that leads to that error.
  • There are helper functions to generate links and responsive images, to include other files, etc.
  • We just finished an integration with Snowpack GitHub - still-ex/still_snowpack: Snowpack integration for Still · GitHub, which means that you can use tools like TailwindCSS or any other NPM package.

As far as I know, there isn’t anything like it. The idea is to keep it small but add enough functionality to allow anyone to build a modern website without having to reach for something more.

There are already a few people using it, but we would welcome contributors and users to improve it further!
Also, if you check out the website, I hope you enjoy the posters :slight_smile:https://stillstatic.io/

Showing Posts 1 to 10

matthieuchabert

matthieuchabert

Hi,

This looks very promising. I never tried Still but I’ve heard really good thing about it, I’ll try it for my next static website :slight_smile:

Thank you for contributing!

amnu3387

amnu3387

The page itself looks great (the posters too). I have searched before for a static site generator in elixir, great to see it.
I haven’t had time to check it through, only a superficial reading, does this work only as a static generator, or can you use it as phoenix app if you wanted to?
(because I have in my “backlog” the idea of having a phoenix app, that could spit a static website if wanted, but then could just be a normal app if the need ever comes, like nuxt does for instance)

derek-zhou

derek-zhou

Or the other way around: a static site that seamlessly integrated with a phoenix site, all built from the same source repo.

amnu3387

amnu3387

But I think that in that case it either it would have to be served as static assets, probably with some catch all route that forwarded to a router that would sit beneath the normal routes - but here you would basically loose the ability to “seamlessly” integrate other parts of phoenix, like having assigns, small helper/partial templates and such, or it would probably be quite difficult to glue it together into an existing static file in case you wanted those? I might also be misunderstanding what you envision.

derek-zhou

derek-zhou

I don’t have a grand vision of how to achieve this, but right now there is a disconnect between a static site (for the content web) and a dynamic site (for the application web). In many cases, the application web need to serve static contents, such as documentation, and the content web need to serve dynamic contents, like forum, e-commerce, etc. If there is a way to blend the 2 together seamlessly and use the best tool for the task, both the user experience and the development effort can be greatly improved.

gabrielpoca

gabrielpoca OP

I don’t know exactly what the integration with Pheonix would look like, but it’s something that’s on my mind, and I think there’s even an open issue for it. You can install Still in the app where you have Phoenix and compile the website priv/static during the build step of your deployment. Or you can compile it to anywhere in priv and use rules such as the ones we have the dev server to serve those assets. With that in place, I guess you can call anything from the templates. You could make queries to Ecto or something like that. I need to try this out.

the_wildgoose

the_wildgoose

This looks superb! Good luck with it!

If I could offer another project for inspiration, I love “pmwiki” and the way they have made the whole thing function by pages including other pages, and the use of metadata/variables that can be attached to each page. So it’s trivial to add a header section to a group of pages by just optionally creating another page which is only included if it exists. Breadcrumbs/prev/next links can be added by scanning metadata, or by examining content on an index page. A built in search feature can have its output fed through a formatter to do cool things like creating a blog index page, or a sidebar showing x latest posts, or y latest events, etc.

There is a point where stuff starts to get tricky with all site generators and you need to start coding. I think they did a great job of making it really trivial to introduce new features with very little code, often just through conditional insertion of pages, or torturing the search function, etc

Good luck with this!

ityonemo

ityonemo

It would be really fantastic if you could somehow have it be a runtime: false dependency so it does all the compiling at comptime and drops it into priv/static with an appropriate router module.

Exadra37

Exadra37

I was not aware of this nice Slime template engine:

https://github.com/slime-lang/slime

It seems that it’s inspired in Slim from Ruby and looks like a very clean template engine… need to give it a try :slight_smile:

gabrielpoca

gabrielpoca OP

That’s the idea and I believe it’s already possible. I need to try it out and document the process. You would run mix still.compile like you run mix phx.digest.

Where Next? Top

Trending in Announcing Top

wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 11030 135
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
fuelen
Hi all! I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas. You...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews