You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2019/10/26 02:17:26 UTC
[incubator-iotdb-website] branch master updated: Refactor website
Nav-bar structure
This is an automated email from the ASF dual-hosted git repository.
hxd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb-website.git
The following commit(s) were added to refs/heads/master by this push:
new 9adf1de Refactor website Nav-bar structure
9adf1de is described below
commit 9adf1de9a157d8fd207adc201625c59704621200
Author: samperson1997 <sz...@mails.tsinghua.edu.cn>
AuthorDate: Sat Oct 26 09:57:27 2019 +0800
Refactor website Nav-bar structure
---
src/components/NavBar.vue | 36 +-------------
src/router/index.js | 18 -------
src/views/Documents.vue | 6 ++-
src/views/Example.vue | 97 --------------------------------------
src/views/Materials.vue | 56 ----------------------
src/views/SingleMaterial.vue | 109 -------------------------------------------
6 files changed, 7 insertions(+), 315 deletions(-)
diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue
index d4204bf..8165fa1 100644
--- a/src/components/NavBar.vue
+++ b/src/components/NavBar.vue
@@ -27,25 +27,8 @@
<li class="nav-item">
<router-link to="/Download" class="nav-link"><span>Download</span></router-link>
</li>
- <li class="dropdown">
- <router-link to="/Documents/Quick%20Start" class="dropdown-toggle" data-toggle="dropdown" role="button"
- aria-haspopup="true" aria-expanded="false"><span>Documents<b class="caret"></b></span>
- </router-link>
- <ul class="dropdown-menu">
- <li v-for="item in Documents">
- <router-link :to=item.url class="nav-link"><span>{{item.content}}</span></router-link>
- </li>
- </ul>
- </li>
- <li class="dropdown">
- <router-link to="/Tools" class="dropdown-toggle" data-toggle="dropdown" role="button"
- aria-haspopup="true" aria-expanded="false"><span>Tools<b class="caret"></b></span>
- </router-link>
- <ul class="dropdown-menu">
- <li v-for="item in Tools">
- <router-link :to=item.url class="nav-link"><span>{{item.content}}</span></router-link>
- </li>
- </ul>
+ <li class="nav-item">
+ <router-link to="/Documents/0.8.0/chap1/sec1" class="nav-link"><span>Documents</span></router-link>
</li>
<li class="dropdown">
<router-link to="/Community/Project%20Committers" class="dropdown-toggle" data-toggle="dropdown" role="button"
@@ -67,9 +50,6 @@
</li>
</ul>
</li>
- <li class="nav-item">
- <router-link to="/Example" class="nav-link"><span>Example</span></router-link>
- </li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="nav-item">
@@ -110,23 +90,11 @@
name: "NavBar",
data() {
return {
- "Documents": [
- {"url": "/Documents/Quick Start", "content": "Quick Start"},
- {"url": "/Documents/0.8.0/chap1/sec1", "content": "User Guide"},
- {"url": "/Materials", "content": "Other Materials"},
- {"url": "/Documents/Frequently asked questions", "content": "Frequently asked questions"}
- ],
"Community": [
{"url": "/Community/Powered By", "content": "Powered By"},
{"url": "/Community/Project Committers", "content": "Project Committers"},
{"url": "/Community/History & Vision", "content": "History & Vision"}
],
- "Tools": [
- {"url": "/Tools/Cli", "content": "IoTDB-Cli"},
- {"url": "/Tools/Grafana", "content": "Grafana Connector"},
- {"url": "/Tools/Hadoop", "content": "Hadoop Connector"},
- {"url": "/Tools/Spark", "content": "Spark Connector"}
- ],
"Development": [
{"url": "/Development/Contributing", "content": "Questions and Contributing"},
{"url": "/Development/IDE", "content": "Developing in IDE"},
diff --git a/src/router/index.js b/src/router/index.js
index f4497f2..3f7dc93 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -6,12 +6,9 @@ import Documents from '@/views/Documents'
import Tools from '@/views/Tools'
import Community from '@/views/Community'
import Development from '@/views/Development'
-import Example from '@/views/Example'
import NotFound from "../views/NotFound"
import SingleTool from "../views/SingleTool"
import LatestDoc from "../views/LatestDoc"
-import Materials from "../views/Materials"
-import SingleMaterials from "../views/SingleMaterial"
Vue.use(Router);
@@ -38,16 +35,6 @@ export default new Router({
component: Documents
},
{
- path: '/Materials',
- name: 'Materials',
- component: Materials
- },
- {
- path: '/Materials/:doc',
- name: 'SingleMaterial',
- component: SingleMaterials
- },
- {
path: '/Tools',
name: 'Tools',
component: Tools
@@ -68,11 +55,6 @@ export default new Router({
component: Development
},
{
- path: '/Example',
- name: 'Example',
- component: Example
- },
- {
path: "/404",
name: "NotFound",
component: NotFound
diff --git a/src/views/Documents.vue b/src/views/Documents.vue
index 0d9680b..0eea8b9 100644
--- a/src/views/Documents.vue
+++ b/src/views/Documents.vue
@@ -147,7 +147,11 @@
const docLanguageUrl = this.eng ? Global.DOC_ENG_PREFIX : Global.DOC_CHN_PREFIX;
let version = this.getVersion();
if (version in Global.SUPPORT_VERSION) {
- let chapter = Number(this.getChapter().substr(4)) - 1;
+ let chapter = Number(this.getChapter().substr(4));
+ // this is for special case of branch v0.8.0
+ if (version === "0.8.0") {
+ chapter -= 1
+ }
let section = Number(this.getSection().substr(3));
let url = Global.SUPPORT_VERSION[version]['doc-prefix'] + Global.SUPPORT_VERSION[version]['branch'] +
Global.DOC_ENG_PREFIX + "/UserGuide/" + Global.SUPPORT_VERSION[version]['content'];
diff --git a/src/views/Example.vue b/src/views/Example.vue
deleted file mode 100644
index 103b272..0000000
--- a/src/views/Example.vue
+++ /dev/null
@@ -1,97 +0,0 @@
-<template>
- <div>
- <div class="container">
- <div class="row">
- <div class="col-sm-8">
- <loading v-if="seen"></loading>
- <language-button v-if="seen==false" :eng="eng" @click.native="switchLanguage()" />
- <vue-markdown v-if="seen==false" v-bind:source="md" :toc="true" :toc-anchor-link-symbol="toc" :postrender="parse"></vue-markdown>
- </div>
- <my-sidebar/>
- </div>
- </div>
- <br>
- <br>
- <br>
- <footer-bar/>
- </div>
-</template>
-
-<script>
- import Footer from "../components/FooterFixed"
- import SideBar from '../components/SideBar'
- import markdown from 'vue-markdown'
- import axios from 'axios'
- import Global from '../components/Global'
- import LoadingBar from '../components/Loading'
- import LanguageButton from '../components/LanguageButton'
-
- export default {
- name: "Example",
- components: {
- 'footer-bar': Footer,
- 'my-sidebar': SideBar,
- 'vue-markdown': markdown,
- 'loading': LoadingBar,
- 'language-button': LanguageButton
- },
- data() {
- return {
- msg: 'Welcome to Example Page',
- md: "",
- toc: "",
- seen: true,
- eng: true
- }
- },
- created() {
- this.fetchData();
- },
- methods: {
- switchLanguage() {
- this.eng = this.eng !== true;
- this.fetchData();
- },
- fetchData() {
- const docLanguageUrl = this.eng ? Global.DOC_ENG_PREFIX : Global.DOC_CHN_PREFIX;
- let url = Global.SUPPORT_VERSION[Global.DEFAULT_VERSION]['doc-prefix'] +
- Global.SUPPORT_VERSION[Global.DEFAULT_VERSION]['branch'] + docLanguageUrl +
- "/OtherMaterial-Examples.md";
- const pointer = this;
- this.seen = true;
- axios.get(url)
- .then(function (response) {
- pointer.md = response.data;
- pointer.seen = false;
- })
- },
- parse(html){
- return Global.isReadyForPrerender(html)
- }
- }
- }
-</script>
-
-<style scoped>
- h1, h2 {
- font-weight: normal;
- }
-
- body {
- font-family: Georgia, "Times New Roman", Times, serif;
- color: #555;
- }
-
- .pager > li > a {
- width: 140px;
- padding: 10px 20px;
- text-align: center;
- border-radius: 30px;
- }
-
- .blog-footer p:last-child {
- margin-bottom: 0;
- }
-
-</style>
-
diff --git a/src/views/Materials.vue b/src/views/Materials.vue
deleted file mode 100644
index bb3062e..0000000
--- a/src/views/Materials.vue
+++ /dev/null
@@ -1,56 +0,0 @@
-<template>
- <div>
- <div class="container">
- <div class="row markdown-body">
- <div class="col-sm-8">
-
- <h2>Other Materials</h2>
- <ul>
- <li style="margin: 5px;">
- <a style="font-size: 16px"
- href="https://github.com/apache/incubator-iotdb/blob/master/docs/Documentation/OtherMaterial-Sample%20Data.txt">Sample Data</a>
- </li>
- <li v-for="item in items" style="margin: 5px">
- <router-link :to="item.url" style="font-size: 16px">{{item.content}}</router-link>
- </li>
- </ul>
- </div>
- <my-sidebar/>
- </div>
- </div>
-
- <footer-bar/>
- </div>
-</template>
-
-<script>
- import Footer from "../components/FooterFixed"
- import SideBar from '../components/SideBar'
-
- export default {
- name: "Materials",
- components: {
- 'footer-bar': Footer,
- 'my-sidebar': SideBar
- },
- data() {
- return {
- items: [
- {'content': "Release Notes", 'url': "/Materials/Release Notes", "isDownloadable" : false},
- {'content': "Examples", 'url': "/Example", "isDownloadable" : false},
- {'content': "References", 'url': "/Materials/References","isDownloadable" : false},
- ]
- }
- },
- }
-</script>
-
-<style scoped>
- .main>div {
- margin-top: 10px;
- }
-
- li {
- font-size: 16px;
- }
-</style>
diff --git a/src/views/SingleMaterial.vue b/src/views/SingleMaterial.vue
deleted file mode 100644
index 254b7f1..0000000
--- a/src/views/SingleMaterial.vue
+++ /dev/null
@@ -1,109 +0,0 @@
-<template>
- <div>
- <div class="container">
- <div class="row markdown-body">
- <div class="col-sm-8">
- <loading v-if="seen"></loading>
- <language-button v-if="seen==false" :eng="eng" @click.native="switchLanguage()" />
- <vue-markdown v-if="seen==false" v-bind:source="md" :toc="true" :toc-anchor-link-symbol="toc" :postrender="parse"></vue-markdown>
- </div>
- <my-sidebar/>
- </div>
- </div>
- <footer-bar/>
- </div>
-</template>
-
-<script>
- import Footer from "../components/FooterFixed"
- import SideBar from '../components/SideBar'
- import markdown from 'vue-markdown'
- import axios from 'axios'
- import Global from '../components/Global'
- import LoadingBar from '../components/Loading'
- import LanguageButton from '../components/LanguageButton'
-
- export default {
- name: "SingleMaterial",
- components: {
- 'footer-bar': Footer,
- 'my-sidebar': SideBar,
- 'vue-markdown': markdown,
- 'loading': LoadingBar,
- 'language-button': LanguageButton
- },
- data() {
- return {
- msg: 'Welcome to Community Page',
- md: "",
- toc: "",
- seen: true,
- eng: true
- }
- },
- created() {
- this.fetchData();
- },
- watch: {
- '$route': 'fetchData'
- },
- methods: {
- content: function () {
- return this.$route.params.doc
- },
- switchLanguage() {
- this.eng = this.eng !== true;
- this.fetchData();
- },
- fetchData() {
- const docLanguageUrl = this.eng ? Global.DOC_ENG_PREFIX : Global.DOC_CHN_PREFIX;
- const dict = {
- "Release Notes": Global.SUPPORT_VERSION[Global.DEFAULT_VERSION]['doc-prefix'] +
- Global.SUPPORT_VERSION[Global.DEFAULT_VERSION]['branch'] + "/RELEASE_NOTES.md",
- "References": Global.SUPPORT_VERSION[Global.DEFAULT_VERSION]['doc-prefix'] +
- Global.SUPPORT_VERSION[Global.DEFAULT_VERSION]['branch'] + docLanguageUrl +
- "/OtherMaterial-Reference.md",
- };
- const content = this.content();
- let url = null;
- if (content in dict) {
- url = dict[content];
- } else {
- this.$router.push('/404');
- }
- const pointer = this;
- this.seen = true;
- axios.get(url)
- .then(function (response) {
- pointer.md = response.data;
- pointer.seen = false;
- })
- },
- parse(html){
- return Global.isReadyForPrerender(html)
- }
- }
- }
-</script>
-<style scoped>
- h1, h2 {
- font-weight: normal;
- }
-
- body {
- font-family: Georgia, "Times New Roman", Times, serif;
- color: #555;
- }
-
- .pager > li > a {
- width: 140px;
- padding: 10px 20px;
- text-align: center;
- border-radius: 30px;
- }
-
- .blog-footer p:last-child {
- margin-bottom: 0;
- }
-
-</style>