aboutsummaryrefslogtreecommitdiffstats
path: root/cgitrc.5.txt
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2009-02-13 20:43:30 +0100
committerLars Hjemli <hjemli@gmail.com>2009-07-25 12:55:15 +0200
commitc4d46c7035d07070ac1ebf0c0b44df927358687f (patch)
tree562cf4f01afe78b92b13ad5be5dc01e07db04a66 /cgitrc.5.txt
parentMerge branch 'lh/embedded' (diff)
downloadcgit-c4d46c7035d07070ac1ebf0c0b44df927358687f.tar.xz
cgit-c4d46c7035d07070ac1ebf0c0b44df927358687f.zip
Add support for mime type registration and lookup
This patch makes it possible to register mappings from filename extension to mime type in cgitrc and use this mapping when returning blob content in `plain` view. The reason for adding this mapping to cgitrc (as opposed to parsing something like /etc/mime.types) is to allow quick lookup of a limited number of filename extensions (/etc/mime-types on my machine currently contains over 700 entries). NB: A nice addition to this patch would be to parse /etc/mime.types when `plain` view is requested for a file with an extension for which there is no mapping registered in cgitrc. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'cgitrc.5.txt')
-rw-r--r--cgitrc.5.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index a207fe0..7256ec0 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -147,6 +147,10 @@ max-stats::
"month", "quarter" and "year". If unspecified, statistics are
disabled. Default value: none. See also: "repo.max-stats".
+mimetype.<ext>::
+ Set the mimetype for the specified filename extension. This is used
+ by the `plain` command when returning blob content.
+
module-link::
Text which will be used as the formatstring for a hyperlink when a
submodule is printed in a directory listing. The arguments for the
@@ -325,6 +329,19 @@ snapshots=tar.gz tar.bz2 zip
##
+## List of common mimetypes
+##
+
+mimetype.git=image/git
+mimetype.html=text/html
+mimetype.jpg=image/jpeg
+mimetype.jpeg=image/jpeg
+mimetype.pdf=application/pdf
+mimetype.png=image/png
+mimetype.svg=image/svg+xml
+
+
+##
## List of repositories.
## PS: Any repositories listed when repo.group is unset will not be
## displayed under a group heading