This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-28
Channels
- # aws (7)
- # beginners (69)
- # boot (67)
- # cider (9)
- # cljs-dev (159)
- # cljsrn (2)
- # clojars (25)
- # clojure (345)
- # clojure-austin (9)
- # clojure-berlin (1)
- # clojure-dusseldorf (10)
- # clojure-italy (3)
- # clojure-nl (1)
- # clojure-portugal (1)
- # clojure-spec (73)
- # clojure-uk (59)
- # clojurescript (163)
- # clojurewerkz (1)
- # component (26)
- # core-matrix (2)
- # cursive (20)
- # datascript (32)
- # datomic (15)
- # dirac (16)
- # emacs (3)
- # hoplon (35)
- # jobs-discuss (87)
- # jobs-rus (95)
- # luminus (15)
- # om (135)
- # om-next (3)
- # onyx (47)
- # pedestal (67)
- # perun (74)
- # play-clj (4)
- # portland-or (1)
- # proton (4)
- # re-frame (13)
- # reagent (18)
- # remote-jobs (17)
- # rum (20)
- # specter (11)
- # untangled (101)
- # yada (18)
@podviaznikov idea basically stems from having one track of each kind/artist, not sure how practical that will be but ¯\(ツ)/¯
martinklepsch: interesting. I once built for myself kinda radio based on soundcloud. So everyone who is on the page would listen to the same songs as everyone else. Different from your idea though
Yeah, more thinking of this as some kind of library. I’ve always starred/favorited lots of tracks on SoundCloud/Spotify and I want that information to be preserved no matter the platform that I’m using
Can’t figure out how to use content-task
properly It’s not clear to me what the individual functions need to return — some schema type checks would go a long way. Maybe add some truss assertions https://github.com/ptaoussanis/truss ?
@martinklepsch unfortunately the returns for most of the functions that content-task
takes are too open for an assertion to help you out very much. The docstring for content-task
is a bit terse though, and I can expand it. Briefly though, for your use-case, :render-form-fn
returns a form that will be called in a pod (via boot/with-call-in
), and :paths-fn
should probably be the same one you used for render-task
.
The namespace-qualified function that render-form-fn
returns is responsible for rendering a single file. It should return a map of metadata that will get set on the file, and the :rendered
key of that map should be a string that contains the rendering result.
If an example would be easier to follow, there are several in perun.clj. I think atom-feed
is the closest to your use-case: https://github.com/hashobject/perun/blob/master/src/io/perun.clj#L1090
@bhagany they might be open but still at some point some other piece expects something at :rendered
etc
(perun/content-task {:task-name "contentful"
:render-form-fn (fn [data] `(ofe.static/render-track-page* ~data))
:paths-fn ofe/contentful-paths
:tracer :ofe.contentful/contentful
:pod perun/render-pod})
does this look about right to you?render-track-page*
assocs the rendererd html (as string) to the :rendered
key
When I run this and then print-meta
there are no entries for the pages that I just rendered
I'd have to do some print debugging to get to the bottom of that... would it work if I run it locally, or would I need contentful credentials of some sort?
It’s early in the morning where you are — maybe bring your kids to school and ping later if/when you find time?
@bhagany it should work, creds are public and hardcoded: https://github.com/martinklepsch/one-of-each/tree/atom
yeah, I'm about to leave 🙂 finding time will be easy though, as my employment situation is currently complicated, in a way that gives me a lot of free time 🙂
haha, that’s both good and bad I guess
talk soon
@martinklepsch it's just a typo 🙂 https://github.com/martinklepsch/one-of-each/blob/atom/src/cljs/ofe/static.clj#L56
oh my!
hm. but then I still get this:
java.lang.ClassNotFoundException: ofe.contentful.Track
which is weird because that namespace should be required transitivelyit is but I’m explicitly requiring that ns in the pod in build.boot
(see right after the contentful task)
... I can't seem to reproduce that error, but I did modify things a bit to make it run, maybe I'm not hitting the right code path?
contentful
is writing 4 files, and then atom-feed
is erroring because of missing authors
@bhagany are you running master?
@bhagany I mean of perun itself, sorry
I was behind a commit or two, but I'm up to date now, and getting the same result on one-of-each
the only change you made is fix the :rendered typo I guess?
what’s the exact CLI invocation you use? I do boot contentful perun/print-meta target
ok, that’s some progress 🙂
for print meta I did the same thing as for render, just require it in the pod
for the atom task that doesn’t work because pod isn’t globally defined
Really the simplest thing at this point is just turning them into ordinary maps 🙂
wohoo I generated a feed!
the fix I'm working on might work for atom-feed
as well... but maybe maps aren't a bad idea either 🙂
one bug report: when I set :out-dir
in for the atom-feed task to an empty string it ends up being an absolute path
this does the trick but I guess empty string should be fine too? ”.”
Ok think with my weird setup I might have to implement the rss feed markup seperately
that + the fact that the :content
keys are already full html pages
shouldn’t be too hard with another content-task though I guess
full html pages should be okay - are they being picked up by a later render task or something?
for atom, I think the biggest difficulty is in having a unique, stable id for each entry. It doesn't technically have to be a uuid, though. For instance, if you know the content won't change, you could md5 it or something, and use that.
(this is assuming you can't just set some metadata field in contentful that you can access, which would be easiest)
oh, it looks like you already get a "uuid" back... I don't think I understand where the difficulty is
Oh yeah, I was using a validator, maybe most RSS readers don’t care to much about what it says
will try what the feed looks like in a reader with the default impl