From bccea6d1d8158bb539cce97f08299c04860388b6 Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Thu, 12 Jan 2023 00:19:55 -0700 Subject: [PATCH] small changes to accomodate the site reorg; v1.1 --- config.def.h | 52 +++++++++++++++++++++++++++------------------------- deploy.sh | 8 +++++++- main.c | 35 +++++++++++++++++++---------------- 3 files changed, 53 insertions(+), 42 deletions(-) diff --git a/config.def.h b/config.def.h index 2536b72..fa8e36f 100644 --- a/config.def.h +++ b/config.def.h @@ -1,13 +1,14 @@ -#define DESC "lair of drkste aka nilix: artist, programmer, philosopher" +#define DESC "lair of drkste aka nilix: software artisan, digital philosopher" #define LEXICON_SIZE 1024 -#define MAINCSS "/new.css" -#define FOOTER \ - "visit the nilFM hack "         \
-  "lab. \n" \ - " \n" \ - "
\n" \ +#define MAINCSS "/nilfm.css" +#define FOOTER \ + " \n" \ + " \nlightcrystal.systems
\n" \ "
sitemap
\n" #define LICENSE \ "opinions are my own" #define SITEROOT "../www/" #define TAG_BODY_SIZE 4096 -#define CONTACT \ - "contact: nilix@nilfm.cc (keys)
\n" \ +#define CONTACT \ + "contact: nilix@nilfm.cc [0x90587A740FA4FFA0]
\n" \ "" #define DOMAIN "https://nilfm.cc" -#define FRONTCSS "/front.css" -#define ABOUT \ - "Derek Stevens <nilix@nilfm.cc>
\n" \ - "artist, programmer, philosopher

\n" \ - "verify my signature: signing public " \ - "key
\n" \ - "send me an encrypted message: encryption " \ - "public key\n" \ - "" -#define LOGO "blackHole://server" +#define FRONTCSS "/nilfm.css" +#define ABOUT \ + "Derek Stevens <nilix@nilfm.cc>
\n" \ + "software artisan, digital philosopher

\n" \ + "[0x90587A740FA4FFA0" \ + "]\n" +#define LOGO "blackhole://nilFM" #define NAME "nilFM" +#define TWTXT "/twtxt.txt" +#define SEPARATEH1 0 \ No newline at end of file diff --git a/deploy.sh b/deploy.sh index 832937d..18a3501 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,3 +1,9 @@ +#!/bin/sh + DEST="nilix@lynx.uberspace.de:~/lib/nilfm/" -rsync -avK --delete ../ ${DEST} +if [ -z "$1" ]; then + rsync -avK --delete ../ ${DEST} +elif [ "$1" = "--resync" ]; then + rsync -avk --delete ${DEST} ../ +fi diff --git a/main.c b/main.c index f0e7254..a6caa82 100644 --- a/main.c +++ b/main.c @@ -69,20 +69,23 @@ int findf(Lexicon* l, char* f) { } int gettwtxt(FILE* f) { + char buf[1024] = {0}; char line[256]; char datebuf[16] = {0}; char msgbuf[240] = {0}; char *l, *d, *m; - FILE* twtxt = fopen(SITEROOT "twtxt.txt", "r"); + FILE* twtxt = fopen(SITEROOT TWTXT, "r"); scat(buf, "

recent activity:

\n\n"); if (!twtxt) { - error("Get twtxt feed", "no twtxt.txt"); - return 0; + return 1; } else { int i = 0; while (fgets(line, 256, twtxt) && i < 3) { + if (*line == '#') { + continue; + } l = line; while (*l != 'T') { ccat(datebuf, *l++); @@ -107,7 +110,7 @@ int gettwtxt(FILE* f) { i++; } fclose(twtxt); - scat(buf, "
see all\n"); + scat(buf, "see all\n"); scat(buf, "
\n"); fputs(buf, f); return 1; @@ -540,7 +543,7 @@ int fptemplate(FILE* f, Lexicon* l, char* s) { if (target < 0) { return error("Missing link", s); } - fprintf(f, "", scsw(stlc(s), ' ', '_')); + fprintf(f, "", scsw(stlc(s), ' ', '_')); fprintf(f, "%s", scsw(stlc(s), '_', ' ')); l->refs[target]++; return 1; @@ -677,17 +680,14 @@ FILE* build(FILE* f, Lexicon* l, char* name, char* srcpath) { fputs("\n", f); fputs("\n", f); /* header */ - fputs("
\n", f); - if (ismetanav(name)) { - fputs("

" LOGO "

\n", f); - } else { - fputs("

" LOGO "

\n", f); - } - - fputs("
\n", f); - /* about (main page only) */ - if (ismetanav(name)) { - fputs("
" ABOUT "
\n", f); + if (SEPARATEH1) { + fputs("
\n", f); + if (ismetanav(name)) { + fputs("

" LOGO "

\n", f); + } else { + fputs("

" LOGO "

\n", f); + } + fputs("
\n", f); } /* nav */ fputs("