~pfm/makeweb

6a811af858caf804c06bf37dd8c7f7185fefc2e9 — Piotr F. Mieszkowski 7 months ago b55c315
Order TOC by date, make keywords #-linkable.
1 files changed, 5 insertions(+), 2 deletions(-)

M Makefile
M Makefile => Makefile +5 -2
@@ 123,11 123,13 @@ convert-each:

#
# Build a table of contents.
# Find passes the list of files to ls(1) to order them by last modification
# time oldest to newest.
#

${BUILD_DIR}/${TOC}:
	cat ${TEMPLATES}/contents-begin.html > ${.TARGET}; \
	for MD in `find ${BUILD_DIR} -type f -name '*.md'`; do \
	for MD in `find ${BUILD_DIR} -type f -name '*.md' -exec ls -rt '{}' '+'`; do \
		T=`${MMD} -e title $$MD`; \
		D=`${MMD} -e description $$MD`; \
		H=`echo $$MD | sed -e 's#${BUILD_DIR}/##; s/\.md$$/.html/;'`; \


@@ 145,7 147,8 @@ ${BUILD_DIR}/${INDEX}: ${META}/KEYWORD-INDEX
	echo '<h1>Keyword Index</h1>' >> ${.TARGET}; \
	for K in `cat ${META}/ALL-KEYWORDS`; do \
		FS=`sed -ne "/^$$K/ { s/^[^:]*: //; p; }" ${META}/KEYWORD-INDEX`; \
		echo "<h2>$$K</h2><ul>" >> ${.TARGET}; \
		KN=`echo $$K | sed -e 's/ //g'`; \
		echo "<h2 id='$$KN'>$$K</h2><ul>" >> ${.TARGET}; \
		for F in $$FS; do \
			H=`echo $$F | sed -e 's#${BUILD_DIR}/##'`; \
			MD=`echo $$F | sed -e 's/\.html$$/\.md/'`; \