summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
Unidiff
Diffstat (limited to 'ui-shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 749ea35..5ce2bc5 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -482,49 +482,50 @@ void cgit_print_http_headers(struct cgit_context *ctx)
482 html("\n"); 482 html("\n");
483} 483}
484 484
485void cgit_print_docstart(struct cgit_context *ctx) 485void cgit_print_docstart(struct cgit_context *ctx)
486{ 486{
487 char *host = cgit_hosturl(); 487 char *host = cgit_hosturl();
488 html(cgit_doctype); 488 html(cgit_doctype);
489 html("<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>\n"); 489 html("<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>\n");
490 html("<head>\n"); 490 html("<head>\n");
491 html("<title>"); 491 html("<title>");
492 html_txt(ctx->page.title); 492 html_txt(ctx->page.title);
493 html("</title>\n"); 493 html("</title>\n");
494 htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version); 494 htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version);
495 if (ctx->cfg.robots && *ctx->cfg.robots) 495 if (ctx->cfg.robots && *ctx->cfg.robots)
496 htmlf("<meta name='robots' content='%s'/>\n", ctx->cfg.robots); 496 htmlf("<meta name='robots' content='%s'/>\n", ctx->cfg.robots);
497 html("<link rel='stylesheet' type='text/css' href='"); 497 html("<link rel='stylesheet' type='text/css' href='");
498 html_attr(ctx->cfg.css); 498 html_attr(ctx->cfg.css);
499 html("'/>\n"); 499 html("'/>\n");
500 if (ctx->cfg.favicon) { 500 if (ctx->cfg.favicon) {
501 html("<link rel='shortcut icon' href='"); 501 html("<link rel='shortcut icon' href='");
502 html_attr(ctx->cfg.favicon); 502 html_attr(ctx->cfg.favicon);
503 html("'/>\n"); 503 html("'/>\n");
504 } 504 }
505 if (host && ctx->repo) { 505 if (host && ctx->repo) {
506 html("<link rel='alternate' title='Atom feed' href='http://"); 506 html("<link rel='alternate' title='Atom feed' href='");
507 html(cgit_httpscheme());
507 html_attr(cgit_hosturl()); 508 html_attr(cgit_hosturl());
508 html_attr(cgit_fileurl(ctx->repo->url, "atom", ctx->qry.path, 509 html_attr(cgit_fileurl(ctx->repo->url, "atom", ctx->qry.path,
509 fmt("h=%s", ctx->qry.head))); 510 fmt("h=%s", ctx->qry.head)));
510 html("' type='application/atom+xml'/>"); 511 html("' type='application/atom+xml'/>");
511 } 512 }
512 html("</head>\n"); 513 html("</head>\n");
513 html("<body>\n"); 514 html("<body>\n");
514 if (ctx->cfg.header) 515 if (ctx->cfg.header)
515 html_include(ctx->cfg.header); 516 html_include(ctx->cfg.header);
516} 517}
517 518
518void cgit_print_docend() 519void cgit_print_docend()
519{ 520{
520 html("</div>"); 521 html("</div>");
521 if (ctx.cfg.footer) 522 if (ctx.cfg.footer)
522 html_include(ctx.cfg.footer); 523 html_include(ctx.cfg.footer);
523 else { 524 else {
524 htmlf("<div class='footer'>generated by cgit %s at ", 525 htmlf("<div class='footer'>generated by cgit %s at ",
525 cgit_version); 526 cgit_version);
526 cgit_print_date(time(NULL), FMT_LONGDATE, ctx.cfg.local_time); 527 cgit_print_date(time(NULL), FMT_LONGDATE, ctx.cfg.local_time);
527 html("</div>\n"); 528 html("</div>\n");
528 } 529 }
529 html("</body>\n</html>\n"); 530 html("</body>\n</html>\n");
530} 531}