Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 9 insertions, 1 deletions
-rwxr-xr-xcsg10
diff --git a/csg b/csg
index 05c70e5..d571e88 100755
--- a/csg
+++ b/csg
@@ -128,7 +128,7 @@ then
for file in $(find . -type f -name '*.md')
do
dates=($(git log --follow --pretty=format:%ad --date="format:%d %B %Y" -- "$file"))
- line="$DESTINATION${file:1:-2}html\t${dates[@]: -3:3}\t${dates[@]:0:3}"
+ line="$DESTINATION${file:1:-2}html\t${dates[@]: -3:3} ${dates[@]:0:3}"
echo -e "$line" >> "$CSG_TIMESTAMP_FILE"
done
}
@@ -229,6 +229,12 @@ transform-file() {
startedGathering && /^$/ { exit }
END { print desc }' "$file")"
local words="$($CSG_AWK '{total += NF} END{print total}' "$file")"
+ local timestamps=($($CSG_AWK -v file="$file" '
+ BEGIN { FS = "\t" }
+ $1 == file {
+ print $2
+ exit
+ }' "$file"))
# Generate
$CSG_MD_TO_HTML "$file" > "$outf"
@@ -238,6 +244,8 @@ transform-file() {
-v title="$title" \
-v description="$descr" \
-v words="$words" \
+ -v created="${timestamps[@]:0:3}" \
+ -v edited="${timestamps[@]:4}" \
$scr_libs $scripts -f "$CSG_TMP_DIR/csg-print.awk" \
"$outf" > "$outf.tmp"
mv "$outf.tmp" "$outf"