diff --git a/content/now/engaged.jpg b/content/now/engaged.jpg new file mode 100644 index 00000000..d58d9396 Binary files /dev/null and b/content/now/engaged.jpg differ diff --git a/content/now.md b/content/now/index.md similarity index 73% rename from content/now.md rename to content/now/index.md index 9d7f1d9b..9d22a028 100644 --- a/content/now.md +++ b/content/now/index.md @@ -1,7 +1,7 @@ --- title: My world, these days emoji: 🤓 -lastmod: 2023-07-26T08:11:37+01:00 +lastmod: 2023-07-27T22:30:37+01:00 draft: false type: timeless --- @@ -16,12 +16,20 @@ I live in a lovely flat in North London with my fiancé Yvette. We still feel li The biggest news from that trip was [Yvette proposing to me](https://adventure.awaits.us/a-patagonian-love-story/) at the top of the Torres del Paine mountains — I'm so excited to be marrying her, even if the wedding planning is triply complex because of our mixed nationalities! +{{< figure src="engaged.jpg" alt="A photo of Yvette and I grinning at the camera, with the engagement compass Yvette just gave JP" >}} + The second biggest news from that trip was my Mum discovering she has a terminal cancer. I'm struggling with this a fair amount at the moment, but I have a superlative support network, and Deliveroo embracing my choice to move to a 4-day work week to spend more time with her has been wonderful. I'm (clearly) being quite open about this, but I'd appreciate your efforts in finding quieter times if you'd like to talk to me about this; I hope it's easy to understand how this topic can emotionally blind-side me! My work at Deliveroo is very internally-facing at the moment, so there's not much high-level context that's worth sharing here, but I'm always open to sharing what I can about my role and my company, if you're interested in knowing. While London is trying to remember what the definition of "Summer" is, I'm spending time making things. I recently finished a 4-week throwing (pottery) course, and had a lot of fun making bowls and cups and vases — I'll post some pictures here when I pick them up from their final firing! I'm also putting a fair amount of time into this blog right now (you may have noticed) as a way to trying to find a faster way to ground for the regular lightning strikes of ideas I seem to be having since returning from my travels! +{{< figure src="sunset.jpg" title="We had a glorious sunset last night!" alt="A golden sunset over North London">}} + I'm _really_ enjoying slowly playing through [Viewfinder](https://thunderfulgames.com/games/viewfinder/) — it reminds ne a lot of Portal! -In terms of reading, I'm struggling a little to stay interested in [The Dark Forest](https://openlibrary.org/books/OL39524585M/Dark_Forest) by Cixin Liu (the sequel to [The Three Body Problem](https://openlibrary.org/works/OL17267881W/%E4%B8%89%E4%BD%93)). +{{< openlibrary "9781782394464" >}} + +I'm currently reading [Ajax Penumbra 1969](https://openlibrary.org/works/OL21518724W/Ajax_Penumbra_1969?edition=key:/books/OL29181691M), the prequel to a book [I adored reading](/posts/reviews/books/robin-sloan/mr-penumbras-24-hour-bookstore.md) back in 2013 (I'm really enoying strecthing out reading this ultra-short prequel too!) + +I'm also struggling a little to stay interested in the audiobook version of [The Dark Forest](https://openlibrary.org/books/OL39524585M/Dark_Forest) by Cixin Liu (the sequel to [The Three Body Problem](https://openlibrary.org/works/OL17267881W/%E4%B8%89%E4%BD%93)), but perhaps some weekend walks will get me back into it. diff --git a/content/now/sunset.jpg b/content/now/sunset.jpg new file mode 100644 index 00000000..de2446c7 Binary files /dev/null and b/content/now/sunset.jpg differ diff --git a/content/posts/reviews/books/robin-sloan/mr-penumbras-24-hour-bookstore-mr-penumbras-24-hour-bookstore-1-.md b/content/posts/reviews/books/robin-sloan/mr-penumbras-24-hour-bookstore.md similarity index 100% rename from content/posts/reviews/books/robin-sloan/mr-penumbras-24-hour-bookstore-mr-penumbras-24-hour-bookstore-1-.md rename to content/posts/reviews/books/robin-sloan/mr-penumbras-24-hour-bookstore.md diff --git a/content/posts/reviews/books/ryan-north/poor-yorick.jpg b/content/posts/reviews/books/ryan-north/poor-yorick.jpg deleted file mode 100644 index 5433f579..00000000 Binary files a/content/posts/reviews/books/ryan-north/poor-yorick.jpg and /dev/null differ diff --git a/content/posts/reviews/books/ryan-north/poor-yorick.md b/content/posts/reviews/books/ryan-north/poor-yorick.md index 5b4bc76d..49a9f6e6 100644 --- a/content/posts/reviews/books/ryan-north/poor-yorick.md +++ b/content/posts/reviews/books/ryan-north/poor-yorick.md @@ -12,6 +12,6 @@ syndications: - https://www.goodreads.com/review/show/808640102 --- -{{< openlibrary "OL49208407M" >}} +{{< openlibrary "/books/OL49208407M" >}} Ridiculous and fun - a short, choose-your-own-journey story with much nifty reference to Hamlet. diff --git a/layouts/partials/book.html b/layouts/partials/book.html index 1dd48bdd..a9a82fc9 100644 --- a/layouts/partials/book.html +++ b/layouts/partials/book.html @@ -1,18 +1,17 @@ -
- {{ with .cover }} - The cover of this book - {{ end }} +
+ + {{ $title := .title }} + {{ with .cover }} + The cover of the book {{ $title }} + {{ end}} + - {{ .title }} -
    - {{ range .authors }} -
  1. {{ .name }}
  2. - {{ end }} -
- - -
+
+ {{ .title }}
+ + {{ range .authors }} + {{ .name }} + {{ end }} + +
+ diff --git a/layouts/shortcodes/openlibrary.html b/layouts/shortcodes/openlibrary.html index ff3a67b5..774dd4f7 100644 --- a/layouts/shortcodes/openlibrary.html +++ b/layouts/shortcodes/openlibrary.html @@ -1,12 +1,30 @@ -{{ $isbn := .Get 0 }} {{ $path := .Page.Path }} +{{ $isbn := "" }} +{{ $key := "" }} -{{ $query := (dict "type" "/type/edition" "isbn_13" $isbn) | jsonify }} -{{ $thing := getJSON (printf "https://openlibrary.org/api/things?query=%s" ($query)) }} -{{ if and (eq $thing.status "ok") (ge (len $thing.result) 1) }} - {{ $key := index $thing.result 0 }} +{{ with .Get 0 }} + {{ if eq (len .) 13 }} + {{ $isbn = . }} + {{ else }} + {{ $key = . }} + {{ end }} +{{ end }} + +{{ $isbn := .Get 0 }} + +{{ if not $key }} + {{ $query := (dict "type" "/type/edition" "isbn_13" $isbn) | jsonify }} + {{ $thing := getJSON (printf "https://openlibrary.org/api/things?query=%s" ($query)) }} + {{ if and (eq $thing.status "ok") (ge (len $thing.result) 1) }} + {{ $key = index $thing.result 0 }} + {{ end }} +{{ end}} + +{{ if $key }} {{ $bookObj := getJSON (printf "https://openlibrary.org/api/get?key=%s" $key) }} {{ if eq $bookObj.status "ok" }} + {{ $isbn = index $bookObj.result.isbn_13 0 }} + {{ $authors := slice }} {{ range $bookObj.result.authors }} {{ $authorObj := getJSON (printf "https://openlibrary.org/api/get?key=%s" .key) }} @@ -15,18 +33,20 @@ {{ end }} {{ end }} - {{/* TODO: Perhaps I nede to parse this a bit */}} - {{ $subjects := $bookObj.result.subjects }} + {{ $coverURL := (printf "https://covers.openlibrary.org/b/isbn/%s-M.jpg" $isbn)}} + {{ if not $isbn }} + {{ $coverURL = printf "https://covers.openlibrary.org/b/id/%.0f-M.jpg" (index $bookObj.result.covers 0) }} + {{ end }} {{ $cover := "" }} - {{ with resources.GetRemote (printf "https://covers.openlibrary.org/b/isbn/%s-M.jpg" $isbn) }} + {{ with resources.GetRemote $coverURL }} {{ with .Err }} {{ else }} {{ $cover = .Content | resources.FromString (replaceRE `\.md$` ".jpg" $path) }} {{ end }} {{ end }} - {{ $book := dict "title" $bookObj.result.title "authors" $authors "url" (printf "https://openlibrary.org%s" $key) "cover" $cover "subjects" $subjects }} + {{ $book := dict "title" $bookObj.result.title "authors" $authors "url" (printf "https://openlibrary.org%s" $key) "cover" $cover }} {{ partial "book.html" $book }} {{ end }} {{ end }} diff --git a/themes/hello-friend-ng/assets/scss/_main.scss b/themes/hello-friend-ng/assets/scss/_main.scss index 80ac7797..aaa744d4 100644 --- a/themes/hello-friend-ng/assets/scss/_main.scss +++ b/themes/hello-friend-ng/assets/scss/_main.scss @@ -131,7 +131,7 @@ a[href^="https://web.archive.org/"] { text-decoration: none; } -main p a, main li a, nav a, .social a, section a, .accented, .banner-404 a, .syndication a { +main p a, main li a, nav a, .social a, section a, .accented, .banner-404 a, .syndication a, figcaption a { &:hover { color: var(--accent); } @@ -459,6 +459,7 @@ hr { height: 1px; // Default background: $light-border-color; + clear: both; @media (prefers-color-scheme: dark) { background: $dark-border-color; diff --git a/themes/hello-friend-ng/assets/scss/_single.scss b/themes/hello-friend-ng/assets/scss/_single.scss index c5823e4a..0eb2f854 100644 --- a/themes/hello-friend-ng/assets/scss/_single.scss +++ b/themes/hello-friend-ng/assets/scss/_single.scss @@ -75,7 +75,7 @@ } &-info { - margin-top: 30px; + margin: 16px 0; font-size: 0.8rem; line-height: normal; @@ -256,3 +256,33 @@ margin-right: 8px; } } + +.book { + max-width: 180px; + float: right; + text-align: right; + margin: 0 0 16px 16px; + + img { + width: 100%; + } + + .authors { + &:has(a)::before { + content: ' by '; + } + a { + &::after { + content: ', '; + } + + &:nth-last-child(2)::after { + content: ', and '; + } + + &:last-child::after { + content: ''; + } + } + } +} \ No newline at end of file diff --git a/themes/hello-friend-ng/assets/scss/syndication.scss b/themes/hello-friend-ng/assets/scss/_syndication.scss similarity index 100% rename from themes/hello-friend-ng/assets/scss/syndication.scss rename to themes/hello-friend-ng/assets/scss/_syndication.scss