enhance: don't create the last page for namespace pages for now

pull/1485/head
Tienson Qin 2021-03-16 23:14:53 +08:00
parent b2d368d64b
commit 5a3cc38cf2
1 changed files with 5 additions and 1 deletions

View File

@ -242,7 +242,11 @@
form)
(concat title body))
(let [ref-pages (remove string/blank? @ref-pages)
children-pages (->> (mapcat (fn [p] (if (string/includes? p "/") (string/split p #"/"))) ref-pages)
children-pages (->> (mapcat (fn [p]
(if (string/includes? p "/")
;; Don't create the last page for now
(butlast (string/split p #"/"))))
ref-pages)
(remove string/blank?))
ref-pages (distinct (concat ref-pages children-pages))]
(assoc block :ref-pages ref-pages))))