mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-22 04:57:56 +03:00
* Support short URLs (http://server/wiki/Page instead of
http://server/w/index.php?title=Page). svn path=/nixos/trunk/; revision=18783
This commit is contained in:
parent
aacd16cff0
commit
4eabed3f0f
@ -49,6 +49,14 @@ let
|
|||||||
|
|
||||||
$wgSitename = "${config.siteName}";
|
$wgSitename = "${config.siteName}";
|
||||||
|
|
||||||
|
${optionalString (config.logo != "") ''
|
||||||
|
$wgLogo = "${config.logo}";
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (config.articleUrlPrefix != "") ''
|
||||||
|
$wgArticlePath = "${config.articleUrlPrefix}/$1";
|
||||||
|
''}
|
||||||
|
|
||||||
${config.extraConfig}
|
${config.extraConfig}
|
||||||
?>
|
?>
|
||||||
'';
|
'';
|
||||||
@ -95,6 +103,10 @@ in
|
|||||||
Allow from all
|
Allow from all
|
||||||
DirectoryIndex index.php
|
DirectoryIndex index.php
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
|
${optionalString (config.articleUrlPrefix != "") ''
|
||||||
|
Alias ${config.articleUrlPrefix} ${mediawikiRoot}/index.php
|
||||||
|
''}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
@ -168,14 +180,29 @@ in
|
|||||||
description = "Name of the wiki";
|
description = "Name of the wiki";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
logo = mkOption {
|
||||||
|
default = "";
|
||||||
|
example = "/images/logo.png";
|
||||||
|
description = "The URL of the site's logo (which should be a 135x135px image).";
|
||||||
|
};
|
||||||
|
|
||||||
urlPrefix = mkOption {
|
urlPrefix = mkOption {
|
||||||
example = "/wiki";
|
default = "/w";
|
||||||
default = "/wiki";
|
|
||||||
description = ''
|
description = ''
|
||||||
The URL prefix under which the Mediawiki service appears.
|
The URL prefix under which the Mediawiki service appears.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
articleUrlPrefix = mkOption {
|
||||||
|
default = "/wiki";
|
||||||
|
example = "";
|
||||||
|
description = ''
|
||||||
|
The URL prefix under which article pages appear,
|
||||||
|
e.g. http://server/wiki/Page. Leave empty to use the main URL
|
||||||
|
prefix, e.g. http://server/w/index.php?title=Page.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
example =
|
example =
|
||||||
@ -207,5 +234,13 @@ in
|
|||||||
) | ${pkgs.postgresql}/bin/psql -U "${config.dbUser}" "${config.dbName}"
|
) | ${pkgs.postgresql}/bin/psql -U "${config.dbUser}" "${config.dbName}"
|
||||||
fi
|
fi
|
||||||
'');
|
'');
|
||||||
|
|
||||||
|
robotsEntries = optionalString (config.articleUrlPrefix != "")
|
||||||
|
''
|
||||||
|
User-agent: *
|
||||||
|
Disallow: ${config.urlPrefix}/
|
||||||
|
Disallow: ${config.articleUrlPrefix}/Special:Search
|
||||||
|
Disallow: ${config.articleUrlPrefix}/Special:Random
|
||||||
|
'';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user