]> Lady’s Gitweb - Gitweb/commit
gitweb: Refactor feed generation, make output prettier, add Atom feed
authorJakub Narebski <redacted>
Sun, 19 Nov 2006 14:05:22 +0000 (15:05 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
commit32011bfbc6df2a1ccc158a9c77c8bbc59b3cfd607f6701ad200aecc27c572936
treee46ce3708c4d62175516a6970e23697049f5651ce528a2a1f3fa800a463ca5df
parent202e42cf26ea9c45a811c1e77faf9fbc92a1f411a8eebb75f28a9edb7d9fd75d
gitweb: Refactor feed generation, make output prettier, add Atom feed

Add support for more modern Atom web feed format. Both RSS and Atom
feeds are generated by git_feed subroutine to avoid code duplication;
git_rss and git_atom are thin wrappers around git_feed. Add links to
Atom feed in HTML header and in page footer (but not in OPML; we
should use APP, Atom Publishing Proptocol instead).

Allow for feed generation for branches other than current (HEAD)
branch, and for generation of feeds for file or directory history.

Do not use "pre ${\sub_returning_scalar(...)} post" trick, but join
strings instead: "pre " . sub_returning_scalar(...) . " post".
Use href(-full=>1, ...) instead of hand-crafting gitweb urls.

Make output prettier:
* Use title similar to the title of web page
* Use project description (if exists) for description/subtitle
* Do not add anything (committer name, commit date) to feed entry title
* Wrap the commit message in <pre>
* Make file names into an unordered list
* Add links (diff, conditional blame, history) to the file list.

In addition to the above points, the attached patch emits a
Last-Changed: HTTP response header field, and doesn't compute the feed
body if the HTTP request type was HEAD. This helps keep the web server
load down for well-behaved feed readers that check if the feed needs
updating.

If browser (feed reader) sent Accept: header, and it prefers 'text/xml' type
to 'application/rss+xml' (in the case of RSS feed) or 'application/atom+xml'
(in the case of Atom feed), then use 'text/xml' as content type.

Both RSS and Atom feeds validate at http://feedvalidator.org
and at http://validator.w3.org/feed/

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Andreas Fuchs <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.264766 seconds and 4 git commands to generate.