mirror of
https://github.com/SouthFox-D/SouthFox-D.github.io.git
synced 2025-01-18 06:46:20 +01:00
[feat] add utils.hy
This commit is contained in:
parent
59a7a3c806
commit
5050ca1d4c
1 changed files with 23 additions and 0 deletions
23
utils.hy
Normal file
23
utils.hy
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/usr/bin/env hy
|
||||||
|
(import requests)
|
||||||
|
|
||||||
|
(import sys)
|
||||||
|
(import os)
|
||||||
|
(import json)
|
||||||
|
(import getopt)
|
||||||
|
(import re)
|
||||||
|
(import random)
|
||||||
|
(import datetime [datetime])
|
||||||
|
|
||||||
|
|
||||||
|
(defn get-post-files []
|
||||||
|
(setv markdown-files [])
|
||||||
|
|
||||||
|
(for [[root dirs files] (os.walk "source")
|
||||||
|
-file files]
|
||||||
|
(let [file (os.path.join root -file)]
|
||||||
|
(when (and (in "posts" file) (file.endswith ".md"))
|
||||||
|
(markdown-files.append file))))
|
||||||
|
(print markdown-files))
|
||||||
|
|
||||||
|
(get-post-files)
|
Loading…
Reference in a new issue