initial commit

This commit is contained in:
Philipp Kühn
2019-12-07 21:02:22 +01:00
commit f9c7066302
24 changed files with 13842 additions and 0 deletions

14
src/components/Ad.vue Normal file
View File

@@ -0,0 +1,14 @@
<template>
<div>
This is an ad
</div>
</template>
<style scoped>
div {
background-color: tomato;
border-radius: 5px;
color: white;
padding: 20px;
}
</style>

View File

@@ -0,0 +1,14 @@
<template>
<div>
Time: {{ new Date() }}
</div>
</template>
<style scoped>
div {
background-color: black;
border-radius: 5px;
color: white;
padding: 20px;
}
</style>

View File

@@ -0,0 +1,35 @@
<template>
<div>
<p>
Rendered Preview:
</p>
<component :is="component" v-if="component" />
<p>
Code:
</p>
<pre v-if="content" class="language-markup"><code class="language-markup" v-html="$options.filters.highlight(content, 'markup')"></code></pre>
</div>
</template>
<script>
export default {
props: {
path: {
type: String,
required: true,
},
},
data() {
return {
component: null,
content: null,
}
},
mounted() {
this.content = require(`!!raw-loader!~/components/${this.path}`).default
this.component = require(`~/components/${this.path}`).default
}
}
</script>

BIN
src/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

46
src/layouts/Default.vue Normal file
View File

@@ -0,0 +1,46 @@
<template>
<div class="layout">
<header class="header">
<strong>
<g-link to="/">{{ $static.metadata.siteName }}</g-link>
</strong>
</header>
<slot/>
</div>
</template>
<static-query>
query {
metadata {
siteName
}
}
</static-query>
<style>
body {
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
margin:0;
padding:0;
line-height: 1.5;
}
.layout {
max-width: 760px;
margin: 0 auto;
padding-left: 20px;
padding-right: 20px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
height: 80px;
}
.nav__link {
margin-left: 20px;
}
</style>

5
src/layouts/README.md Normal file
View File

@@ -0,0 +1,5 @@
Layout components are used to wrap pages and templates. Layouts should contain components like headers, footers or sidebars that will be used across the site.
Learn more about Layouts: https://gridsome.org/docs/layouts/
You can delete this file.

18
src/main.js Normal file
View File

@@ -0,0 +1,18 @@
// This is the main.js file. Import global CSS and scripts here.
// The Client API can be used here. Learn more: gridsome.org/docs/client-api
import 'prismjs/themes/prism-okaidia.css'
import DefaultLayout from '~/layouts/Default.vue'
import Prism from 'prismjs'
export default function (Vue, { router, head, isClient }) {
Vue.filter('highlight', (code, lang = 'javascript') => {
return Prism.highlight(code, Prism.languages[lang], lang)
})
Vue.component('Layout', DefaultLayout)
}

25
src/pages/Index.vue Normal file
View File

@@ -0,0 +1,25 @@
<template>
<Layout>
<div v-for="edge in $static.allPost.edges" :key="edge.node.id">
<g-link :to="edge.node.path">
{{ edge.node.title }}
</g-link>
</div>
</Layout>
</template>
<static-query>
query {
allPost {
edges {
node {
id
title
path
}
}
}
}
</static-query>

5
src/pages/README.md Normal file
View File

@@ -0,0 +1,5 @@
Pages are usually used for normal pages or for listing items from a GraphQL collection.
Add .vue files here to create pages. For example **About.vue** will be **site.com/about**.
Learn more about pages: https://gridsome.org/docs/pages/
You can delete this file.

24
src/templates/Post.vue Normal file
View File

@@ -0,0 +1,24 @@
<template>
<Layout>
<h1>{{ $page.post.title }}</h1>
<VueRemarkContent />
</Layout>
</template>
<page-query>
query Post ($id: ID!) {
post(id: $id) {
title
}
}
</page-query>
<script>
import tiptap from '@tiptap/core'
export default {
mounted() {
console.log(tiptap())
}
}
</script>

7
src/templates/README.md Normal file
View File

@@ -0,0 +1,7 @@
Templates for **GraphQL collections** should be added here.
To create a template for a collection called `WordPressPost`
create a file named `WordPressPost.vue` in this folder.
Learn more: https://gridsome.org/docs/templates/
You can delete this file.