From 4518af7135044b7f1aa47ce73199ecb1d0f7085e Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Wed, 25 Jan 2023 22:50:25 -0700 Subject: [PATCH] add config option for sitemap name; v2.2.0 --- config.def.h | 14 ++++++-------- main.c | 5 +++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/config.def.h b/config.def.h index 5b443d1..26ea18b 100644 --- a/config.def.h +++ b/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: nilix@nilfm.cc
9058 7A74 0FA4 FFA0 9715 7538 3B7F BC22 144E 6398\n" \ "" #define NAME "nilFM" @@ -14,13 +15,10 @@ "9058 7A74 0FA4 FFA0 9715 7538 3B7F BC22 144E 6398\n" \ "" #define FOOTER_HTML "
nilFM hack lab \n" \ +"honk \n" \ "xxiivv webring \n" \ -"lightcrystal.systems \n" \ -"tips appreciated
" \ -"
sitemap
\n" \ -"" -#define LICENSE_HTML "CC-BY-NC 4
\n" \ -"opinions are my own
" +"lightcrystal.systems \n" +#define LICENSE_HTML "legal stuff" #define LOGO_HTML "blackhole://nilFM" #define DESC "lair of drkste aka nilix: software artisan, digital philosopher" #define SITEROOT "../www/" diff --git a/main.c b/main.c index 2c59484..404a6e6 100644 --- a/main.c +++ b/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 \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"); }