Hacker News new | ask | show | jobs
by zastavka 3968 days ago
This is a pretty neat approach to building a static site, and it reminds me that a couple months ago I was experimenting with building a static site generator in Clojure. Which makes me think – is there any reason something like this couldn't be done with Clojurescript and Reagent? I've been itching to try out both of those but haven't come up with a good project for it.

The hard part might be routing, since there doesn't seem to be a robust solution for doing that in Reagent yet. I found https://github.com/ghedamat/reagent-react-router but it hasn't been updated in months and the author calls it "very very alpha."

1 comments

I've been using reagent with re-frame[1]. Routing just uses goog.events and goog.history to listen for navigation events, secretary[1] to define routes, which update the state rendered by your components. The code is here: https://github.com/Day8/re-frame-template/blob/master/src/le...

[1] https://github.com/Day8/re-frame and https://github.com/Day8/re-frame-template

You'll have to do `lein new re-frame <project> +routes` to pull in the routing template.

[2] https://github.com/gf3/secretary

Thanks for this! re-frame's probably little heavyweight for what I'd want to do, but secretary looks rad, so at the very least I'll look into that.