This commit is contained in:
parent
78ecc94d58
commit
e705644997
2 changed files with 44 additions and 6 deletions
|
@ -3,4 +3,4 @@ title: ls log
|
|||
description: 41666 logs
|
||||
---
|
||||
|
||||
[invoke(logroll)]
|
||||
[invoke(logroll)(./log)]
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
cd log
|
||||
cd $1
|
||||
|
||||
get_frontmatter() {
|
||||
key=$1
|
||||
|
@ -22,15 +22,41 @@ get_heading_name() {
|
|||
echo $1 | sed -E 's/^.*\] (.*) \(.*$/\1/g'
|
||||
}
|
||||
|
||||
get_serial() {
|
||||
echo $1 | sed -E 's/([0-9]+)-.*/\1/'
|
||||
}
|
||||
|
||||
get_author() {
|
||||
code=$(echo $1 | sed -E 's/.*\^(.*)$/\1/g')
|
||||
names=""
|
||||
|
||||
echo $code
|
||||
oifs=$IFS
|
||||
IFS="+"
|
||||
for tag in $code; do
|
||||
|
||||
case $tag in
|
||||
6) names="$names & #6";;
|
||||
a) names="$names & aki";;
|
||||
au) names="$names & aurelia";;
|
||||
e) names="$names & erisa";;
|
||||
f) names="$names & fusa";;
|
||||
j) names="$names & junko";;
|
||||
n) names="$names & noe";;
|
||||
r0) names="$names & ring-0";;
|
||||
s) names="$names & sayaka";;
|
||||
esac
|
||||
|
||||
done
|
||||
IFS=$oifs
|
||||
|
||||
# strip the loading " & "
|
||||
names=$(echo "$names" | sed -E 's/^ & //')
|
||||
echo $names
|
||||
}
|
||||
|
||||
echo "<ul>"
|
||||
|
||||
files=$(ls ???-*.doll)
|
||||
files=$(ls ???-*.doll | tac)
|
||||
for file in $files; do
|
||||
title=$(get_frontmatter title $file)
|
||||
description=$(get_frontmatter description $file)
|
||||
|
@ -40,10 +66,22 @@ for file in $files; do
|
|||
heading_name=$(get_heading_name "$heading")
|
||||
heading_date=$(get_heading_date "$heading")
|
||||
author=$(get_author "$heading")
|
||||
serial=$(get_serial $file)
|
||||
|
||||
echo "<li>"
|
||||
echo "<a href=\"$link\">$dollcode <b>$heading_name</b></a></br> <i>$description</i>"
|
||||
echo "<a href=\"$link\">[$serial] <b>$heading_name</b></a>"
|
||||
echo "by $author ($heading_date)"
|
||||
echo "<br/> "
|
||||
echo "<i>$description</i>"
|
||||
echo "</li>"
|
||||
done
|
||||
|
||||
echo "</ul>"
|
||||
echo "</ul>"
|
||||
|
||||
echo '
|
||||
<style>
|
||||
li {
|
||||
margin-bottom: 1.6rem;
|
||||
}
|
||||
</style>
|
||||
'
|
Loading…
Add table
Add a link
Reference in a new issue