Skip to content

Commit 1bd5fac

Browse files
committed
Ikke null ut html hvis header mangler
1 parent 91f8641 commit 1bd5fac

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/clay.clj

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
(mapv str (filter File/.isFile (tree-seq File/.isDirectory File/.listFiles (File. "notebooks"))))
1212
"src/index.clj")
1313
:title "Advent of Code"
14-
:base-target-path "_site/new/"
14+
:base-target-path "_site/new"
1515
:hide-ui-header true
1616
:show false
1717
:live-reload false
1818
:post-process (fn [html]
19-
(when-let [title (second (first (re-seq #"<h1.*?>(.*?)</h1>" html)))]
19+
(if-let [title (second (first (re-seq #"<h1.*?>(.*?)</h1>" html)))]
2020
(.replaceFirst html
21-
"<title>.*?</title>" (str "<title>" title "</title>"))))})
21+
"<title>.*?</title>" (str "<title>" title "</title>"))
22+
html))})
2223
(p/stop))

0 commit comments

Comments
 (0)