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

wangzx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts-handbook.git


The following commit(s) were added to refs/heads/master by this push:
     new 4f840aa  remove "remove extra template tag" logic as it looks good now.
4f840aa is described below

commit 4f840aae1f630441e334b89cbc70d1aedab4a2d3
Author: plainheart <[email protected]>
AuthorDate: Sat Dec 11 16:25:13 2021 +0800

    remove "remove extra template tag" logic as it looks good now.
---
 build/generate.js | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/build/generate.js b/build/generate.js
index 262cc34..e5f33ef 100644
--- a/build/generate.js
+++ b/build/generate.js
@@ -14,18 +14,16 @@ async function updateNav() {
     console.log('Fetching...', localPath)
     let navContent = ''
     try {
-      navContent = fs.readFileSync(`${websitePath}/${locale}/nav.html`)
+      navContent = fs.readFileSync(localPath, 'utf-8')
     } catch (e) {
+      console.error('failed to read local nav file', e)
       console.log(
-        'Local file not found. Fetching...',
+        'Fetching...',
         `https://echarts.apache.org/${locale}/nav.html`
       )
       navContent = (await fetch(
         `https://echarts.apache.org/${locale}/nav.html`
       ).then(response => response.text()))
-      // remove extra `template` tag
-      // PENDING: Generated nav html by echarts-www action seems buggy
-      navContent = navContent.replace(/<\/?template>/g, '').trim()
     }
 
     fs.writeFileSync(

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to