diff options
-rw-r--r-- | ui-atom.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/ui-atom.c b/ui-atom.c index 1056f36..8329e01 100644 --- a/ui-atom.c +++ b/ui-atom.c | |||
@@ -67,17 +67,12 @@ static void add_entry(struct commit *commit, const char *host) | |||
67 | html("'/>\n"); | 67 | html("'/>\n"); |
68 | free(pageurl); | 68 | free(pageurl); |
69 | } | 69 | } |
70 | htmlf("<id>%s</id>\n", hex); | 70 | html("<id>"); |
71 | html_txtf("urn:%s:%s", the_hash_algo->name, hex); | ||
72 | html("</id>\n"); | ||
71 | html("<content type='text'>\n"); | 73 | html("<content type='text'>\n"); |
72 | html_txt(info->msg); | 74 | html_txt(info->msg); |
73 | html("</content>\n"); | 75 | html("</content>\n"); |
74 | html("<content type='xhtml'>\n"); | ||
75 | html("<div xmlns='http://www.w3.org/1999/xhtml'>\n"); | ||
76 | html("<pre>\n"); | ||
77 | html_txt(info->msg); | ||
78 | html("</pre>\n"); | ||
79 | html("</div>\n"); | ||
80 | html("</content>\n"); | ||
81 | html("</entry>\n"); | 76 | html("</entry>\n"); |
82 | cgit_free_commitinfo(info); | 77 | cgit_free_commitinfo(info); |
83 | } | 78 | } |
@@ -90,6 +85,7 @@ void cgit_print_atom(char *tip, const char *path, int max_count) | |||
90 | struct commit *commit; | 85 | struct commit *commit; |
91 | struct rev_info rev; | 86 | struct rev_info rev; |
92 | int argc = 2; | 87 | int argc = 2; |
88 | int first = 1; | ||
93 | 89 | ||
94 | if (ctx.qry.show_all) | 90 | if (ctx.qry.show_all) |
95 | argv[1] = "--all"; | 91 | argv[1] = "--all"; |
@@ -130,15 +126,28 @@ void cgit_print_atom(char *tip, const char *path, int max_count) | |||
130 | html_txt(ctx.repo->desc); | 126 | html_txt(ctx.repo->desc); |
131 | html("</subtitle>\n"); | 127 | html("</subtitle>\n"); |
132 | if (host) { | 128 | if (host) { |
129 | char *fullurl = cgit_currentfullurl(); | ||
133 | char *repourl = cgit_repourl(ctx.repo->url); | 130 | char *repourl = cgit_repourl(ctx.repo->url); |
131 | html("<id>"); | ||
132 | html_txtf("%s%s%s", cgit_httpscheme(), host, fullurl); | ||
133 | html("</id>\n"); | ||
134 | html("<link rel='self' href='"); | ||
135 | html_attrf("%s%s%s", cgit_httpscheme(), host, fullurl); | ||
136 | html("'/>\n"); | ||
134 | html("<link rel='alternate' type='text/html' href='"); | 137 | html("<link rel='alternate' type='text/html' href='"); |
135 | html(cgit_httpscheme()); | 138 | html_attrf("%s%s%s", cgit_httpscheme(), host, repourl); |
136 | html_attr(host); | ||
137 | html_attr(repourl); | ||
138 | html("'/>\n"); | 139 | html("'/>\n"); |
140 | free(fullurl); | ||
139 | free(repourl); | 141 | free(repourl); |
140 | } | 142 | } |
141 | while ((commit = get_revision(&rev)) != NULL) { | 143 | while ((commit = get_revision(&rev)) != NULL) { |
144 | if (first) { | ||
145 | html("<updated>"); | ||
146 | html_txt(show_date(commit->date, 0, | ||
147 | date_mode_from_type(DATE_ISO8601_STRICT))); | ||
148 | html("</updated>\n"); | ||
149 | first = 0; | ||
150 | } | ||
142 | add_entry(commit, host); | 151 | add_entry(commit, host); |
143 | free_commit_buffer(the_repository->parsed_objects, commit); | 152 | free_commit_buffer(the_repository->parsed_objects, commit); |
144 | free_commit_list(commit->parents); | 153 | free_commit_list(commit->parents); |