~ecs/ecs.d2evs.net

75fb3f5fdb6e2173e5db722d46a02ff2fa7c1b37 — Eyal Sawady 6 months ago 251c8b8
Put publishing time in index.md

Also fix sorting order of posts.
5 files changed, 11 insertions(+), 6 deletions(-)

M _config.sh
M _templates/page.html.w
M feed.xml.w
M index.md.w
M static/style.css
M _config.sh => _config.sh +1 -1
@@ 3,7 3,7 @@ get_title() {
	_title="$title"
	file="$(mktemp)"
	# TODO: is this good enough?
	wersh.awk <"$root/posts/$1" | grep -v '^ *emit' >"$file"
	wersh.awk <"$1" | grep -v '^ *emit' >"$file"
	. "$file"
	rm "$file"
	printf "%s" "$title"

M _templates/page.html.w => _templates/page.html.w +1 -1
@@ 11,7 11,7 @@
		<a href="/">Home</a>
		<div class="recent">Recent:</div>
% for i in $(ls "$root/posts" | sort -rn | head -n3); do
%     echo "<a href=\"/posts/${i%\.w}\">$(get_title "$i")</a>"
%     echo "<a href=\"/posts/${i%\.w}\">$(get_title "$root/posts/$i")</a>"
% done
	</div>
	<div class="post">

M feed.xml.w => feed.xml.w +2 -2
@@ 8,9 8,9 @@
		<atom:link href="https://ecs.d2evs.net/feed.xml" rel="self" type="application/rss+xml" />
% for i in $(ls "$root/posts" | sort -rn | head -n10); do
%     emit '<item>'
%     emit "<title>$(get_title "$i")</title>"
%     emit "<title>$(get_title "$root/posts/$i")</title>"
%     emit "<description>$(get_description "$root/posts/$i")</description>"
%     emit "<pubDate>$(get_date "$i")</pubDate>"
%     emit "<pubDate>$(get_date "$root/posts/$i")</pubDate>"
%     emit "<link>https://ecs.d2evs.net/posts/${i%\.w}</link>"
%     emit "<guid isPermaLink=\"true\">https://ecs.d2evs.net/posts/${i%\.w}</guid>"
%     emit '</item>'

M index.md.w => index.md.w +3 -2
@@ 7,7 7,8 @@ I do stuff, most of which does not involve writing blog posts.
This site is licensed CC-BY-SA, you can view the code at
<https://git.sr.ht/~ecs/ecs.d2evs.net>.

% for i in $(ls "$root/posts"); do
% for i in $(ls "$root/posts" | sort -rn); do
%     emit "<br>"
%     emit "<a href=\"/posts/${i%\.w}\">$(get_title "$i")</a>"
%     emit "<span class="time">$(printf "%s" "$i" | cut -d- -f-3)</span>"
%     emit "<a href=\"/posts/${i%\.w}\">$(get_title "$root/posts/$i")</a>"
% done

M static/style.css => static/style.css +4 -0
@@ 51,3 51,7 @@ a:hover {
  text-align: center;
  padding: 5px 8px;
}

.time {
  color: #555;
}