improve nav

This commit is contained in:
Philipp Kühn
2020-04-18 12:48:20 +02:00
parent 5059a58c18
commit b1ca679a25
10 changed files with 59 additions and 79 deletions

View File

@@ -18,8 +18,8 @@ module.exports = {
use: '@gridsome/vue-remark', use: '@gridsome/vue-remark',
options: { options: {
typeName: 'Post', typeName: 'Post',
baseDir: './src/data', baseDir: './src/data/posts',
route: '/posts/:slug', route: '/:slug',
template: './src/templates/Post.vue', template: './src/templates/Post.vue',
plugins: [ plugins: [
'@gridsome/remark-prismjs', '@gridsome/remark-prismjs',

10
docs/src/data/links.yaml Normal file
View File

@@ -0,0 +1,10 @@
- title: Getting Started
items:
- title: Install
link: /install/
- title: Basic Example
link: /basic-example/
- title: Advanced Example
link: /advanced-example/
- title: React
link: /react/

View File

@@ -1,6 +1,6 @@
--- ---
title: Handle Extensions title: Advanced Example
slug: handle-extensions slug: advanced-example
--- ---
Use a custom list of extensions. Use a custom list of extensions.

View File

@@ -1,6 +1,6 @@
--- ---
title: Basic Example title: Basic Example
slug: basic slug: basic-example
--- ---
This is a basic example of tiptap. This is a basic example of tiptap.

View File

@@ -1,5 +1,5 @@
--- ---
title: React Test title: React
slug: react slug: react
--- ---

View File

@@ -1,3 +1,3 @@
.bla { .this-is-a-test {
color: black; color: black;
} }

View File

@@ -10,15 +10,20 @@
<div class="app__content"> <div class="app__content">
<div class="app__inner"> <div class="app__inner">
<div class="app__content-inner"> <div class="app__content-inner">
<aside class="app__sidebar"> <nav class="app__sidebar">
<ul> <div class="app__link-group" v-for="(linkGroup, i) in linkGroups" :key="i">
<li v-for="edge in $static.allPost.edges" :key="edge.node.id"> <div class="app__link-group-title">
<g-link class="app__link" :to="edge.node.path"> {{ linkGroup.title }}
{{ edge.node.title }} </div>
</g-link> <ul>
</li> <li v-for="(item, j) in linkGroup.items" :key="j">
</ul> <g-link class="app__link" :to="item.link">
</aside> {{ item.title }}
</g-link>
</li>
</ul>
</div>
</nav>
<main class="app__main"> <main class="app__main">
<slot/> <slot/>
</main> </main>
@@ -33,19 +38,22 @@ query {
metadata { metadata {
siteName siteName
} }
allPost {
edges {
node {
id
title
path
}
}
}
} }
</static-query> </static-query>
<script>
import linkGroups from '@/data/links.yaml'
export default {
data() {
return {
linkGroups
}
}
}
</script>
<style lang="scss" src="./fonts.scss"></style> <style lang="scss" src="./fonts.scss"></style>
<style lang="scss" src="./base.scss" /> <style lang="scss" src="./base.scss"></style>
<style lang="scss" src="./prism.scss"></style> <style lang="scss" src="./prism.scss"></style>
<style lang="scss" src="./style.scss" scoped /> <style lang="scss" src="./style.scss" scoped></style>

View File

@@ -8,6 +8,19 @@
font-size: 1.4rem; font-size: 1.4rem;
} }
&__link-group {
margin-bottom: 2rem;
}
&__link-group-title {
font-weight: 700;
letter-spacing: 0.05rem;
font-size: 0.75rem;
text-transform: uppercase;
color: rgba($colorBlack, 0.4);
margin-bottom: 0.5rem;
}
&__link { &__link {
display: block; display: block;
padding: 0.1rem 0.5rem; padding: 0.1rem 0.5rem;

View File

@@ -2,8 +2,6 @@
<Layout> <Layout>
<h1>{{ $page.post.title }}</h1> <h1>{{ $page.post.title }}</h1>
<VueRemarkContent /> <VueRemarkContent />
<div ref="editor"></div>
</Layout> </Layout>
</template> </template>
@@ -14,52 +12,3 @@ query Post ($id: ID!) {
} }
} }
</page-query> </page-query>
<script>
import Editor from '@tiptap/core'
export default {
mounted() {
// console.log(tiptap())
// new Editor({
// element: this.$refs.editor,
// content: '<p>test <strong>strong</strong></p>',
// })
// .setContent('<p>hey</p>')
// .registerCommand('lol', (next) => {
// console.log('lol')
// next()
// })
// .focus('end')
// .insertText('mega ')
// .focus('start')
// .command('insertText', 'giga ')
// .lol()
// .registerCommand('insertHTML', (next, editor, html) => {
// console.log(html)
// next()
// })
// .registerCommand('insertHello', async (next, editor) => {
// await editor.insertHTML('<strong>HELLO</strong>')
// next()
// })
// .registerCommand('insertHello', (next, editor) => {
// editor
// .focus('start')
// .insertHTML('<strong>HELLO</strong>')
// next()
// })
// .focus('start')
// .insertHello()
// .insertText('eins')
// .insertText('zwei')
// .insertText('drei')
// .insertHello()
// .focus('end')
// .insertHTML('<p>end</p>')
}
}
</script>