Skip to content

Commit 7bf8b88

Browse files
committed
modules/docs: add CONTRIBUTING page
1 parent a3ef2c5 commit 7bf8b88

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

modules/docs/default.nix

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
{ lib, ... }:
1+
{ lib, pkgs, ... }:
2+
let
3+
# Convert links relative to github -> relative to docs
4+
fixLinks = pkgs.callPackage ../../docs/fix-links { };
5+
in
26
{
37
options.enableMan = lib.mkOption {
48
type = lib.types.bool;
@@ -16,8 +20,21 @@
1620
./platforms.nix
1721
];
1822

19-
config.docs.optionPages = {
20-
docs = {
23+
config.docs = {
24+
pages."" = {
25+
menu.section = "header";
26+
menu.location = [ "Home" ];
27+
source = pkgs.callPackage ./readme.nix {
28+
inherit fixLinks;
29+
# TODO: get `availableVersions` and `baseHref` from module options
30+
};
31+
};
32+
pages.contributing = {
33+
menu.section = "footer";
34+
menu.location = [ "Contributing" ];
35+
source = fixLinks ../../CONTRIBUTING.md;
36+
};
37+
optionPages.docs = {
2138
optionScopes = [ "docs" ];
2239
page.menu.location = [ "docs" ];
2340
page.text = ''

modules/docs/readme.nix

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
lib,
3+
fixLinks,
34
runCommand,
45
availableVersions ? [ ],
56
baseHref ? "/", # TODO: remove & get from module config
@@ -21,15 +22,11 @@ runCommand "index.md"
2122
{
2223
start = "<!-- START DOCS -->";
2324
end = "<!-- STOP DOCS -->";
24-
baseurl = "https://nix-community.github.io/nixvim/";
25-
src = ../../README.md;
25+
src = fixLinks ../../README.md;
2626
}
2727
''
2828
# extract relevant section of the README
2929
sed -n "/$start/,/$end/p" $src > $out
30-
# replace absolute links
31-
substituteInPlace $out --replace-quiet "$baseurl" "./"
32-
# TODO: replace .html with .md
3330
'';
3431

3532
docs_versions =

0 commit comments

Comments
 (0)