diff --git a/notebooks/cards.clj b/notebooks/cards.clj index a49fa949a..3daa274a4 100644 --- a/notebooks/cards.clj +++ b/notebooks/cards.clj @@ -11,7 +11,7 @@ ;; ## Images (c/card - (v/image "https://images.freeimages.com/images/large-previews/773/koldalen-4-1384902.jpg")) + (v/image "https://images.unsplash.com/photo-1532879311112-62b7188d28ce?w=1200&h=800&fit=crop")) ;; ## $\LaTeX$ (c/card diff --git a/notebooks/viewers/image.clj b/notebooks/viewers/image.clj index 051de47a9..3c3186748 100644 --- a/notebooks/viewers/image.clj +++ b/notebooks/viewers/image.clj @@ -12,13 +12,13 @@ ;; For convenience, you can use the `clerk/image` function to create a buffered image from a string or anything `java.awt.image.BufferedImage/read` takes. You can also use `clerk/figure` to show the image with a descriptive caption below it. ;; A large image with an aspect ratio smaller 2 is shown wider. -(clerk/image "https://images.freeimages.com/images/large-previews/773/koldalen-4-1384902.jpg") +(clerk/image "https://images.unsplash.com/photo-1532879311112-62b7188d28ce?w=1200&h=800&fit=crop") ;; Smaller images are centered and shown using their intrinsic dimensions. Here, we're using `clerk/figure`: (clerk/image "https://nextjournal.com/data/QmeyvaR3Q5XSwe14ZS6D5WBQGg1zaBaeG3SeyyuUURE2pq?filename=thermos.gif&content-type=image/gif") ;; Layout options are also available. For example, `{::clerk/width :full}` renders the image in full width. -(clerk/image {::clerk/width :full} "https://images.freeimages.com/images/large-previews/773/koldalen-4-1384902.jpg") +(clerk/image {::clerk/width :full} "https://images.unsplash.com/photo-1532879311112-62b7188d28ce?w=1200&h=800&fit=crop") ;; We also support local files for `clerk/image`: (clerk/image "trees.png") diff --git a/notebooks/viewers/image_layouts.clj b/notebooks/viewers/image_layouts.clj index 5c9631ac9..d8fcbe555 100644 --- a/notebooks/viewers/image_layouts.clj +++ b/notebooks/viewers/image_layouts.clj @@ -38,7 +38,7 @@ [:figure [:img {:class "w-full" - :src "https://images.freeimages.com/images/large-previews/773/koldalen-4-1384902.jpg"}] + :src "https://images.unsplash.com/photo-1532879311112-62b7188d28ce?w=1200&h=800&fit=crop"}] [:figcaption.max-w-prose.text-sm.text-slate-500.sans-serif.mt-2 "Content width, height based on aspect ratio"]]) @@ -46,7 +46,7 @@ [:figure [:img {:class "w-full object-cover h-[300px]" - :src "https://images.freeimages.com/images/large-previews/773/koldalen-4-1384902.jpg"}] + :src "https://images.unsplash.com/photo-1532879311112-62b7188d28ce?w=1200&h=800&fit=crop"}] [:figcaption.text-sm.text-slate-500.sans-serif.mt-2 "Content width, fixed height"]]) diff --git a/src/nextjournal/clerk/eval.clj b/src/nextjournal/clerk/eval.clj index edd953614..46df9bd4a 100644 --- a/src/nextjournal/clerk/eval.clj +++ b/src/nextjournal/clerk/eval.clj @@ -273,8 +273,8 @@ blocks)) (defn cljs? [doc] - (boolean (and (string? (:file doc)) - (str/ends-with? (:file doc) ".cljs")))) + (and (string? (:file doc)) + (str/ends-with? (:file doc) ".cljs"))) ;; TODO: used in builder to drop analyzer dependency, cfr. below (defn analyze-doc [doc] (-> doc analyzer/build-graph analyzer/hash)) diff --git a/test/nextjournal/clerk/render/hashing_test.clj b/test/nextjournal/clerk/render/hashing_test.clj index c9b126e23..c2b049018 100644 --- a/test/nextjournal/clerk/render/hashing_test.clj +++ b/test/nextjournal/clerk/render/hashing_test.clj @@ -1,5 +1,6 @@ (ns nextjournal.clerk.render.hashing-test - (:require [clojure.test :refer [deftest is testing]] + (:require [clojure.string :as str] + [clojure.test :refer [deftest is testing]] [nextjournal.clerk.render.hashing :as hashing])) (deftest front-end-hash @@ -7,6 +8,6 @@ (let [debug-dejavu (System/getProperty "nextjournal.dejavu.debug")] (when-not debug-dejavu (System/setProperty "nextjournal.dejavu.debug" "1")) - (is (hashing/front-end-hash)) + (is (not (str/blank? (hashing/front-end-hash)))) (when-not debug-dejavu (System/clearProperty "nextjournal.dejavu.debug")))))