From 5050ca1d4c3569e91ffb65795a9585990290015a Mon Sep 17 00:00:00 2001 From: SouthFox Date: Mon, 6 Jan 2025 00:03:59 +0800 Subject: [PATCH] [feat] add utils.hy --- utils.hy | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 utils.hy diff --git a/utils.hy b/utils.hy new file mode 100644 index 0000000..2b248f9 --- /dev/null +++ b/utils.hy @@ -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)