metasoarous / toto

Static site generation in Clojure (with live code reloading!)
Eclipse Public License 1.0
111 stars 3 forks source link

Add ability to watch secondary source files, like css assets or data files #1

Open metasoarous opened 3 years ago

metasoarous commented 3 years ago

This is necessary for complete live-reload type functionality.

However, this is a little bit complicated for css assets and the like specifically.

This also threads in a with a general issue about how different kinds of dependencies thread in, which could lead to a full scons style build system.

metasoarous commented 3 years ago

Note that this also relates to #5, since changing css could potentially require an update to live-view. This starts to get a bit tricky though.

mathpunk commented 2 years ago

Context: I've decided, hey CSS is a good DSL, I'm going to write straight CSS. But HTML is kind of verbose for me, so I'm writing my site in .edn files with hiccup, and coming up with ad hoc classes that I'll style later.

If I don't mind reloading the browser when I change my CSS, what's "The Toto Way" for working with styles? I started a style.css file but I haven't quite figured out how to load it when I'm viewing my (rudimentary) Toto view.

metasoarous commented 2 years ago

Hey @mathpunk! Thanks for asking about this.

For now, you can simply use :header-extras [[:link {:rel "stylesheet" :href "mystyle.css"}]]. You may also want to use :omit-styles? true to leave out the default Oz/Toto styles.