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

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 3463758  [Website][Doc] Add the sharing blog function to the document 
site (#7047)
3463758 is described below

commit 34637589c50d98691d3c96e0debe4b190c3de738
Author: wangyongfeng <943155...@qq.com>
AuthorDate: Tue Nov 9 10:01:23 2021 +0800

    [Website][Doc] Add the sharing blog function to the document site (#7047)
    
    Add the sharing blog function to the document site, including the blog list 
and detail page. At the same time, a guide on how to share blogs has been added 
to the developer guide.
---
 docs/.vuepress/config.js                         |  12 +-
 docs/.vuepress/public/images/home/new.svg        |   1 +
 docs/.vuepress/sidebar/en.js                     |   1 +
 docs/.vuepress/sidebar/zh-CN.js                  |   1 +
 docs/.vuepress/theme/components/Home.vue         |  33 ++++++
 docs/.vuepress/theme/layouts/Article.vue         |  63 +++++++++++
 docs/.vuepress/theme/layouts/ArticleList.vue     | 138 +++++++++++++++++++++++
 docs/en/README.md                                |   2 +
 docs/en/article/article-list.md                  |   7 ++
 docs/en/developer-guide/How-to-Share-blogs.md    |  90 +++++++++++++++
 docs/zh-CN/README.md                             |   2 +
 docs/zh-CN/article/article-list.md               |   7 ++
 docs/zh-CN/developer-guide/How-to-Share-blogs.md |  91 +++++++++++++++
 13 files changed, 447 insertions(+), 1 deletion(-)

diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js
index 9ceb9d2..4b1f36e 100644
--- a/docs/.vuepress/config.js
+++ b/docs/.vuepress/config.js
@@ -94,7 +94,12 @@ module.exports = {
             text: 'Download', link: '/en/downloads/downloads'
           }
         ],
-        sidebar: convertSidebar(require('./sidebar/en.js'), '/en/')
+        sidebar: convertSidebar(require('./sidebar/en.js'), '/en/'),
+        article: {
+          metaTime: 'Date',
+          paginationPre: 'Prev',
+          paginationNext: 'Next'
+        }
       },
       '/zh-CN/': {
         algolia: buildAlgoliaSearchConfig('zh-CN'),
@@ -108,6 +113,11 @@ module.exports = {
         ],
         sidebar: {
           '/zh-CN/': convertSidebar(require('./sidebar/zh-CN.js'), '/zh-CN/')
+        },
+        article: {
+          metaTime: '时间',
+          paginationPre: '上一页',
+          paginationNext: '下一页'
         }
       }
     }
diff --git a/docs/.vuepress/public/images/home/new.svg 
b/docs/.vuepress/public/images/home/new.svg
new file mode 100644
index 0000000..5cceb10
--- /dev/null
+++ b/docs/.vuepress/public/images/home/new.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 
1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";><svg 
t="1636341177243" class="icon" viewBox="0 0 1024 1024" version="1.1" 
xmlns="http://www.w3.org/2000/svg"; p-id="17682" 
xmlns:xlink="http://www.w3.org/1999/xlink"; width="128" 
height="128"><defs><style type="text/css"></style></defs><path d="M245.76 
286.72h552.96c124.928 0 225.28 100.352 225.28 225.28s-100.352 225.28-225.28 
225.28H0V532.48c0-135.168 110. [...]
\ No newline at end of file
diff --git a/docs/.vuepress/sidebar/en.js b/docs/.vuepress/sidebar/en.js
index 840f7f2..7def2e7 100644
--- a/docs/.vuepress/sidebar/en.js
+++ b/docs/.vuepress/sidebar/en.js
@@ -633,6 +633,7 @@ module.exports = [
         "be-vscode-dev",               
         "java-format-code",
         "cpp-format-code",
+        "How-to-Share-blogs"
     ],
   },
   {
diff --git a/docs/.vuepress/sidebar/zh-CN.js b/docs/.vuepress/sidebar/zh-CN.js
index 6b83951..c774381 100644
--- a/docs/.vuepress/sidebar/zh-CN.js
+++ b/docs/.vuepress/sidebar/zh-CN.js
@@ -637,6 +637,7 @@ module.exports = [
         "be-vscode-dev",
         "java-format-code",
         "cpp-format-code",
+        "How-to-Share-blogs"
     ],
   },
   {
diff --git a/docs/.vuepress/theme/components/Home.vue 
b/docs/.vuepress/theme/components/Home.vue
index c9799f2..e2a90a8 100644
--- a/docs/.vuepress/theme/components/Home.vue
+++ b/docs/.vuepress/theme/components/Home.vue
@@ -54,6 +54,10 @@ under the License.
               class="action-button"
               :item="actionLink"
             />
+            <NavLink
+              class="action-button article-button"
+              :item="articleLink"
+            />
           </p>
         </div>
         <div
@@ -71,6 +75,7 @@ under the License.
     </header>
 
     <div class="structure wrapper">
+      <div v-html="$page.excerpt"></div>
       <div class="image">
         <img
           v-if="data.structure.image"
@@ -187,6 +192,12 @@ export default {
         link: this.data.structure.actionLink,
         text: this.data.structure.actionText
       }
+    },
+    articleLink() {
+      return {
+        link: this.data.articleLink,
+        text: this.data.articleText
+      }
     }
   }
 }
