My omnium-gatherom of scripts and source code.
at main 712 B view raw
1#!/usr/bin/env bash 2set -e 3 4FILES="$(find . -maxdepth 2 -mindepth 2 -type d | sed '/git/d' | xargs stat -c '%n %y' | awk '{print $2"T"$3$4" "$1}')" 5 6[ ! -d github-style-site ] && echo "github-style-site directory not found" && exit 1 7[ ! -d github-style-site/content/post ] && mkdir -p github-style-site/content/post 8 9 10while IFS= read -r line; do 11 DATE="$(echo "$line" | awk '{print $1}')" 12 NAME="$(echo "$line" | awk '{print $2}' | sed 's/\.\/// ; s/\//-/g')" 13 FILENAME="$(echo "$line" | awk '{print $2}' | sed 's/\.\/.*\///g')" 14cat > github-style-site/content/post/"$FILENAME".md <<- EOF 15--- 16title: "$FILENAME" 17date: $DATE 18draft: false 19--- 20EOF 21done <<< "$FILES" 22# 2024-03-18T12:37:38.386289458-0400 ./Rust/dfr