@bhagany Resuming my perun-upgrading todayβ¦ fixed the get-meta thing (turns out I donβt need it anymore) but now I run into the following...
I need the rendered markdown in two places (one render
and one collection
task, e.g. the most recent article is on the index page)
The render
task however replaces the :content
field of the the files metadata with the rendered HTML and so I think thereβs no way for me to obtain the previous markdown rendering result
https://github.com/hashobject/perun/blob/master/src/io/perun.clj#L678
On the plus side the new :io.perun/trace
was quite helpful in figuring out whatβs going wrong π
@martinklepsch I think this can be fixed by reordering the tasks. If it is (markdown) (collection) (render)
then collection
and render
will both see only the results from markdown
. You may need to add a filterer
to render
though, to exclude the collection.
Now that I'm a bit more awake, I have a few more bits of advice that are semi-related to the difficulty you're having. Previously, render functions had to go from unique content to completed page in one step. This meant that if you had things in common on each page, like the header and footer, you had to write separate functions for the common elements, and call them in each render function. In recent versions of Perun, you still can do this, but in my opinion, it's better to think of pages as having many layers, like an onion, and to build them from the inside out.
So a simple example would be something like:
(comp
(markdown)
(collection :renderer 'render-collection-content)
(render :renderer 'render-header))
render-collection-content
, produces content that's analogous to what markdown
produces - that is, it's just a page fragment, not a complete html page. Then render-header
adds the header to the markdown
results and the collection
results alike. Your render functions will end up being simpler as well.
... I can't remember what my other bits of advice were. More coffee.
@bhagany I'm trying to follow up on your work (thanks again!) and upgrade our page from 0.3.0.
I picked up from your [Merge Request](https://gitlab.com/200ok/200ok.gitlab.io/merge_requests/12/diffs) and had to uprade to 0.4.2-SNAPSHOT to get boot dev
running. Otherwise it would not have found the new assortment
task that you used.
Now it stats and all pages are being built. So far so good(:
However, there are some regressions in how pages are built and I'm kinda stuck. The collection
task seems to render post into the index page twice.
Compared to http://200ok.ch (where the old version still runs), there's two things: 1. Each post is rendered twice 2. Both renders are different and neither yields the post(;
As I can see from the new and awesome(!!) guides, the collection task shouldn't have changed for how we are using it. Do you have any hunch on what's going on?
ah, I was probably using a local build that was still called 0.4.1-SNAPSHOT, apologies for that. I'll take a look at the rendering problems π
No need to apologize, you are incredibly helpful! Also, you don't have to fix the issue^^ I was just wondering on whether this might be a known thing and you can point me to the right direction(; I don't want to be lazy, I tried before I asked^^
I don't have any good guesses off the cuff, and don't worry, I didn't think you were being lazy π
^^
I'll keep searching in parallel.
@munen okay, I think I got it
it's actually related to my random advice above - try moving the two render
tasks after the assortment
task, and see if that does what you expect (It looks good to me)
That was quick and looks perfect!
Seems like I have to keep up better with the good things that are said in this channel. I have to admit that I'm sometimes skimming and sometimes skipping it.
I'll read up to understand^^
heh, I'm not sure if I'd have picked it up right away myself, if our roles were reversed. I learn a lot better by doing than by reading.
One last question that comes to mind: Will there be a '0.4.2' on Clojars, soon? Alternatively, do you plan new API changes in 0.4.2-SNAPSHOT before you do it? I'd be a little afraid to keep the -SNAPSHOT in the build file otherwise, because our page gets re-built on every change. This means that if the Perun API changes in the snapshot that we are targeting, this might yield a regression even though we only changed content.
I think there are not many large API changes in the works anymore, but I definitely hear you on the snapshot builds in production. I think @podviaznikov would be open to doing a non-snapshot release soon, hopefully. In the meantime, I remember someone saying in #boot that there's a way to peg to a particular day's snapshot. googling that now...
That's good advice. Seems like this can be done with Maven: http://dev.clojure.org/display/community/Maven+Settings+and+Repositories
I'll try.
yeah, I'm looking for a way to see the timestamp on the snapshot that's being used now. no luck yet
I found the timestamp, but boot will not find it later.
huh, how did you find the timestamp?
In my ~/.m2
folder, I found perun-0.4.2-20170215.172730-2
ah, that makes sense
β .m2 find . | ag perun
./repository/perun/perun/0.4.2-SNAPSHOT
./repository/perun/perun/0.4.2-SNAPSHOT/resolver-status.properties
./repository/perun/perun/0.4.2-SNAPSHOT/maven-metadata-clojars.xml.sha1
./repository/perun/perun/0.4.2-SNAPSHOT/perun-0.4.2-SNAPSHOT.jar
./repository/perun/perun/0.4.2-SNAPSHOT/perun-0.4.2-20170215.172730-2.pom
./repository/perun/perun/0.4.2-SNAPSHOT/perun-0.4.2-SNAPSHOT.pom
./repository/perun/perun/0.4.2-SNAPSHOT/perun-0.4.2-20170215.172730-2.jar
./repository/perun/perun/0.4.2-SNAPSHOT/maven-metadata-clojars.xml
./repository/perun/perun/0.4.2-SNAPSHOT/perun-0.4.2-20170215.172730-2.jar.sha1
./repository/perun/perun/0.4.2-SNAPSHOT/_maven.repositories
./repository/perun/perun/0.4.2-SNAPSHOT/perun-0.4.2-20170215.172730-2.pom.sha1
./repository/perun/perun/perun-0.4.2-SNAPSHOT
./repository/perun/perun/perun-0.4.2-20170215.172730
But neither perun-0.4.2-20170215.172730
nor perun-0.4.2-20170215.172730-2
seem to be ok for boot to find the snapshot on clojars on a new run.
hmm, [perun "0.4.2-20170206.061747-1"]
works for me, but obviously that's older...
have you built perun locally?
No.
Your version works! Magic(;
With the knowledge on how to do a specific pin, I guess my question above is obsolete. Please continue doing leading edge and fast work and don't be afraid to break things^^
that was the last non-local build I had
Thank you very much for your help, Sir!
I just deleted the 0.4.2-SNAPSHOT folder and it pulled down [perun "0.4.2-20170215.172730-2"]
, which matches yours
Ah, let me try doing that.
then, deleting the folder again and running with that dependency works for me as well
I confirm. This works!
excellent π
Well, now I learned something about the Java/Clojure tooling that I have been using for years with other stacks. Feels interesting to be a beginner, again^^
maven is full of mysteries π
The dinner I owe you grew today by at least one course!
ha! it's been my pleasure
although, if you hear about any good clojure jobs out there, passing those along will more than make up for any dinner π
(the company I work for is going out of business, so it's been fun around here)
Oh, that's sad to hear. Well.. we are using Clojure and ClojureScript for our startup http://collecture.io and could (of course^^) make good use of another engineer. However, we are completely bootstrapped. Meaning everyone involved has a part-time job or a freelance gig to support himself. We don't want to take funding and build this business properly up. So if you're interested in having a talk on a business opportunity, let's talk. However, I'm a pragmatic non-bullshitter, so I'll be clear and say that it'll take a while before big bucks are rolling in. We already spent some money for freelancers (like 10k), but that was for a designer. If you're more interested in a job that pays immediately, I know a shop that needs good Clojure people. Unfortunately they require engineers to be located in Berlin. But I'll see those guys next week, maybe something could be arranged if I put in a good word. Otherwise I have no Clojure leads at the moment. I'm happy to be using it myself and would be happy to pay more engineers to do the same, but that'll take a little more time(;
Thanks! If it were just me, I'd be looking for some higher-risk, lower-pay opportunities, but unfortunately my wife isn't of the same mind. That's probably a good thing while we have young kids π
As for Berlin, I'm probably going to look for remote opportunities first, but if we're going to move anyway, Berlin sounds better to me than New York or San Francisco. So I'd be open to it, but probably not immediately.
I understand. Well, if you were interested to locate to Switzerland (there's certainly Clojure jobs that I'm not aware of, because I'm not searching), there's one more thing that I can offer. We do have a huge house in the Swiss mountains with a nice garden and rooms to spare. If you wanted a place to stay to look around and not loose money for having a bed, you're welcome any time!
wow! that sounds fantastic
if you come to Berlin, give us a shout, you could do a talk about Perun at Clojure Berlin π
nice π I'll do that
@munen out of curiosity, which Berlin company do you mean?
everyone in this community is so welcoming, it's great
@pesterhazy I apologize, my brain seems to need to take a break. I'll see the guys next week in Berlin, but they actually are located in Hamburg!
It's the Otto web shop I was referring to.
Regarding Switzerland, especially Zurich, it's not uncommon to work remotely and have the same benefits like a Swiss local worker. However it's beneficial to be here in person to actually get the job if you don't know someone already.
At least that's what I've seen the last years in the Ruby and JS community. Could be that Clojure is different. Maybe depending on whether it's a younger company (then it'll be easy) or a monolith that rebuilds some Cobol into Clojure (then it'll probably be harder/impossible to work remote).
ah yes, I've heard that Otto has a Clojure team before
@bhagany do consider Berlin, it's (still) a laid back place with a friendly Clojure community
They do have multiple teams and each team can decide their stack afaik.
and family friendly - it's a lot easier to find a larger apartment than in SF or NYC I'm sure
I'm sure it is!
They also did sponsor EuroClojure where I met them last. They had four people down there, too. I have a good friend from back in the day in one of those Clojure teams.
You're welcome^^
@bhagany awesome thanks! Sorry, I never got around to submitting anything anywhere since I didn't think anything was worth submitting at my current level of understanding! Basically what all I did was
(def file-separator (System/getProperty "file.separator"))
(def file-separator-regex (re-pattern
(java.util.regex.Pattern/quote
file-separator)))
and reference those throughout perun.core but that definitely wasn't a complete solutionno worries, that was about my level of understanding until last night as well π not that it's really advanced much beyond "wtf" yet...
I didn't know about java.util.regex.Pattern/quote
, that's better than my solution
@jjttjj are you able to build a version of Perun locally? I have a branch that passes all tests on Windows