star-ty

Generate content for online publication
git clone git://git.meso-star.fr/star-ty.git
Log | Files | Refs | README | LICENSE

commit 949fcc292c320d9dedcc886acba683fb67aa7670
parent db8658bcab5dd70fc02f9e39789fe8071e6f028e
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 10 Oct 2025 19:05:01 +0200

Updated processing of menu entries to external content

Removed error message generated by sty-genhead regarding missing
index.tsv for menu entries whose content is managed elsewhere.
This is expected because this section does not exist locally.

Diffstat:
Msrc/sty-genhead.c | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/sty-genhead.c b/src/sty-genhead.c @@ -24,6 +24,8 @@ #include <string.h> #include <unistd.h> +#include <sys/stat.h> + #define MENU_FILENAME "menu.tsv" /* File that lists the menu entries */ #define MENU_MAX_ENTRIES 16 /* Maximum number of menu entries */ @@ -595,14 +597,18 @@ print_menu1 printf("<div id=\"menu\">\n"); for(int i=0; i < menu->nitems; ++i) { + struct stat buf; const struct mentry* entry = menu->items + i; + if(i) printf(" &emsp13;|&emsp13;\n"); if(selected_entry == entry) { printf(" %s\n", entry->label); - } else if(!index_load(&index, entry->section)) { + } else if(stat(entry->section, &buf) != -1 + && S_ISDIR(buf.st_mode) + && !index_load(&index, entry->section)) { printf(" <a href=\"%s%s/%s\">%s</a>\n", root, entry->section, index.items[0].uri, entry->label); index_release(&index);