borkdude / quickblog

Light-weight static blog engine for Clojure and babashka
https://blog.michielborkent.nl/
MIT License
165 stars 28 forks source link

Absolute post ordering #67

Closed UnwarySage closed 1 year ago

UnwarySage commented 1 year ago

Please answer the following questions and leave the below in as part of your PR.

66 for reference

I'd have added tests, but the relevant areas of test suite seem to be having issues and are commented out.

UnwarySage commented 1 year ago

Hmm, would have to make the dates negative in the vector to stop everything from being sorted descending. Will give it a try.

On Sat, May 13, 2023, 3:39 AM Michiel Borkent @.***> wrote:

@.**** commented on this pull request.

In src/quickblog/internal.clj https://github.com/borkdude/quickblog/pull/67#discussion_r1192949882:

@@ -142,8 +142,26 @@ :html post-process-markdown)))

+(defn post-compare [a-post b-post]

There's probably an easier way of writing this?

E.g. compare the vector [date title file]?

user=> (compare ["b" "b" "a"] ["b" "b" "a"]) 0 user=> (compare ["b" "b" "a"] ["b" "b" "b"]) -1 user=> (compare ["b" "b" "a"] ["b" "b" "a"]) 1

— Reply to this email directly, view it on GitHub https://github.com/borkdude/quickblog/pull/67#pullrequestreview-1425361753, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACLWOS76DHMYEJXL4CDPULDXF5CEDANCNFSM6AAAAAAYAHSSWM . You are receiving this because you authored the thread.Message ID: @.***>

UnwarySage commented 1 year ago

Had a post push epiphany. Here's a variant like you suggested, but using opposite positions to have dates sorted in descending order.

borkdude commented 1 year ago

Thanks!