Update 2023-11-08 11:13:12
This commit is contained in:
parent
c63d161545
commit
ab9f7452d6
18
src/index.ps
18
src/index.ps
@ -14,33 +14,37 @@ cat <<'EOF'
|
|||||||
<h2>
|
<h2>
|
||||||
Posts
|
Posts
|
||||||
</h2>
|
</h2>
|
||||||
<ul>
|
<table>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# print list
|
# print list
|
||||||
ls -r1 *.ps *.pm *.ph *.pa *.pt 2>/dev/null | fgrep -v '.draft.' | while read line
|
ls -r1 *.ps *.pm *.ph *.pa *.pt 2>/dev/null | fgrep -v '.draft.' | while read line
|
||||||
do
|
do
|
||||||
|
echo "<tr>"
|
||||||
DATE="$(echo "$line" | cut -d"_" -f1 )"
|
DATE="$(echo "$line" | cut -d"_" -f1 )"
|
||||||
if [ $(echo "${line##*.}") == "pm" ]
|
if [ $(echo "${line##*.}") == "pm" ]
|
||||||
then
|
then
|
||||||
TITLE="$DATE - $(head -1 "$line" | sed 's/^# //g')"
|
TITLE="$(head -1 "$line" | sed 's/^# //g')"
|
||||||
else
|
else
|
||||||
TITLE="$DATE - $(echo "${line%%.*}" | tr '_' ' ')"
|
TITLE="$(echo "${line%%.*}" | tr '_' ' ')"
|
||||||
fi
|
fi
|
||||||
URI="posts/${line%.*}.html"
|
URI="posts/${line%.*}.html"
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
<li>
|
<td>
|
||||||
|
$DATE
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
<a href="$URI">
|
<a href="$URI">
|
||||||
$TITLE
|
$TITLE
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</td>
|
||||||
EOF
|
EOF
|
||||||
|
echo "</tr>"
|
||||||
done
|
done
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
</ul>
|
</table>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user