3 * Copyright (c) 2022 Omar Polo <op@openbsd.org>
4 * Copyright (c) 2016, 2019, 2020-2022 Tracey Emery <tracey@traceyemery.net>
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 #include "got_compat.h"
21 #include <sys/types.h>
22 #include <sys/queue.h>
33 #include "got_error.h"
34 #include "got_object.h"
35 #include "got_reference.h"
45 static int breadcumbs(struct template *);
46 static int datetime(struct template *, time_t, int);
47 static int gotweb_render_blob_line(struct template *, const char *, size_t);
48 static int gotweb_render_tree_item(struct template *, struct got_tree_entry *);
49 static int blame_line(struct template *, const char *, struct blame_line *,
52 static inline int gotweb_render_more(struct template *, int);
54 static inline int diff_line(struct template *, char *);
55 static inline int tag_item(struct template *, struct repo_tag *);
56 static inline int branch(struct template *, struct got_reflist_entry *);
57 static inline int rss_tag_item(struct template *, struct repo_tag *);
58 static inline int rss_author(struct template *, char *);
61 nextsep(char *s, char **t)
79 {{ define datetime(struct template *tp, time_t t, int fmt) }}
85 if (gmtime_r(&t, &tm) == NULL)
88 if (strftime(rfc3339, sizeof(rfc3339), "%FT%TZ", &tm) == 0)
91 if (fmt != TM_DIFF && asctime_r(&tm, datebuf) == NULL)
94 <time datetime="{{ rfc3339 }}">
95 {{ if fmt == TM_DIFF }}
96 {{ render gotweb_render_age(tp, t) }}
98 {{ datebuf }} {{ " UTC" }}
103 {{ define breadcumbs(struct template *tp) }}
105 struct request *c = tp->tp_arg;
106 struct querystring *qs = c->t->qs;
107 struct gotweb_url url;
108 const char *folder = qs->folder;
109 char *t, *s = NULL, *dir = NULL;
112 memset(&url, 0, sizeof(url));
117 url.commit = qs->commit;
119 if (folder && *folder != '\0') {
120 while (*folder == '/')
122 dir = strdup(folder);
129 <a href="{{ render gotweb_render_url(c, &url) }}">tree</a>
132 {{ while (s = nextsep(s, &t)) != NULL }}
139 <a href="{{ render gotweb_render_url(c, &url) }}">
156 {{ define gotweb_render_page(struct template *tp,
157 int (*body)(struct template *)) }}
159 struct request *c = tp->tp_arg;
160 struct server *srv = c->srv;
161 struct querystring *qs = c->t->qs;
162 struct gotweb_url u_path;
163 const char *prfx = c->document_uri;
164 const char *css = srv->custom_css;
166 memset(&u_path, 0, sizeof(u_path));
167 u_path.index_page = -1;
169 u_path.action = SUMMARY;
174 <meta charset="utf-8" />
175 <title>{{ srv->site_name }}</title>
176 <meta name="viewport" content="initial-scale=1.0" />
177 <meta name="msapplication-TileColor" content="#da532c" />
178 <meta name="theme-color" content="#ffffff"/>
179 <link rel="apple-touch-icon" sizes="180x180" href="{{ prfx }}apple-touch-icon.png" />
180 <link rel="icon" type="image/png" sizes="32x32" href="{{ prfx }}favicon-32x32.png" />
181 <link rel="icon" type="image/png" sizes="16x16" href="{{ prfx }}favicon-16x16.png" />
182 <link rel="manifest" href="{{ prfx }}site.webmanifest"/>
183 <link rel="mask-icon" href="{{ prfx }}safari-pinned-tab.svg" />
184 <link rel="stylesheet" type="text/css" href="{{ prfx }}{{ css }}" />
189 <a href="{{ srv->logo_url }}" target="_blank">
190 <img src="{{ prfx }}{{ srv->logo }}" />
196 <a href="?index_page={{ printf "%d", qs->index_page }}">
200 {! u_path.path = qs->path; !}
202 <a href="{{ render gotweb_render_url(tp->tp_arg, &u_path)}}">
206 {{ if qs->action == TREE || qs->action == BLOB }}
207 {{ render breadcumbs(tp) }}
208 {{ else if qs->action != INDEX }}
209 {{ " / " }}{{ gotweb_action_name(qs->action) }}
214 {{ render body(tp) }}
216 <footer id="site_owner_wrapper">
218 {{ if srv->show_site_owner }}
219 {{ srv->site_owner }}
227 {{ define gotweb_render_error(struct template *tp) }}
229 struct request *c = tp->tp_arg;
230 struct transport *t = c->t;
232 <div id="err_content">
236 See daemon logs for details
241 {{ define gotweb_render_repo_table_hdr(struct template *tp) }}
243 struct request *c = tp->tp_arg;
244 struct server *srv = c->srv;
246 <div id="index_header">
247 <div class="index_project">
250 {{ if srv->show_repo_description }}
251 <div class="index_project_description">
255 {{ if srv->show_repo_owner }}
256 <div class="index_project_owner">
260 {{ if srv->show_repo_age }}
261 <div class="index_project_age">
268 {{ define gotweb_render_repo_fragment(struct template *tp, struct repo_dir *repo_dir) }}
270 struct request *c = tp->tp_arg;
271 struct server *srv = c->srv;
272 struct gotweb_url summary = {
276 .path = repo_dir->name,
281 .path = repo_dir->name,
286 .path = repo_dir->name,
291 .path = repo_dir->name,
296 .path = repo_dir->name,
301 .path = repo_dir->name,
304 <div class="index_wrapper">
305 <div class="index_project">
306 <a href="{{ render gotweb_render_url(tp->tp_arg, &summary) }}">{{ repo_dir->name }}</a>
308 {{ if srv->show_repo_description }}
309 <div class="index_project_description">
310 {{ repo_dir->description }}
313 {{ if srv->show_repo_owner }}
314 <div class="index_project_owner">
315 {{ repo_dir->owner }}
318 {{ if srv->show_repo_age }}
319 <div class="index_project_age">
320 {{ render datetime(tp, repo_dir->age, TM_DIFF) }}
323 <div class="navs_wrapper">
325 <a href="{{ render gotweb_render_url(tp->tp_arg, &summary) }}">summary</a>
327 <a href="{{ render gotweb_render_url(tp->tp_arg, &briefs) }}">briefs</a>
329 <a href="{{ render gotweb_render_url(tp->tp_arg, &commits) }}">commits</a>
331 <a href="{{ render gotweb_render_url(tp->tp_arg, &tags) }}">tags</a>
333 <a href="{{ render gotweb_render_url(tp->tp_arg, &tree) }}">tree</a>
335 <a href="{{ render gotweb_render_url(tp->tp_arg, &rss) }}">rss</a>
342 {{ define gotweb_render_briefs(struct template *tp) }}
344 struct request *c = tp->tp_arg;
345 struct transport *t = c->t;
346 struct querystring *qs = c->t->qs;
347 struct repo_commit *rc;
348 struct repo_dir *repo_dir = t->repo_dir;
349 struct gotweb_url diff_url, tree_url;
352 diff_url = (struct gotweb_url){
356 .path = repo_dir->name,
357 .headref = qs->headref,
359 tree_url = (struct gotweb_url){
363 .path = repo_dir->name,
364 .headref = qs->headref,
367 <header class='subtitle'>
368 <h2>Commit Briefs</h2>
370 <div id="briefs_content">
371 {{ tailq-foreach rc &t->repo_commits entry }}
373 diff_url.commit = rc->commit_id;
374 tree_url.commit = rc->commit_id;
376 tmp = strchr(rc->committer, '<');
380 tmp = strchr(rc->commit_msg, '\n');
385 <p class='brief_meta'>
386 <span class='briefs_age'>
387 {{ render datetime(tp, rc->committer_time, TM_DIFF) }}
390 <span class="briefs_author">
394 <p class="briefs_log">
395 <a href="{{ render gotweb_render_url(tp->tp_arg, &diff_url) }}">
398 {{ if rc->refs_str }}
399 {{ " " }} <span class="refs_str">({{ rc->refs_str }})</span>
404 <div class="navs_wrapper">
406 <a href="{{ render gotweb_render_url(tp->tp_arg, &diff_url) }}">diff</a>
408 <a href="{{ render gotweb_render_url(tp->tp_arg, &tree_url) }}">tree</a>
413 {{ render gotweb_render_more(tp, BRIEFS) }}
417 {{ define gotweb_render_more(struct template *tp, int action) }}
419 struct request *c = tp->tp_arg;
420 struct transport *t = c->t;
421 struct querystring *qs = t->qs;
422 struct gotweb_url more = {
426 .commit = t->more_id,
427 .headref = qs->headref,
432 <div id="np_wrapper">
434 <a href="{{ render gotweb_render_url(c, &more) }}">
442 {{ define gotweb_render_navs(struct template *tp) }}
444 struct request *c = tp->tp_arg;
445 struct transport *t = c->t;
446 struct gotweb_url prev, next;
447 int have_prev, have_next;
449 gotweb_get_navs(c, &prev, &have_prev, &next, &have_next);
451 <div id="np_wrapper">
454 <a href="{{ render gotweb_render_url(c, &prev) }}">
461 <a href="{{ render gotweb_render_url(c, &next) }}">
476 {{ define gotweb_render_commits(struct template *tp) }}
478 struct request *c = tp->tp_arg;
479 struct transport *t = c->t;
480 struct repo_dir *repo_dir = t->repo_dir;
481 struct repo_commit *rc;
482 struct gotweb_url diff, tree;
484 diff = (struct gotweb_url){
488 .path = repo_dir->name,
490 tree = (struct gotweb_url){
494 .path = repo_dir->name,
497 <header class="subtitle">
500 <div class="commits_content">
501 {{ tailq-foreach rc &t->repo_commits entry }}
503 diff.commit = rc->commit_id;
504 tree.commit = rc->commit_id;
506 <div class="commits_header_wrapper">
507 <dl class="commits_header">
509 <dd><code class="commit-id">{{ rc->commit_id }}</code></dd>
511 <dd>{{ rc->author }}</dd>
512 {{ if strcmp(rc->committer, rc->author) != 0 }}
514 <dd>{{ rc->committer }}</dd>
518 {{ render datetime(tp, rc->committer_time, TM_LONG) }}
527 <div class="navs_wrapper">
529 <a href="{{ render gotweb_render_url(c, &diff) }}">diff</a>
531 <a href="{{ render gotweb_render_url(c, &tree) }}">tree</a>
536 {{ render gotweb_render_more(tp, COMMITS) }}
540 {{ define gotweb_render_blob(struct template *tp) }}
542 struct request *c = tp->tp_arg;
543 struct transport *t = c->t;
544 struct got_blob_object *blob = t->blob;
545 struct repo_commit *rc = TAILQ_FIRST(&t->repo_commits);
547 <header class="subtitle">
550 <div id="blob_content">
551 <div id="blob_header_wrapper">
552 <dl id="blob_header">
555 {{ render datetime(tp, rc->committer_time, TM_LONG) }}
558 <dd class="commit-msg">{{ rc->commit_msg }}</dd>
564 {{ render got_output_blob_by_lines(tp, blob, gotweb_render_blob_line) }}
570 {{ define gotweb_render_blob_line(struct template *tp, const char *line,
576 r = snprintf(lineno, sizeof(lineno), "%zu", no);
577 if (r < 0 || (size_t)r >= sizeof(lineno))
580 <div class="blob_line" id="line{{ lineno }}">
581 <a href="#line{{ lineno }}">{{ lineno }}</a>
582 <span class="blob_code">{{ line }}</span>
586 {{ define gotweb_render_tree(struct template *tp) }}
588 struct request *c = tp->tp_arg;
589 struct transport *t = c->t;
590 struct repo_commit *rc = TAILQ_FIRST(&t->repo_commits);
592 <header class='subtitle'>
595 <div id="tree_content">
596 <div id="tree_header_wrapper">
597 <dl id="tree_header">
599 <dd><code class="commit-id">{{ rc->tree_id }}</code></dd>
602 {{ render datetime(tp, rc->committer_time, TM_LONG) }}
605 <dd class="commit-msg">{{ rc->commit_msg }}</dd>
610 {{ render got_output_repo_tree(c, gotweb_render_tree_item) }}
615 {{ define gotweb_render_tree_item(struct template *tp,
616 struct got_tree_entry *te) }}
618 struct request *c = tp->tp_arg;
619 struct transport *t = c->t;
620 struct querystring *qs = t->qs;
621 struct repo_commit *rc = TAILQ_FIRST(&t->repo_commits);
622 const char *modestr = "";
627 struct gotweb_url url = {
630 .commit = rc->commit_id,
634 name = got_tree_entry_get_name(te);
635 mode = got_tree_entry_get_mode(te);
637 folder = qs->folder ? qs->folder : "";
639 if (asprintf(&dir, "%s/%s", folder, name) == -1)
650 if (got_object_tree_entry_is_submodule(te))
652 else if (S_ISLNK(mode))
654 else if (S_ISDIR(mode))
656 else if (mode & S_IXUSR)
659 <tr class="tree_wrapper">
660 {{ if S_ISDIR(mode) }}
661 <td class="tree_line" colspan=2>
662 <a href="{{ render gotweb_render_url(c, &url) }}">
663 {{ name }}{{ modestr }}
667 <td class="tree_line">
668 <a href="{{ render gotweb_render_url(c, &url) }}">
669 {{ name }}{{ modestr }}
672 <td class="tree_line_blank">
673 {! url.action = COMMITS; !}
674 <a href="{{ render gotweb_render_url(c, &url) }}">
678 {! url.action = BLAME; !}
679 <a href="{{ render gotweb_render_url(c, &url) }}">
691 {{ define gotweb_render_tags(struct template *tp) }}
693 struct request *c = tp->tp_arg;
694 struct transport *t = c->t;
695 struct querystring *qs = t->qs;
699 commit_found = qs->commit == NULL;
701 <header class='subtitle'>
704 <div id="tags_content">
705 {{ if t->tag_count == 0 }}
706 <div id="err_content">
707 This repository contains no tags
710 {{ tailq-foreach rt &t->repo_tags entry }}
711 {{ if commit_found || !strcmp(qs->commit, rt->commit_id) }}
712 {! commit_found = 1; !}
713 {{ render tag_item(tp, rt) }}
716 {{ if t->next_id || t->prev_id }}
717 {! qs->action = TAGS; !}
718 {{ render gotweb_render_navs(tp) }}
724 {{ define tag_item(struct template *tp, struct repo_tag *rt) }}
726 struct request *c = tp->tp_arg;
727 struct transport *t = c->t;
728 struct repo_dir *repo_dir = t->repo_dir;
729 char *tag_name = rt->tag_name;
730 char *msg = rt->tag_commit;
732 struct gotweb_url url = {
736 .path = repo_dir->name,
737 .commit = rt->commit_id,
740 if (strncmp(tag_name, "refs/tags/", 10) == 0)
744 nl = strchr(msg, '\n');
749 <div class="tag_age">
750 {{ render datetime(tp, rt->tagger_time, TM_DIFF) }}
752 <div class="tag_name">{{ tag_name }}</div>
753 <div class="tag_log">
754 <a href="{{ render gotweb_render_url(c, &url) }}">
758 <div class="navs_wrapper">
760 <a href="{{ render gotweb_render_url(c, &url) }}">tag</a>
762 {! url.action = BRIEFS; !}
763 <a href="{{ render gotweb_render_url(c, &url) }}">commit briefs</a>
765 {! url.action = COMMITS; !}
766 <a href="{{ render gotweb_render_url(c, &url) }}">commits</a>
772 {{ define gotweb_render_tag(struct template *tp) }}
774 struct request *c = tp->tp_arg;
775 struct transport *t = c->t;
777 const char *tag_name;
779 rt = TAILQ_LAST(&t->repo_tags, repo_tags_head);
780 tag_name = rt->tag_name;
782 if (strncmp(tag_name, "refs/", 5) == 0)
785 <header class="subtitle">
788 <div id="tags_content">
789 <div id="tag_header_wrapper">
793 <code class="commit-id">{{ rt->commit_id }}</code>
795 <span class="refs_str">({{ tag_name }})</span>
798 <dd>{{ rt->tagger }}</dd>
801 {{ render datetime(tp, rt->tagger_time, TM_LONG)}}
804 <dd class="commit-msg">{{ rt->commit_msg }}</dd>
807 <pre id="tag_commit">
814 {{ define gotweb_render_diff(struct template *tp) }}
816 struct request *c = tp->tp_arg;
817 struct transport *t = c->t;
819 struct repo_commit *rc = TAILQ_FIRST(&t->repo_commits);
824 <header class="subtitle">
827 <div id="diff_content">
828 <div id="diff_header_wrapper">
829 <dl id="diff_header">
831 <dd><code class="commit-id">{{ rc->commit_id }}</code></dd>
833 <dd>{{ rc->author }}</dd>
834 {{ if strcmp(rc->committer, rc->author) != 0 }}
836 <dd>{{ rc->committer }}</dd>
840 {{ render datetime(tp, rc->committer_time, TM_LONG) }}
843 <dd class="commit-msg">{{ rc->commit_msg }}</dd>
848 {{ while (linelen = getline(&line, &linesize, fp)) != -1 }}
849 {{ render diff_line(tp, line) }}
857 {{ define diff_line(struct template *tp, char *line )}}
859 const char *color = NULL;
862 if (!strncmp(line, "-", 1))
863 color = "diff_minus";
864 else if (!strncmp(line, "+", 1))
866 else if (!strncmp(line, "@@", 2))
867 color = "diff_chunk_header";
868 else if (!strncmp(line, "commit +", 8) ||
869 !strncmp(line, "commit -", 8) ||
870 !strncmp(line, "blob +", 6) ||
871 !strncmp(line, "blob -", 6) ||
872 !strncmp(line, "file +", 6) ||
873 !strncmp(line, "file -", 6))
875 else if (!strncmp(line, "from:", 5) || !strncmp(line, "via:", 4))
876 color = "diff_author";
877 else if (!strncmp(line, "date:", 5))
880 nl = strchr(line, '\n');
884 <span class="diff_line {{ color }}">{{ line }}</span>{{"\n"}}
887 {{ define gotweb_render_branches(struct template *tp,
888 struct got_reflist_head *refs) }}
890 struct got_reflist_entry *re;
892 <header class='subtitle'>
895 <div id="branches_content">
896 {{ tailq-foreach re refs entry }}
897 {{ if !got_ref_is_symbolic(re->ref) }}
898 {{ render branch(tp, re) }}
904 {{ define branch(struct template *tp, struct got_reflist_entry *re) }}
906 const struct got_error *err;
907 struct request *c = tp->tp_arg;
908 struct querystring *qs = c->t->qs;
911 struct gotweb_url url = {
918 refname = got_ref_get_name(re->ref);
920 err = got_get_repo_age(&age, c, refname);
922 log_warnx("%s: %s", __func__, err->msg);
926 if (strncmp(refname, "refs/heads/", 11) == 0)
929 url.headref = refname;
931 <section class="branches_wrapper">
932 <div class="branches_age">
933 {{ render datetime(tp, age, TM_DIFF) }}
936 <a href="{{ render gotweb_render_url(c, &url) }}">{{ refname }}</a>
938 <div class="navs_wrapper">
940 <a href="{{ render gotweb_render_url(c, &url) }}">summary</a>
942 {! url.action = BRIEFS; !}
943 <a href="{{ render gotweb_render_url(c, &url) }}">commit briefs</a>
945 {! url.action = COMMITS; !}
946 <a href="{{ render gotweb_render_url(c, &url) }}">commits</a>
953 {{ define gotweb_render_summary(struct template *tp) }}
955 struct request *c = tp->tp_arg;
956 struct server *srv = c->srv;
957 struct transport *t = c->t;
958 struct got_reflist_head *refs = &t->refs;
960 <dl id="summary_wrapper">
961 {{ if srv->show_repo_description }}
962 <dt>Description:</dt>
963 <dd>{{ t->repo_dir->description }}</dd>
965 {{ if srv->show_repo_owner }}
967 <dd>{{ t->repo_dir->owner }}</dd>
969 {{ if srv->show_repo_age }}
970 <dt>Last Change:</dt>
972 {{ render datetime(tp, t->repo_dir->age, TM_DIFF) }}
975 {{ if srv->show_repo_cloneurl }}
977 <dd><pre class="clone-url">{{ t->repo_dir->url }}</pre></dd>
980 {{ render gotweb_render_briefs(tp) }}
981 {{ render gotweb_render_tags(tp) }}
982 {{ render gotweb_render_branches(tp, refs) }}
985 {{ define gotweb_render_blame(struct template *tp) }}
987 const struct got_error *err;
988 struct request *c = tp->tp_arg;
989 struct transport *t = c->t;
990 struct repo_commit *rc = TAILQ_FIRST(&t->repo_commits);
992 <header class="subtitle">
995 <div id="blame_content">
996 <div id="blame_header_wrapper">
997 <dl id="blame_header">
1000 {{ render datetime(tp, rc->committer_time, TM_LONG) }}
1003 <dd class="commit-msg">{{ rc->commit_msg }}</dd>
1009 err = got_output_file_blame(c, &blame_line);
1010 if (err && err->code != GOT_ERR_CANCELLED)
1011 log_warnx("%s: got_output_file_blame: %s", __func__,
1020 {{ define blame_line(struct template *tp, const char *line,
1021 struct blame_line *bline, int lprec, int lcur) }}
1023 struct request *c = tp->tp_arg;
1024 struct transport *t = c->t;
1025 struct repo_dir *repo_dir = t->repo_dir;
1026 char *committer, *s;
1027 struct gotweb_url url = {
1031 .path = repo_dir->name,
1032 .commit = bline->id_str,
1035 s = strchr(bline->committer, '<');
1036 committer = s ? s + 1 : bline->committer;
1038 s = strchr(committer, '@');
1042 <div class="blame_wrapper">
1043 <div class="blame_number">{{ printf "%.*d", lprec, lcur }}</div>
1044 <div class="blame_hash">
1045 <a href="{{ render gotweb_render_url(c, &url) }}">
1046 {{ printf "%.8s", bline->id_str }}
1049 <div class="blame_date">{{ bline->datebuf }}</div>
1050 <div class="blame_author">{{ printf "%.9s", committer }}</div>
1051 <div class="blame_code">{{ line }}</div>
1055 {{ define gotweb_render_rss(struct template *tp) }}
1057 struct request *c = tp->tp_arg;
1058 struct server *srv = c->srv;
1059 struct transport *t = c->t;
1060 struct repo_dir *repo_dir = t->repo_dir;
1061 struct repo_tag *rt;
1062 struct gotweb_url summary = {
1066 .path = repo_dir->name,
1069 <?xml version="1.0" encoding="UTF-8"?>
1070 <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
1072 <title>Tags of {{ repo_dir->name }}</title>
1075 {{ render gotweb_render_absolute_url(c, &summary) }}
1078 {{ if srv->show_repo_description }}
1079 <description>{{ repo_dir->description }}</description>
1081 {{ tailq-foreach rt &t->repo_tags entry }}
1082 {{ render rss_tag_item(tp, rt) }}
1088 {{ define rss_tag_item(struct template *tp, struct repo_tag *rt) }}
1090 struct request *c = tp->tp_arg;
1091 struct transport *t = c->t;
1092 struct repo_dir *repo_dir = t->repo_dir;
1096 char *tag_name = rt->tag_name;
1097 struct gotweb_url tag = {
1101 .path = repo_dir->name,
1102 .commit = rt->commit_id,
1105 if (strncmp(tag_name, "refs/tags/", 10) == 0)
1108 if (gmtime_r(&rt->tagger_time, &tm) == NULL)
1110 r = strftime(rfc822, sizeof(rfc822), "%a, %d %b %Y %H:%M:%S GMT", &tm);
1115 <title>{{ repo_dir->name }} {{" "}} {{ tag_name }}</title>
1118 {{ render gotweb_render_absolute_url(c, &tag) }}
1122 <![CDATA[<pre>{{ rt->tag_commit }}</pre>]]>
1124 {{ render rss_author(tp, rt->tagger) }}
1125 <guid isPermaLink="false">{{ rt->commit_id }}</guid>
1132 {{ define rss_author(struct template *tp, char *author) }}
1136 /* what to do if the author name contains a paren? */
1137 if (strchr(author, '(') != NULL || strchr(author, ')') != NULL)
1140 t = strchr(author, '<');
1146 while (isspace((unsigned char)*--t))
1149 t = strchr(mail, '>');
1155 {{ mail }} {{" "}} ({{ author }})