From 45a95ef439342b0b5d823ce5d476a22325dc7338 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sun, 15 Oct 2023 23:19:13 +0200 Subject: switch title to name in search machinery --- scripts/make-search-index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make-search-index.js b/scripts/make-search-index.js index f923b54..70df953 100644 --- a/scripts/make-search-index.js +++ b/scripts/make-search-index.js @@ -44,7 +44,7 @@ lunr.tokenizer.separator = /(\p{P}|\p{S}|\p{Z}|\p{C})+/u var idx = lunr(function () { this.ref('link') - this.field('title', {boost: 9}) + this.field('name', {boost: 9}) this.field('tag', {boost: 3}) this.field('text') @@ -56,5 +56,5 @@ var idx = lunr(function () { fs.writeFileSync(process.argv[3], JSON.stringify(idx), {encoding: 'utf8'}) fs.writeFileSync(process.argv[4], JSON.stringify( - Object.fromEntries(documents.map(x => [x.link, {"title": x.title, "tags": x.tags}])) + Object.fromEntries(documents.map(x => [x.link, {"name": x.name, "tags": x.tags}])) ), {encoding: 'utf8'}) -- cgit v1.2.3 From 318d603c51a730a9d55f0f44b2ffff5874cfb5cb Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sun, 15 Oct 2023 23:29:19 +0200 Subject: fixup the timestamp-sourcing script --- scripts/source-timestamps.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/source-timestamps.sh b/scripts/source-timestamps.sh index 5bce4de..ce30cf9 100755 --- a/scripts/source-timestamps.sh +++ b/scripts/source-timestamps.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (C) 2023 University of Luxembourg @@ -30,13 +30,13 @@ do find "$1" -type f -name '*.md' | grep -v "$NOT_SOURCE_REGEX" | while read file ; do fn=`basename "$file"` dir=`dirname "$file"` - tsfn="$fn.timestamp" + outfn="$fn.metadata.yml" ( - echo "making timestamp in '$dir' for file '$fn' ..." >> "$LOGFILE" + echo "adding timestamp in '$dir' for file '$fn' ..." >> "$LOGFILE" cd "$dir" - if [ -f "$tsfn" ] + if grep -q -s "^timestamp:" "$outfn" then echo "... but it already exists; skipping!" >> "$LOGFILE" - else git log -n 1 --pretty=format:%cs -- "$fn" > "$tsfn" + else git log -n 1 --pretty=format:$'timestamp: %cs\n' -- "$fn" >> "$outfn" fi ) done -- cgit v1.2.3 From 005b69dd472811d7a8e623c3761d476b5584b92c Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Mon, 16 Oct 2023 11:36:57 +0200 Subject: fix help string --- scripts/make-search-index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make-search-index.js b/scripts/make-search-index.js index 70df953..38ed214 100644 --- a/scripts/make-search-index.js +++ b/scripts/make-search-index.js @@ -34,7 +34,7 @@ lunr = require("lunr") fs = require("fs") if(process.argv.length !== 5) { - console.error('Needs exactly 3 arguments (input json, output index).'); + console.error('Needs exactly 3 arguments (input json, output index, output metadata).'); process.exit(1); } -- cgit v1.2.3