Netlify provides free hosting of non-commerecial static sites and builds automatically from a repository.
Once Netlify is configured, every time you push to github your site will be updated.
Short instructions
- In content/config.edn set
:blog-prefix
to""
. - Make sure git is tracking public/.
- Leave the Netlify build instructions blank.
- Set Netlify's "Publish directory" to "public".
- Do
lein run
to generate public/. - Push at least the public/ folder, but you can push everything to github and Netlify will only show what's in public/.
Long instructions
- Make a Netlify account.
- Make a github, bitbucket, or gitlab repo.
- Connect Netlify to your blog repo.
- In content/config.edn set
:blog-prefix
to""
- Have git track public/ . It may be helpful to edit your .gitignore.
- set Netlify's "Publish directory" to "public".
- Leave Netlify's build instructions blank.
- Do
lein run
to generate public/. - Push at least the public/ folder, but you can push everything to the repo and Netlify will only show what's in public/.
Troubleshooting
Home page shows but the links are broken and CSS/Theme doesn't load
You probably did not set :blog-prefix
to ""
.
If :blog-prefix has been set correctly and you have updated the site using lein run
then download Netlify's version of your site. You'll have to figure it out for yourself what isn't working.
404 when viewing the homepage
This means Netlify can't find your content. This is probably caused by not setting the "Publish directory" to "public".
Alternatively, public/ is in your gitignore and you forgot to push public/.