14 lines
601 B
Text
Executable file
14 lines
601 B
Text
Executable file
#! /usr/bin/env nu
|
|
|
|
def main () {
|
|
let paths: list<string> = (git diff --name-only | split row "\n" | filter {|p| $p | str contains "content/blog"});
|
|
let posts: string = (ls content/blog | filter {|p| $p.type == "dir"} | each {|p| $p.name | sed 's/content\/blog\///g'});
|
|
|
|
for post in $posts {
|
|
if $"content/blog/($post)/index.md" in $paths {
|
|
echo $"`($post)` post has been modified";
|
|
python3 ./scripts/article.py card $post
|
|
python3 ./scripts/article.py update $post "global" "updated" $"(date now | format date '%Y-%m-%d')"
|
|
}
|
|
}
|
|
}
|