Skip to content

Commit 500bca8

Browse files
committed
Read the version number for api pages from _config.yml
1 parent 8a279c6 commit 500bca8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

generate/lib/write_api_docs.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ var Path = require('path');
33
var changeCase = require('change-case');
44

55
var writeApiDocs = function(apiData, path) {
6+
var configymlpath = Path.join(__dirname, '..', '..', '_config.yml');
7+
var configyml = fs.readFileSync(configymlpath).toString();
8+
var current_nodegit_version = configyml.match(/current_nodegit_version: (\d+\.\d+\.\d+)/)[1];
9+
610
var path = path || '';
711
path = ("/" + path + "/").replace(/\/+/g, '/');
812

@@ -312,7 +316,7 @@ var writeApiDocs = function(apiData, path) {
312316
pageContent += "layout: default\n";
313317
pageContent += "menu_item: api\n";
314318
pageContent += "title: " + item + "\n";
315-
pageContent += "description: Version 0.7.0\n";
319+
pageContent += "description: Version " + current_nodegit_version + "\n";
316320
pageContent += "menu_item: api\n";
317321
pageContent += "return_to:\n";
318322
pageContent += " \"API Documentation Index\": " + path + "api/\n";
@@ -329,7 +333,7 @@ var writeApiDocs = function(apiData, path) {
329333
homeContent += "layout: default\n";
330334
homeContent += "menu_item: api\n";
331335
homeContent += "title: API Docs\n";
332-
homeContent += "description: Version 0.7.0\n";
336+
homeContent += "description: Version " + current_nodegit_version + "\n";
333337
homeContent += "menu_item: api\n";
334338
homeContent += "sections:\n";
335339
homeContent += homeSections;

0 commit comments

Comments
 (0)