mirror of
https://github.com/mrrpnya/lipu-sona.git
synced 2025-02-13 16:44:39 +00:00
modified scripts to sort files based on git commits
This commit is contained in:
parent
ca7d39cdf2
commit
2c8bb93120
3 changed files with 23 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
|
blogdates.txt
|
||||||
localhashes.txt
|
localhashes.txt
|
||||||
remotehashes.txt
|
remotehashes.txt
|
||||||
Makefile.cfg
|
Makefile.cfg
|
||||||
|
|
12
blogindex.sh
12
blogindex.sh
|
@ -2,7 +2,17 @@
|
||||||
|
|
||||||
DIRECTORY="pages/blog"
|
DIRECTORY="pages/blog"
|
||||||
|
|
||||||
FILES=`ls $DIRECTORY/*.md -1t`
|
FILES=`ls $DIRECTORY/*.md -1`
|
||||||
|
|
||||||
|
echo -n > blogdates.txt
|
||||||
|
for f in $FILES; do
|
||||||
|
MTIME=`git log -n 1 --pretty=format:%at $f`
|
||||||
|
MTIME=${MTIME-9999999999}
|
||||||
|
printf "%d\t%s\n" $MTIME $f >> blogdates.txt
|
||||||
|
done
|
||||||
|
|
||||||
|
# resort by last git commit time
|
||||||
|
FILES=`cat blogdates.txt | sort -nr | cut -f 2-`
|
||||||
|
|
||||||
cat tpl/blog_header.md
|
cat tpl/blog_header.md
|
||||||
|
|
||||||
|
|
12
blogrss.sh
12
blogrss.sh
|
@ -2,7 +2,17 @@
|
||||||
|
|
||||||
DIRECTORY="pages/blog"
|
DIRECTORY="pages/blog"
|
||||||
|
|
||||||
FILES=`ls $DIRECTORY/*.md -1t`
|
FILES=`ls $DIRECTORY/*.md -1`
|
||||||
|
|
||||||
|
echo -n > blogdates.txt
|
||||||
|
for f in $FILES; do
|
||||||
|
MTIME=`git log -n 1 --pretty=format:%at $f`
|
||||||
|
MTIME=${MTIME-9999999999}
|
||||||
|
printf "%d\t%s\n" $MTIME $f >> blogdates.txt
|
||||||
|
done
|
||||||
|
|
||||||
|
# resort by last git commit time
|
||||||
|
FILES=`cat blogdates.txt | sort -nr | cut -f 2-`
|
||||||
|
|
||||||
cat << RSSHEADER
|
cat << RSSHEADER
|
||||||
<?xml version="1.0" encoding=\"UTF-8\" ?>
|
<?xml version="1.0" encoding=\"UTF-8\" ?>
|
||||||
|
|
Loading…
Add table
Reference in a new issue