0009-Use-common-path-for-assets-style.css-logo.png.patch (2012B)
- From 8c648491538dc93052127d352fc880996138eb05 Mon Sep 17 00:00:00 2001
- From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
- Date: Tue, 4 Apr 2017 18:56:41 +0200
- Subject: [PATCH 09/22] Use common path for assets(style.css & logo.png)
- ---
- config.h | 1 +
- stagit.c | 8 ++++----
- 2 files changed, 5 insertions(+), 4 deletions(-)
- diff --git a/config.h b/config.h
- index 72da0f4..09a5b79 100644
- --- 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
- index 78390c9..33edd82 100644
- --- a/stagit.c
- +++ b/stagit.c
- @@ -352,13 +352,13 @@ 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);
- fprintf(fp, "<link rel=\"alternate\" type=\"application/atom+xml\" title=\"%s Atom Feed\" href=\"%satom.xml\" />\n",
- name, 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);
- --
- 2.26.2