File tree Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Original file line number Diff line number Diff line change 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
2
6
{
3
7
options . enableMan = lib . mkOption {
4
8
type = lib . types . bool ;
16
20
./platforms.nix
17
21
] ;
18
22
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 = {
21
38
optionScopes = [ "docs" ] ;
22
39
page . menu . location = [ "docs" ] ;
23
40
page . text = ''
Original file line number Diff line number Diff line change 1
1
{
2
2
lib ,
3
+ fixLinks ,
3
4
runCommand ,
4
5
availableVersions ? [ ] ,
5
6
baseHref ? "/" , # TODO: remove & get from module config
@@ -21,15 +22,11 @@ runCommand "index.md"
21
22
{
22
23
start = "<!-- START DOCS -->" ;
23
24
end = "<!-- STOP DOCS -->" ;
24
- baseurl = "https://nix-community.github.io/nixvim/" ;
25
- src = ../../README.md ;
25
+ src = fixLinks ../../README.md ;
26
26
}
27
27
''
28
28
# extract relevant section of the README
29
29
sed -n "/$start/,/$end/p" $src > $out
30
- # replace absolute links
31
- substituteInPlace $out --replace-quiet "$baseurl" "./"
32
- # TODO: replace .html with .md
33
30
'' ;
34
31
35
32
docs_versions =
You can’t perform that action at this time.
0 commit comments