File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,7 +71,9 @@ void_guides_outputs = \
7171
7272dist/void-guides/db.json : compile-db.js $(void_guides_sources )
7373 mkdir -p dist/void-guides
74- node compile-db.js $@ $(sort $(void_guides_sources ) )
74+ node compile-db.js \
75+ void-guides void-guides/ \
76+ $(sort $(void_guides_sources ) )
7577
7678dist/void-guides/% .html : \
7779 src/templates/docs.html src/main.html src/submodules/void-guides/%.md \
Original file line number Diff line number Diff line change @@ -21,8 +21,12 @@ function readFile(path) {
2121
2222// Parse inputs.
2323const db = [ ] ;
24- const output = process . argv [ 2 ] ;
25- const inputs = process . argv . slice ( 3 ) ;
24+
25+ const repo = process . argv [ 2 ] ;
26+ const prefix = process . argv [ 3 ] ;
27+
28+ const output = `dist/${ repo } /db.json` ;
29+ const inputs = process . argv . slice ( 4 ) ;
2630
2731for ( const input of inputs ) {
2832 // Initialize entry and push it to database.
@@ -32,6 +36,11 @@ for (const input of inputs) {
3236
3337 db . push ( entry ) ;
3438
39+ // Generate link.
40+ let href = input . substring ( 15 + prefix . length , input . length - 3 ) ;
41+
42+ entry . href = `/${ repo } /${ href } ` ;
43+
3544 // Read file contents.
3645 entry . content = readFile ( input ) ;
3746
You can’t perform that action at this time.
0 commit comments