mirror of
https://github.com/tanrax/RSSPAPER.git
synced 2025-02-07 03:38:11 -05:00
fix render
This commit is contained in:
parent
13ef07f0b4
commit
012e03d753
@ -6,7 +6,6 @@ edition: weekly
|
|||||||
feeds:
|
feeds:
|
||||||
- https://github.com/clockworkpi/launcher/releases.atom
|
- https://github.com/clockworkpi/launcher/releases.atom
|
||||||
- https://programadorwebvalencia.com/feed/index.xml
|
- https://programadorwebvalencia.com/feed/index.xml
|
||||||
old:
|
|
||||||
- http://planet.es.python.org/rss.xml
|
- http://planet.es.python.org/rss.xml
|
||||||
- https://diarioestoico.com/feed/
|
- https://diarioestoico.com/feed/
|
||||||
- https://republicaweb.es/feed/podcast
|
- https://republicaweb.es/feed/podcast
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
(:require
|
(:require
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
[rsspaper.config :refer [config]]
|
[rsspaper.config :refer [config]]
|
||||||
[clojure.string :as str]
|
[rsspaper.feeds :refer [get-articles]]
|
||||||
[selmer.parser :as s]
|
[selmer.parser :as s]
|
||||||
[me.raynes.fs :as fs]
|
[me.raynes.fs :as fs]
|
||||||
[me.raynes.fs.compression :as fsc]))
|
[me.raynes.fs.compression :as fsc]))
|
||||||
@ -16,8 +16,8 @@
|
|||||||
[articles]
|
[articles]
|
||||||
;; Render html in dist/index.html
|
;; Render html in dist/index.html
|
||||||
(let [dir-dist "dist/"
|
(let [dir-dist "dist/"
|
||||||
file-index "index.html"
|
|
||||||
path-theme (io/resource (str "themes/" (:theme config) "/"))
|
path-theme (io/resource (str "themes/" (:theme config) "/"))
|
||||||
|
file-index "index.html"
|
||||||
path-dist-index (str dir-dist "index.html")
|
path-dist-index (str dir-dist "index.html")
|
||||||
zip-static "static.zip"
|
zip-static "static.zip"
|
||||||
tmp-static "/tmp/rsspaper.zip"]
|
tmp-static "/tmp/rsspaper.zip"]
|
||||||
@ -26,8 +26,11 @@
|
|||||||
;; Make dir dist
|
;; Make dir dist
|
||||||
(fs/mkdir dir-dist)
|
(fs/mkdir dir-dist)
|
||||||
;; Make dist/index.html
|
;; Make dist/index.html
|
||||||
|
(selmer.parser/set-resource-path! path-theme)
|
||||||
(with-open [writer (io/writer path-dist-index)]
|
(with-open [writer (io/writer path-dist-index)]
|
||||||
(.write writer (s/render-file (str path-theme file-index) {:title (:title config)})))
|
(.write writer (s/render-file file-index {:title (:title config)
|
||||||
;; Make statics
|
:articles (get-articles)
|
||||||
|
})))
|
||||||
|
;; Make static
|
||||||
(copy-uri-to-file (str path-theme zip-static) tmp-static)
|
(copy-uri-to-file (str path-theme zip-static) tmp-static)
|
||||||
(fsc/unzip tmp-static dir-dist)))
|
(fsc/unzip tmp-static dir-dist)))
|
Loading…
x
Reference in New Issue
Block a user