enhance: page adds timestamps && all pages

This commit is contained in:
Tienson Qin
2021-07-14 00:31:57 +08:00
parent ac1f68004a
commit e2a047c1ac
15 changed files with 314 additions and 188 deletions

View File

@@ -300,6 +300,17 @@
(when-not file-exists?
(reset-file! repo-url path default-content)))))
(defn create-pages-metadata-file
[repo-url]
(let [repo-dir (config/get-repo-dir repo-url)
path (str config/app-name "/" config/pages-metadata-file)
file-path (str "/" path)
default-content "{}"]
(p/let [_ (fs/mkdir-if-not-exists (str repo-dir "/" config/app-name))
file-exists? (fs/create-if-not-exists repo-url repo-dir file-path default-content)]
(when-not file-exists?
(reset-file! repo-url path default-content)))))
(defn edn-file-set-key-value
[path k v]
(when-let [repo (state/get-current-repo)]