add config option for sitemap name; v2.2.0
This commit is contained in:
parent
8b0e55a074
commit
4518af7135
2 changed files with 9 additions and 10 deletions
14
config.def.h
14
config.def.h
|
@ -1,10 +1,11 @@
|
|||
/* clang-format off */
|
||||
|
||||
#define MAINCSS "/nilfm.css?v=20220117.1"
|
||||
#define MAINCSS "/nilfm.css?v=20220119.0"
|
||||
#define DOMAIN "https://nilfm.cc"
|
||||
#define LEXICON_SIZE 1024
|
||||
#define TWTXT "/twtxt.txt"
|
||||
#define FRONTCSS "/nilfm.css?v=20220117.1"
|
||||
#define SITEMAP "all_pages"
|
||||
#define FRONTCSS "/nilfm.css?v=20220119.0"
|
||||
#define CONTACT_HTML "contact: <a href='mailto:nilix@nilfm.cc' class='mono'>nilix@nilfm.cc</a><br/><a href='/serv/90587A740FA4FFA0971575383B7FBC22144E6398.asc' style='font-family:monospace;display:inline-block;max-width:24ch;'>9058 7A74 0FA4 FFA0 9715 7538 3B7F BC22 144E 6398</a>\n" \
|
||||
""
|
||||
#define NAME "nilFM"
|
||||
|
@ -14,13 +15,10 @@
|
|||
"<a href='/serv/90587A740FA4FFA0971575383B7FBC22144E6398.asc' style='font-family:monospace;display:inline-block;max-width:24ch;'>9058 7A74 0FA4 FFA0 9715 7538 3B7F BC22 144E 6398</a>\n" \
|
||||
""
|
||||
#define FOOTER_HTML "<div style='float:right;text-align:center;'><a href='https://nilfm.cc/git/' target='_blank'><img src='/img/git.svg' alt='nilFM hack lab'/></a> \n" \
|
||||
"<a href='https://cafe.nilfm.cc/u/nilix' target='_blank'><img src='/img/honk.svg' alt='honk'/></a> \n" \
|
||||
"<a href='https://webring.xxiivv.com' target='_blank'><img src='/img/webring.svg' alt='xxiivv webring'/></a> \n" \
|
||||
"<a href='https://lightcrystal.systems' target='_blank'><img src='/img/lightcrystal_bw_small.svg' alt='lightcrystal.systems'/> \n" \
|
||||
"<a href='/support.html'><img src='/img/tipjar.svg' alt='tips appreciated'/><br/>" \
|
||||
"<a href='/sitemap.html'>sitemap</a><br/>\n" \
|
||||
""
|
||||
#define LICENSE_HTML "<a rel='license' href='https://creativecommons.org/licenses/by-nc/4.0/legalcode.txt' target='_blank'>CC-BY-NC 4</a><br/>\n" \
|
||||
"<a href='/legal_disclaimer.html'>opinions are my own</a></div>"
|
||||
"<a href='https://lightcrystal.systems' target='_blank'><img src='/img/lightcrystal_bw_small.svg' alt='lightcrystal.systems'/> \n"
|
||||
#define LICENSE_HTML "<a rel='license' target='_blank' href='/legal.html'><img src='/img/cc.svg' alt='legal stuff'/></a></div>"
|
||||
#define LOGO_HTML "<img src='/img/nilfm_blackHole_128.png' alt='blackhole://nilFM'/>"
|
||||
#define DESC "lair of drkste aka nilix: software artisan, digital philosopher"
|
||||
#define SITEROOT "../www/"
|
||||
|
|
5
main.c
5
main.c
|
@ -797,6 +797,7 @@ void inspect(Lexicon* l) {
|
|||
void map(Lexicon* l) {
|
||||
char dstpath[64];
|
||||
char srcpath[64];
|
||||
char sitemapName[] = SITEMAP "\0";
|
||||
struct dirent** d;
|
||||
FILE* siteMap;
|
||||
int n, i = 0;
|
||||
|
@ -806,7 +807,7 @@ void map(Lexicon* l) {
|
|||
dstpath[0] = 0;
|
||||
srcpath[0] = 0;
|
||||
scat(dstpath, SITEROOT);
|
||||
scat(dstpath, "sitemap.html");
|
||||
scat(dstpath, SITEMAP ".html");
|
||||
scat(srcpath, "map.htm");
|
||||
siteMap = fopen("map.htm", "w");
|
||||
/* don't use shorthand for the <ul> tag because it will easily overflow
|
||||
|
@ -829,7 +830,7 @@ void map(Lexicon* l) {
|
|||
free(d);
|
||||
fprintf(siteMap, "</ul>\n");
|
||||
fclose(siteMap);
|
||||
fclose(build(fopen(dstpath, "w"), l, "sitemap", srcpath));
|
||||
fclose(build(fopen(dstpath, "w"), l, scsw(sitemapName, '_', ' '), srcpath));
|
||||
remove("map.htm");
|
||||
printf("Created sitemap\n");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue