#!/usr/bin/env -S guile -e main -s !# (use-modules (srfi srfi-26) (srfi srfi-71) (srfi srfi-197) (ice-9 regex) (ice-9 textual-ports) (ice-9 binary-ports) (ice-9 ftw) (ice-9 format) (ice-9 string-fun) (web client) (web response)) (define base-dir "/home/ray/Workspace/personal/start-again-at-zero/") (define posts-dir (string-append base-dir "content/posts/")) (define image-dir (string-append base-dir "static/img/")) (define md-img-rx (make-regexp "!\\[[^]]*\\]\\((https?[^)]+)\\)")) (define md-img-link-rx (make-regexp "\\((https?[^)]+\\.(png|jpg))\\)" regexp/icase)) (define img-src-rx (make-regexp " doc)))) (define (main args) (for-each process-file (map (cute string-append posts-dir <>) (scandir posts-dir (cute string-suffix? ".md" <>)))))