瀏覽代碼

Added file-arguments to index-writer

master
Vincent Truchseß 1 年之前
父節點
當前提交
ba77921133
共有 1 個文件被更改,包括 7 次插入4 次删除
  1. +7
    -4
      src/proton/writers.clj

+ 7
- 4
src/proton/writers.clj 查看文件

@@ -81,12 +81,15 @@
[template posts target]
(write-page template target (gen-postlist posts) "Archive"))

(defn write-index-with-posts [template index-template posts]
(defn write-index-with-posts
"Generates index.html from index.adoc. The page contains content from index.adoc
as well as a ist of the 10 most recent posts."
(let [page (ad/adoc-load "index.adoc")]
(write-page template "index.html" (index-template nil nil
([template index-template posts]
(write-index-with-posts template index-template posts "index.adoc" "index.html"))
([template index-template posts infile outfile]
(let [page (ad/adoc-load infile)]
(write-page template outfile (index-template nil nil
(:content page)
nil
{:postlist (gen-postlist posts 10)})
(:title page))))
(:title page)))))

Loading…
取消
儲存