fixed tmpl/sitemap_gmi.awk, originally realpath returned the wrong URL
This commit is contained in:
parent
d08244c07b
commit
4a9d79b769
8
Makefile
8
Makefile
|
@ -17,4 +17,10 @@ gmi/%.gmi: src/%.gmi tmpl/gemini.awk
|
|||
mawk -f tmpl/gemini.awk -- $< > $@
|
||||
|
||||
gmi/sitemap.gmi: $(SITEMAP_INDEX_FILES) tmpl/sitemap_gmi.awk
|
||||
mawk -f tmpl/sitemap_gmi.awk $(SITEMAP_INDEX_FILES) > $@
|
||||
mawk -f tmpl/sitemap_gmi.awk -- $(SITEMAP_INDEX_FILES) > $@
|
||||
|
||||
gmi/feed.atom: src/feed.ass tmpl/feed.awk
|
||||
mawk -f tmpl/feed.awk -- $< > $@
|
||||
|
||||
html/feed.atom: src/feed.ass tmpl/feed.awk
|
||||
mawk -f tmpl/feed.awk -- $< > $@
|
||||
|
|
|
@ -22,7 +22,9 @@ function getDirname(path, pathComponents, npathComponents, dirname) {
|
|||
}
|
||||
|
||||
/^=>/ {
|
||||
if (match($1, "^=>([^ ]*)")) {
|
||||
link = ""
|
||||
description = ""
|
||||
if (match($1, "^=>\S")) {
|
||||
link = $1
|
||||
sub("^=>", "", link)
|
||||
$1 = ""
|
||||
|
@ -35,9 +37,10 @@ function getDirname(path, pathComponents, npathComponents, dirname) {
|
|||
description = $0
|
||||
}
|
||||
sub("^([ ]*)", "", description)
|
||||
sub("^([ ]*)", "", link)
|
||||
|
||||
sprintf("realpath %s/%s", getDirname(FILENAME), link) | getline absolutePath
|
||||
sprintf("realpath --relative-to=\"%s\" \"%s\"", ENVIRON["PWD"], absolutePath) | getline link
|
||||
sprintf("realpath --relative-to=\"%s\" \"%s\"", ENVIRON["PWD"] "/src", absolutePath) | getline link
|
||||
|
||||
printf "=> %s %s\n", link, description
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue