Compare commits
4 Commits
6a8c7b75c9
...
ea95073ac4
Author | SHA1 | Date |
---|---|---|
Abdullah Islam | ea95073ac4 | |
Abdullah Islam | ab5bad2f6c | |
Abdullah Islam | 0f673e3c1a | |
Abdullah Islam | 8cbbd2abca |
|
@ -9,15 +9,11 @@ function genNavbarHTML(filename, sourcePath, outputPath) {
|
|||
else
|
||||
return sprintf("<nav id='navbar'>\n\
|
||||
<a href='%s'>home</a> | \n\
|
||||
<a href='%s'>notes</a> | \n\
|
||||
<a href='%s'>useful</a> | \n\
|
||||
<a href='%s'>sitemap</a> | \n\
|
||||
<a href='%s'>feed</a> | \n\
|
||||
<a href='http://git.vern.cc/techn0path/'>git</a>\n\
|
||||
</nav><br>\n", \
|
||||
relpath(dirname, outputPath "/index.html"), \
|
||||
relpath(dirname, outputPath "/notes/index.html"), \
|
||||
relpath(dirname, outputPath "/useful/index.html"), \
|
||||
relpath(dirname, outputPath "/sitemap.html"), \
|
||||
relpath(dirname, outputPath "/feed.atom"))
|
||||
}
|
||||
|
@ -33,14 +29,10 @@ function genNavbarGMI(filename, sourcePath, outputPath) {
|
|||
else
|
||||
return sprintf("Navigation:\n\
|
||||
=> %s home\n\
|
||||
=> %s notes \n\
|
||||
=> %s useful \n\
|
||||
=> %s sitemap\n\
|
||||
=> %s feed\n\
|
||||
=> https://git.vern.cc/techn0path/ git\n\n", \
|
||||
relpath(dirname, outputPath "/index.gmi"), \
|
||||
relpath(dirname, outputPath "/notes/index.gmi"), \
|
||||
relpath(dirname, outputPath "/useful/index.gmi"), \
|
||||
relpath(dirname, outputPath "/sitemap.gmi"), \
|
||||
relpath(dirname, outputPath "/feed.atom"))
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@ function resolvePath(path, resolvedPath, pathComponents) {
|
|||
}
|
||||
|
||||
function getRelativePath(base, path, resolvedPath, baseComponents, pathComponents, commonPrefix) {
|
||||
path = resolvePath(path)
|
||||
base = resolvePath(base)
|
||||
path = resolvePath(ENVIRON["PWD"] "/" path)
|
||||
base = resolvePath(ENVIRON["PWD"] "/" base)
|
||||
pathComponents[1] = ""
|
||||
baseComponents[1] = ""
|
||||
isCommonPrefixUnfinished = 1
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
BEGIN {
|
||||
body = ""
|
||||
body = "<h1>Sitemap</h1>"
|
||||
}
|
||||
|
||||
{
|
||||
gsub("^" sourcePath, "", FILENAME)
|
||||
sub("^" sourcePath, "", FILENAME)
|
||||
|
||||
if (link !~ "^[a-zA-Z0-9_]*:")
|
||||
sub("\.gmi$", ".html", FILENAME)
|
||||
|
||||
pathComponents[1] = ""
|
||||
split(FILENAME, pathComponents, "/")
|
||||
|
@ -22,6 +25,7 @@ BEGIN {
|
|||
}
|
||||
|
||||
{
|
||||
|
||||
body = body sprintf("<a href='%s'>%s</a><br>\n", FILENAME, title)
|
||||
nextfile
|
||||
}
|
||||
|
@ -44,17 +48,13 @@ body { margin: 20px; }\n\
|
|||
</head>\n\
|
||||
<body>\n\
|
||||
<header>\n\
|
||||
<nav id='navbar'>\n\
|
||||
<a href='index.html'>home</a> | \
|
||||
<a href='notes/index.html'>notes</a> | \
|
||||
<a href='useful/index.html'>useful</a> | \
|
||||
<a href='sitemap.html'>sitemap</a> | \
|
||||
<a href='feed.atom'>feed</a>\n\
|
||||
</nav>\n\
|
||||
</header><hr>\n\
|
||||
%s\n\
|
||||
</header>\n\
|
||||
<article id='content'>\n\
|
||||
%s\n\
|
||||
</article>\n\
|
||||
</body>\n\
|
||||
</html>", body
|
||||
</html>", \
|
||||
genNavbarHTML(FILENAME, "src/", "html/"), \
|
||||
body
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
Navigation:
|
||||
=> gmi/index.gmi home
|
||||
=> gmi/notes/index.gmi notes
|
||||
=> gmi/useful/index.gmi useful
|
||||
=> gmi/sitemap.gmi sitemap
|
||||
=> gmi/feed.atom feed
|
||||
=> http://git.vern.cc/techn0path/ git
|
||||
|
|
|
@ -18,8 +18,6 @@ hr { max-width: 70ch; }
|
|||
<header>
|
||||
<nav id='navbar'>
|
||||
<a href='../html/index.html'>home</a> |
|
||||
<a href='../html/notes/index.html'>notes</a> |
|
||||
<a href='../html/useful/index.html'>useful</a> |
|
||||
<a href='../html/sitemap.html'>sitemap</a> |
|
||||
<a href='../html/feed.atom'>feed</a> |
|
||||
<a href='http://git.vern.cc/techn0path/'>git</a>
|
||||
|
|
Loading…
Reference in New Issue