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 2022/06/09 14:50:52 UTC

[skywalking-website] branch master updated: Add description for documentation (#460)

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 ea26b62004 Add description for documentation (#460)
ea26b62004 is described below

commit ea26b62004c0345a71530a1246f5e2d791a0ca11
Author: Juntao Zhang <71...@qq.com>
AuthorDate: Thu Jun 9 22:50:47 2022 +0800

    Add description for documentation (#460)
---
 docs.js                                           | 14 ++++++++++----
 themes/docsy/assets/scss/_custom_project_doc.scss | 17 +++++++++++++++--
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/docs.js b/docs.js
index f0070ff898..03ffc785da 100644
--- a/docs.js
+++ b/docs.js
@@ -145,7 +145,7 @@ async function traverseDocsList(result) {
         continue;
       }
       for (const doc of item.docs) {
-        const {repo, repoUrl, docs} = item;
+        const {repo, repoUrl, docs, description, icon} = item;
         if (!repoUrl) continue;
         let {version, commitId} = doc;
         commitId = commitId || version;
@@ -154,8 +154,15 @@ async function traverseDocsList(result) {
         const menuFileName = `${docName.replace(/\-|\./g, '_')}${version.replace(/\-|v|\./g, '_')}`;
 
         tpl += `{{ if in .File.Path "${localPath.split('/content/')[1]}" }}
+                  <div class="description-wrapper">
+                    <h5>
+                    <img width="26" height="26" src="/images/project/${icon}.svg">
+                    ${repo}
+                    </h5>
+                    <p>${description}</p>
+                  </div>
                   {{ $currentVersion := .Site.Data.docSidebar.${menuFileName}.version }}
-                  <h5>Documentation: 
+                  <div class="version-wrapper">Version: 
                   <select class="version-select">
                   {{range .Site.Data.docSidebar.${menuFileName}.repoDocs}}
                     {{$version := .version}}
@@ -169,7 +176,7 @@ async function traverseDocsList(result) {
                     </option>
                   {{end}}
                   </select>
-                  </h5>
+                  </div>
                   
                   {{ partial "sidebar-menu.html" .Site.Data.docSidebar.${menuFileName} }}
                   <div class="commit-id">Commit Id: {{.Site.Data.docSidebar.${menuFileName}.commitId}}</div>
@@ -205,7 +212,6 @@ async function generateLayoutTemplate(targetPath, tpl) {
 
 function handleDocsFiles(docsInfo) {
   docsInfo.forEach((docInfo) => {
-
     const {localPath} = docInfo
     const root = path.join(__dirname, localPath);
     readDirSync(root, docInfo, replaceMarkdownText);
diff --git a/themes/docsy/assets/scss/_custom_project_doc.scss b/themes/docsy/assets/scss/_custom_project_doc.scss
index dad1b000dd..5ad9482055 100644
--- a/themes/docsy/assets/scss/_custom_project_doc.scss
+++ b/themes/docsy/assets/scss/_custom_project_doc.scss
@@ -44,11 +44,24 @@
     top: 0px;
     background-color: #fff;
 
-    h5 {
-      padding-top: 0;
+    .description-wrapper {
+      padding: 0 11px;
+      border-bottom: 1px solid #cccccc40;
+      h5 {
+        padding-top: 0;
+      }
+    }
+
+    .version-wrapper {
+      padding-top: 10px;
       font-weight: 400;
       font-size: 16px;
       text-indent: 8px;
+      line-height: 1.5;
+      margin-top: 0;
+      margin-bottom: 0.5rem;
+      font-family: inherit;
+      color: inherit;
     }
   }