@@ -243,6 +254,28 @@ export default {
           &:hover
             color #5A77F3
             background-color white
+        .article-button 
+          margin-left 10px
+          position relative
+          &:after
+            content ''
+            display block
+            width 30px
+            height 30px
+            position absolute
+            right 6px
+            top 0px
+            background: url('/images/home/new.svg') no-repeat center
+            background-size: contain
+          &:before
+            content ''
+            display block
+            width 24px
+            height 9px
+            position absolute
+            right 9px
+            top 10px
+            background-color #ffffff
       .image
         position relative
         flex-basis 50%
diff --git a/docs/.vuepress/theme/layouts/Article.vue 
b/docs/.vuepress/theme/layouts/Article.vue
new file mode 100644
index 0000000..9e9e4c2
--- /dev/null
+++ b/docs/.vuepress/theme/layouts/Article.vue
@@ -0,0 +1,63 @@
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<template>
+  <div class="article-wrap">
+    <Navbar />
+    <div class="content-wrapper">
+      <div class="article-header">
+        <h1>{{frontmatter.title}}</h1>
+        <div class="article-sub-header">
+          <span 
class="article-date">{{$themeLocaleConfig.article.metaTime}}:{{frontmatter.date}}</span>
+        </div>
+      </div>
+      <Content></Content>
+      <footer class="article-footer">
+        <CustomFooter />
+      </footer>
+    </div>
+  </div>
+</template>
+<script>
+import CustomFooter from "@theme/components/Footer.vue";
+import Navbar from "@parent-theme/components/Navbar.vue";
+export default {
+  name: 'Article',
+  components: {
+    CustomFooter,
+    Navbar
+  },
+  computed: {
+    frontmatter () {
+      return this.$page.frontmatter
+    }
+  }
+};
+</script>
+<style lang="stylus">
+  .content-wrapper
+    padding: 60px 15px 80px
+    min-height: calc(100vh - 140px)
+    max-width: 740px
+    margin: 0 auto
+    .article-sub-header
+      .article-date
+        font-size: 13px
+        color: #888888
+</style>
\ No newline at end of file
diff --git a/docs/.vuepress/theme/layouts/ArticleList.vue 
b/docs/.vuepress/theme/layouts/ArticleList.vue
new file mode 100644
index 0000000..28a45ad
--- /dev/null
+++ b/docs/.vuepress/theme/layouts/ArticleList.vue
@@ -0,0 +1,138 @@
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<template>
+  <div class="article-wrap">
+    <Navbar/>
+    <div class="content-wrapper">
+      <div class="article-list">
+        <article class="article-item" v-for="item in currentArticleList" 
:key="item.key">
+          <header class="article-item-title">
+            <router-link :to="item.path" 
class="nav-link">{{item.frontmatter.title}}</router-link>
+          </header>
+          <p class="article-item-summary">{{item.frontmatter.description}}</p>
+          <footer>
+            <div class="article-item-meta article-item-time">
+              
{{$themeLocaleConfig.article.metaTime}}:<span>{{item.frontmatter.date}}</span>
+            </div>
+          </footer>
+        </article>
+        <div class="article-pagination-wrap">
+          <span class="article-pagination-button pre" v-show="pageNumber > 1" 
@click="prePage">{{$themeLocaleConfig.article.paginationPre}}</span>
+          <span class="article-pagination-button next" 
v-show="hasNextPaginationButton" 
@click="nextPage">{{$themeLocaleConfig.article.paginationNext}}</span>
+        </div>
+      </div>
+      <footer class="article-footer">
+        <CustomFooter />
+      </footer>
+    </div>
+  </div>
+</template>
+<script>
+import CustomFooter from "@theme/components/Footer.vue";
+import Navbar from "@parent-theme/components/Navbar.vue";
+export default {
+  name: 'ArticleList',
+  components: {
+    CustomFooter,
+    Navbar
+  },
+  data () {
+    return {
+      pageNumber: 1,
+      pageSize: 8
+    }
+  },
+  computed: {
+    articleList () {
+      return this.$site.pages.filter(item => item.frontmatter.metaTitle === 
'article' && item.frontmatter.language === this.$lang)
+    },
+    currentArticleList () {
+      const start = (this.pageNumber - 1) * this.pageSize
+      const end = start + this.pageSize
+      return this.articleList.slice(start, end)
+    },
+    hasNextPaginationButton () {
+      return (this.pageNumber * this.pageSize) < this.articleList.length
+    }
+  },
+  methods: {
+    nextPage () {
+      this.pageNumber++
+    },
+    prePage () {
+      this.pageNumber--
+    }
+  }
+};
+</script>
+<style lang="stylus">
+  .content-wrapper
+    padding: 100px 15px 80px
+    min-height: calc(100vh - 180px)
+    max-width: 740px
+    margin: 0 auto
+    .article-item 
+      padding-bottom: 20px
+      margin-bottom: 20px
+      border-bottom: 1px solid rgba(0,0,0,.05)
+      .article-item-title 
+        font-size: 26px
+        border-bottom: 0
+        .nav-link
+          cursor: pointer
+          color: #2c3e50
+          transition: all .2s
+          text-decoration: none
+        .nav-link:hover
+          color: #3eaf7c
+      .article-item-summary
+        font-size: 14px
+        color: #888888
+        margin-bottom: 10px
+      .article-item-meta
+        display: inline-flex
+        align-items: center
+        font-size: 12px
+        line-height: 12px
+      .article-item-meta:not(:last-child)
+        margin-bottom: 3px
+        margin-right: 20px
+      .article-item-time
+        color: #888888
+    .article-item:last-child
+      border: none
+    .article-pagination-wrap
+      position: relative
+      overflow: hidden
+      height: 30px
+      margin-bottom: 20px
+      .article-pagination-button
+        position: absolute
+        top: 0
+        font-size: 16px
+        color: #777777
+        cursor: pointer
+      .article-pagination-button.pre
+        left: 0
+      .article-pagination-button.next
+        right: 0
+      .article-pagination-button:hover
+        color: #3eaf7c  
+</style>
\ No newline at end of file
diff --git a/docs/en/README.md b/docs/en/README.md
index 19138c6..40040ee 100644
--- a/docs/en/README.md
+++ b/docs/en/README.md
@@ -90,4 +90,6 @@ cases:
       alt: 有道
 actionText: Quick Start →
 actionLink: /en/installing/compilation
+articleText: Latest News
+articleLink: /en/article/article-list
 ---
diff --git a/docs/en/article/article-list.md b/docs/en/article/article-list.md
new file mode 100644
index 0000000..de2c023
--- /dev/null
+++ b/docs/en/article/article-list.md
@@ -0,0 +1,7 @@
+---
+{
+    "title": "articleList",
+    "language": "en",
+    "layout": "ArticleList"
+}
+---
\ No newline at end of file
diff --git a/docs/en/developer-guide/How-to-Share-blogs.md 
b/docs/en/developer-guide/How-to-Share-blogs.md
new file mode 100644
index 0000000..14165cb
--- /dev/null
+++ b/docs/en/developer-guide/How-to-Share-blogs.md
@@ -0,0 +1,90 @@
+---
+{
+    "title": "How to Share blogs",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# How to share a blog
+
+
+## Write a blog file 
+
+To write a blog file, you must first include Front Matter information in the 
header,It mainly contains the following contents:
+
+| Variable | default | description |
+|--------|----------------------------|----------|
+| title| - | Blog title|
+| description | - | Blog description|
+| date | - | Blog date |
+| metaTitle | article | Mark blog file |
+| language | en/zn-CN | language |
+| layout | Article | Layout of the components |
+| sidebar | false | Hide the sidebar |
+
+The title, description and date fields are filled in by the blog writer, while 
the other fields are fixed values。
+
+File header example:
+```
+---
+{
+    "title": "This is title",
+    "description": "This is description",
+    "date": "2021-11-03",
+    "metaTitle": "article",
+    "language": "zh-CN",
+    "layout": "Article",
+    "sidebar": false
+}
+---
+```
+At the same time add Apache License content after the file header:
+
+```
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+```
+Finally, write the content of the blog body。
+
+## Blog file storage directory
+
+After the blog file is written, put it in the corresponding directory. The 
Chinese language directory is:zh-CN/article/articles/,The directory 
corresponding to the English language is:en/article/articles/。
+
+## View blog
+
+Write a blog and put it in the corresponding directory, you can go to view the 
blog。Click the latest news button on the homepage to enter the blog list page, 
and click the blog title again to view the blog details。
\ No newline at end of file
diff --git a/docs/zh-CN/README.md b/docs/zh-CN/README.md
index 95611e4..cf45c79 100644
--- a/docs/zh-CN/README.md
+++ b/docs/zh-CN/README.md
@@ -90,4 +90,6 @@ cases:
       alt: 有道
 actionText: 快速上手 →
 actionLink: /zh-CN/installing/compilation
+articleText: 最新动态
+articleLink: /zh-CN/article/article-list
 ---
diff --git a/docs/zh-CN/article/article-list.md 
b/docs/zh-CN/article/article-list.md
new file mode 100644
index 0000000..be57282
--- /dev/null
+++ b/docs/zh-CN/article/article-list.md
@@ -0,0 +1,7 @@
+---
+{
+    "title": "文章列表",
+    "language": "zh-CN",
+    "layout": "ArticleList"
+}
+---
\ No newline at end of file
diff --git a/docs/zh-CN/developer-guide/How-to-Share-blogs.md 
b/docs/zh-CN/developer-guide/How-to-Share-blogs.md
new file mode 100644
index 0000000..e482184
--- /dev/null
+++ b/docs/zh-CN/developer-guide/How-to-Share-blogs.md
@@ -0,0 +1,91 @@
+---
+{
+    "title": "如何分享Blog",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# 如何分享Blog
+
+
+## 编写Blog文件
+
+编写一个Blog文件,首先要在头部包含Front Matter信息,主要包含以下内容:
+
+| 变量名 | 默认值 | 含义 |
+|--------|----------------------------|----------|
+| title| - | Blog标题|
+| description | - | Blog描述|
+| date | - | Blog发布时间 |
+| metaTitle | article | 标记Blog文件 |
+| language | en/zn-CN | 语言 |
+| layout | Article | 布局组件 |
+| sidebar | false | 隐藏侧边栏 |
+
+其中title、description和date字段值由Blog编写者填写,其他字段为固定值。
+
+文件头示例:
+```
+---
+{
+    "title": "This is title",
+    "description": "This is description",
+    "date": "2021-11-03",
+    "metaTitle": "article",
+    "language": "zh-CN",
+    "layout": "Article",
+    "sidebar": false
+}
+---
+```
+同时在文件头后面添加Apache License内容:
+
+```
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+```
+最后编写Blog正文内容。
+
+## Blog文件的存放目录
+
+Blog文件编写完成之后,将其放到相应的目录中。中文语言的目录是:zh-CN/article/articles/,
+英文语言对应的目录是:en/article/articles/。
+
+## 查看Blog
+
+编写好Blog并将其放入相应目录,就可以去查看Blog了。点击首页的最新动态按钮进入Blog列表页,再次点击Blog标题即可查看Blog详情。
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to