logo

stagit

STAtic GIT web view generator (in C) git clone https://hacktivis.me/git/stagit.git
commit: 66611a278fe57c55b776923539ac1597672c0601
parent 763e201e09b43cf914c0526c4ee3ef003279cf3c
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue,  4 Apr 2017 18:56:41 +0200

Use common path for assets(style.css & logo.png)

Diffstat:

Mconfig.h1+
Mstagit.c8++++----
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/config.h b/config.h @@ -1,3 +1,4 @@ /* See LICENSE file for copyright and license details. */ static const unsigned summarylen = 70; /* summary length in the log */ static const int showlinecount = 1; /* display line count or file size in file tree index */ +static const char *assetpath = "/git/"; /* Where are the assets (example: assetpath/style.css ) */ diff --git a/stagit.c b/stagit.c @@ -512,17 +512,17 @@ writeheader(FILE *fp, const char *title) if (description[0]) fputs(" - ", fp); xmlencode(fp, description, strlen(description)); - fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"%sfavicon.png\" />\n", relpath); + fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"%sfavicon.png\" />\n", assetpath); fputs("<link rel=\"alternate\" type=\"application/atom+xml\" title=\"", fp); xmlencode(fp, name, strlen(name)); fprintf(fp, " Atom Feed\" href=\"%satom.xml\" />\n", relpath); fputs("<link rel=\"alternate\" type=\"application/atom+xml\" title=\"", fp); xmlencode(fp, name, strlen(name)); fprintf(fp, " Atom Feed (tags)\" href=\"%stags.xml\" />\n", relpath); - fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", relpath); + fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", assetpath); fputs("</head>\n<body>\n<table><tr><td>", fp); - fprintf(fp, "<a href=\"../%s\"><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /></a>", - relpath, relpath); + fprintf(fp, "<a href=\"..\"><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /></a>", + assetpath); fputs("</td><td><h1>", fp); xmlencode(fp, strippedname, strlen(strippedname)); fputs("</h1><span class=\"desc\">", fp);