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 */
|
/* clang-format off */
|
||||||
|
|
||||||
#define MAINCSS "/nilfm.css?v=20220117.1"
|
#define MAINCSS "/nilfm.css?v=20220119.0"
|
||||||
#define DOMAIN "https://nilfm.cc"
|
#define DOMAIN "https://nilfm.cc"
|
||||||
#define LEXICON_SIZE 1024
|
#define LEXICON_SIZE 1024
|
||||||
#define TWTXT "/twtxt.txt"
|
#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 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"
|
#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" \
|
"<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" \
|
#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://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='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/>" \
|
#define LICENSE_HTML "<a rel='license' target='_blank' href='/legal.html'><img src='/img/cc.svg' alt='legal stuff'/></a></div>"
|
||||||
"<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>"
|
|
||||||
#define LOGO_HTML "<img src='/img/nilfm_blackHole_128.png' alt='blackhole://nilFM'/>"
|
#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 DESC "lair of drkste aka nilix: software artisan, digital philosopher"
|
||||||
#define SITEROOT "../www/"
|
#define SITEROOT "../www/"
|
||||||
|
|
5
main.c
5
main.c
|
@ -797,6 +797,7 @@ void inspect(Lexicon* l) {
|
||||||
void map(Lexicon* l) {
|
void map(Lexicon* l) {
|
||||||
char dstpath[64];
|
char dstpath[64];
|
||||||
char srcpath[64];
|
char srcpath[64];
|
||||||
|
char sitemapName[] = SITEMAP "\0";
|
||||||
struct dirent** d;
|
struct dirent** d;
|
||||||
FILE* siteMap;
|
FILE* siteMap;
|
||||||
int n, i = 0;
|
int n, i = 0;
|
||||||
|
@ -806,7 +807,7 @@ void map(Lexicon* l) {
|
||||||
dstpath[0] = 0;
|
dstpath[0] = 0;
|
||||||
srcpath[0] = 0;
|
srcpath[0] = 0;
|
||||||
scat(dstpath, SITEROOT);
|
scat(dstpath, SITEROOT);
|
||||||
scat(dstpath, "sitemap.html");
|
scat(dstpath, SITEMAP ".html");
|
||||||
scat(srcpath, "map.htm");
|
scat(srcpath, "map.htm");
|
||||||
siteMap = fopen("map.htm", "w");
|
siteMap = fopen("map.htm", "w");
|
||||||
/* don't use shorthand for the <ul> tag because it will easily overflow
|
/* don't use shorthand for the <ul> tag because it will easily overflow
|
||||||
|
@ -829,7 +830,7 @@ void map(Lexicon* l) {
|
||||||
free(d);
|
free(d);
|
||||||
fprintf(siteMap, "</ul>\n");
|
fprintf(siteMap, "</ul>\n");
|
||||||
fclose(siteMap);
|
fclose(siteMap);
|
||||||
fclose(build(fopen(dstpath, "w"), l, "sitemap", srcpath));
|
fclose(build(fopen(dstpath, "w"), l, scsw(sitemapName, '_', ' '), srcpath));
|
||||||
remove("map.htm");
|
remove("map.htm");
|
||||||
printf("Created sitemap\n");
|
printf("Created sitemap\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue