You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2021/11/22 23:25:54 UTC

[skywalking-website] branch master updated: fix (#357)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-website.git


The following commit(s) were added to refs/heads/master by this push:
     new f7a59d2  fix (#357)
f7a59d2 is described below

commit f7a59d2c1c0e97ae062c64a946b6c73fa034e27c
Author: Juntao Zhang <71...@qq.com>
AuthorDate: Tue Nov 23 07:25:42 2021 +0800

    fix (#357)
---
 docs.js | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/docs.js b/docs.js
index 847e899..0f6d0d6 100644
--- a/docs.js
+++ b/docs.js
@@ -1,12 +1,13 @@
-const fs = require("fs");
-const process = require("process");
-const path = require("path");
+const fs = require('fs');
+const process = require('process');
+const path = require('path');
 const YAML = require('yamljs');
-const axios = require('axios');
-const {execSync} = require("child_process");
+const {execSync} = require('child_process');
+
 const {promises} = fs;
 const docConfig = './data/docs.yml';
 const layoutTemplateFile = '/themes/docsy/layouts/projectDoc/baseof.html';
+const LATEST = 'latest';
 
 init();
 
@@ -151,7 +152,6 @@ async function traverseDocsList(result) {
         const docName = repo === 'skywalking' ? 'main' : repo;
         const localPath = `/content/docs/${docName}/${version}`;
         const menuFileName = `${docName.replace(/\-|\./g, '_')}${version.replace(/\-|v|\./g, '_')}`;
-        docsInfo.push({localPath, repoUrl, commitId, docName, version})
 
         tpl += `{{ if in .File.Path "${localPath.split('/content/')[1]}" }}
                   {{ $currentVersion := .Site.Data.docSidebar.${menuFileName}.version }}
@@ -169,6 +169,11 @@ async function traverseDocsList(result) {
                 {{ end }}\n`;
 
         execSync(`"./doc.sh" ${repo} ${repoUrl} ${commitId} ${localPath} ${menuFileName}`);
+        const sha = execSync(`git -C ./tmp/${repo} rev-parse HEAD`);
+        if(version === LATEST && sha){
+          commitId = sha.toString().replace('\n', '');
+        }
+        docsInfo.push({localPath, repoUrl, commitId, docName, version})
 
         await handleMenuFiles(`./data/docSidebar/${menuFileName}.yml`, {
           version,