tiptap/docs/src/layouts/App/index.vue

139 lines
3.7 KiB
Vue
Raw Normal View History

2020-04-17 23:06:55 +08:00
<template>
<div class="app">
<header class="app__header">
2020-04-23 03:57:26 +08:00
<div class="app__header-inner">
<g-link class="app__logo" to="/">
{{ $static.metadata.siteName }}
</g-link>
2020-04-23 18:22:59 +08:00
<div>
2020-09-24 06:29:05 +08:00
<input class="search" type="search" placeholder="Search">
2020-08-13 18:56:06 +08:00
<a href="https://github.com/sponsors/ueberdosis">
Sponsor
</a>
2020-04-23 18:22:59 +08:00
<github-button
2020-08-11 22:35:13 +08:00
href="https://github.com/ueberdosis/tiptap"
2020-04-23 18:22:59 +08:00
data-show-count="true"
2020-08-11 22:35:13 +08:00
aria-label="Star ueberdosis/tiptap on GitHub"
2020-04-23 18:22:59 +08:00
/>
<button
class="app__menu-icon"
@click="menuIsVisible = true"
v-if="!menuIsVisible"
>
<icon name="menu" />
</button>
<button
class="app__close-icon"
@click="menuIsVisible = false"
v-if="menuIsVisible"
>
<icon name="close" />
</button>
</div>
2020-04-23 03:57:26 +08:00
</div>
2020-04-17 23:06:55 +08:00
</header>
<div class="app__content">
2020-04-23 18:22:59 +08:00
<div class="app__sidebar-wrapper" :class="{ 'is-mobile-visible': menuIsVisible }">
2020-04-23 03:23:24 +08:00
<nav class="app__sidebar">
<div class="app__link-group" v-for="(linkGroup, i) in linkGroups" :key="i">
<div class="app__link-group-title">
{{ linkGroup.title }}
</div>
2020-08-21 03:30:05 +08:00
<ul class="app__link-list">
2020-04-23 03:23:24 +08:00
<li v-for="(item, j) in linkGroup.items" :key="j">
2020-09-26 04:37:37 +08:00
<g-link :class="{ 'app__link': true, 'app__link--draft': item.draft === true, 'app__link--with-children': item.items }" :to="item.link" :exact="item.link === '/'">
2020-04-23 03:23:24 +08:00
{{ item.title }}
</g-link>
2020-08-19 03:39:41 +08:00
2020-08-21 03:30:05 +08:00
<ul v-if="item.items" class="app__link-list">
2020-08-19 03:39:41 +08:00
<li v-for="(item, k) in item.items" :key="k">
2020-09-01 23:06:34 +08:00
<g-link :class="{ 'app__link': true, 'app__link--draft': item.draft === true }" :to="item.link" exact>
2020-08-21 03:30:05 +08:00
{{ item.title }}
2020-08-19 03:39:41 +08:00
</g-link>
</li>
</ul>
2020-04-23 03:23:24 +08:00
</li>
</ul>
2020-04-19 04:35:29 +08:00
</div>
2020-04-23 03:23:24 +08:00
</nav>
</div>
2020-04-19 04:35:29 +08:00
<main class="app__main">
2020-09-24 06:29:05 +08:00
<slot />
2020-08-13 16:12:52 +08:00
<p>
2020-09-24 06:29:05 +08:00
<br>
2020-08-13 16:12:52 +08:00
<a :href="editLink" target="_blank">
2020-08-13 16:13:56 +08:00
<span>Edit this page on GitHub</span>
2020-08-13 16:12:52 +08:00
</a>
</p>
2020-08-28 19:20:49 +08:00
<p>
Made with 🖤 by <a href="https://twitter.com/_ueberdosis">überdosis</a>
</p>
2020-04-19 04:35:29 +08:00
<page-navigation />
</main>
2020-04-17 23:06:55 +08:00
</div>
</div>
</template>
<static-query>
query {
metadata {
siteName
}
2020-04-18 18:48:20 +08:00
}
</static-query>
<script>
2020-04-24 16:03:15 +08:00
import linkGroups from '@/links.yaml'
2020-04-23 18:22:59 +08:00
import Icon from '@/components/Icon'
2020-04-19 01:50:06 +08:00
import PageNavigation from '@/components/PageNavigation'
2020-04-19 17:56:50 +08:00
import GithubButton from 'vue-github-button'
2020-04-18 18:48:20 +08:00
export default {
2020-04-19 01:50:06 +08:00
components: {
2020-04-23 18:22:59 +08:00
Icon,
2020-04-19 01:50:06 +08:00
PageNavigation,
2020-04-19 17:56:50 +08:00
GithubButton,
2020-04-19 01:50:06 +08:00
},
2020-04-18 18:48:20 +08:00
data() {
return {
2020-04-19 01:50:06 +08:00
linkGroups,
2020-04-23 18:22:59 +08:00
menuIsVisible: false,
2020-04-17 23:06:55 +08:00
}
2020-04-19 01:50:06 +08:00
},
2020-08-13 16:12:52 +08:00
computed: {
2020-09-24 06:29:05 +08:00
currentPath() {
2020-08-13 16:12:52 +08:00
return this.$route.matched[0].path
},
2020-09-24 06:29:05 +08:00
editLink() {
const { currentPath } = this
2020-09-21 23:17:28 +08:00
const filePath = currentPath === '' ? '/introduction' : currentPath
2020-08-13 16:12:52 +08:00
2020-09-21 23:17:28 +08:00
return `https://github.com/ueberdosis/tiptap-next/blob/main/docs/src/docPages${filePath}.md`
2020-08-13 16:12:52 +08:00
},
2020-08-13 23:27:34 +08:00
},
methods: {
initSearch() {
2020-09-24 06:29:05 +08:00
// eslint-disable-next-line
2020-08-13 23:27:34 +08:00
docsearch({
apiKey: '1abe7fb0f0dac150d0e963d2eda930fe',
indexName: 'ueberdosis_tiptap',
inputSelector: '.search',
debug: false,
})
2020-09-24 06:29:05 +08:00
},
2020-08-13 23:27:34 +08:00
},
mounted() {
this.initSearch()
},
2020-04-17 23:06:55 +08:00
}
2020-04-18 18:48:20 +08:00
</script>
2020-04-17 23:06:55 +08:00
2020-04-18 05:18:18 +08:00
<style lang="scss" src="./fonts.scss"></style>
2020-04-18 18:48:20 +08:00
<style lang="scss" src="./base.scss"></style>
2020-04-18 05:35:07 +08:00
<style lang="scss" src="./prism.scss"></style>
2020-09-24 06:29:05 +08:00
<style lang="scss" src="./style.scss" scoped></style>