jacobobryant / platypub

A publishing platform built with Biff
MIT License
65 stars 13 forks source link

Make theme code sharing easier #56

Closed jacobobryant closed 2 years ago

jacobobryant commented 2 years ago

Move themes/default/common.bb to themes/default/src/com/platypub/themes/common.clj. Make render-site and render-email use require instead of load-file. Make a deps.edn file with {:paths ["src" "resources"]} for the contents. Move subscribe.js, email.css and any other files that other themes might want to use to themes/default/resources/com/platypub/themes/default/. Update render-site and render-email accordingly.

Then custom themes can add the default theme as a dependency and reuse anything in common.clj or resources by depending on com.github.jacobobryant/platypub {:sha "..." :deps/root "themes/default"}. (Need to figure out the right way to do that--if custom themes put that in deps.edn, will it apply when we run render-site and render-email? Do we need to change the way Platypub calls theme code? If needed we can always turn render-site and render-email into one-line bash scripts that call bb with the appropriate dependencies and commands)

jacobobryant commented 2 years ago

I've started working on this now.