I have a folder with a bunch of markdown in it for a blog backed by Phoenix. I parse the markdown on application start and put it in a :persistent_term
so that when you visit the site, I’m serving the blog out of memory - no database required.
It works fine locally, however when I’m setting things up to deploy on Gigalixir the markdown is seemingly not available anywhere. I’ve tried putting the files in the priv
directory, in assets
, and in the root of the project (where I’d prefer to keep them).
A few questions:
- What would be the “right” way to bundle markdown files along with a Phoenix app? I don’t care if I compile it ahead of time or on application start, so any thoughts on the best way to serve this content up are welcome.
- Where should static files go in an Elixir app? The markdown parsing isn’t strictly a phoenix concern, so I expect the answer to be a general Mix project question. Even so, if there’s an easy way to solve this with Phoenix, that’s fine too.
- Is there a way to achieve this where I keep my markdown at the root of my project, or in a git submodule, with Gigalixir?