init
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
Add components that will be imported to Pages and Layouts to this folder.
|
||||
Learn more about components here: https://gridsome.org/docs/components
|
||||
|
||||
You can delete this file.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<header class="header">
|
||||
<strong>
|
||||
<g-link to="/">{{ $static.metaData.siteName }}</g-link>
|
||||
</strong>
|
||||
<nav class="nav">
|
||||
<g-link class="nav__link" to="/">Home</g-link>
|
||||
<g-link class="nav__link" to="/article">Article</g-link>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<slot/>
|
||||
</main>
|
||||
<footer>
|
||||
<p class="home-links">
|
||||
<a href="https://gridsome.org/docs" target="_blank" rel="noopener">Gridsome Docs</a>
|
||||
<a href="https://github.com/gridsome/gridsome" target="_blank" rel="noopener">GitHub</a>
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<static-query>
|
||||
query {
|
||||
metaData {
|
||||
siteName
|
||||
}
|
||||
}
|
||||
</static-query>
|
||||
|
||||
<style>
|
||||
html,body{
|
||||
height:100%;
|
||||
}
|
||||
body {
|
||||
font-family: "Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
|
||||
margin:0;
|
||||
padding:0;
|
||||
line-height: 1.5;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
justify-content:flex-start;
|
||||
align-items:center;
|
||||
}
|
||||
|
||||
.layout {
|
||||
max-width: 760px;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
height:100%;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
}
|
||||
|
||||
main{
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.nav__link {
|
||||
margin-left: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -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.
|
||||
@@ -0,0 +1,9 @@
|
||||
// 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 DefaultLayout from '~/layouts/Default.vue'
|
||||
|
||||
export default function (Vue, { router, head, isClient }) {
|
||||
// Set default layout as a global component
|
||||
Vue.component('Layout', DefaultLayout)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<Layout>
|
||||
<h1>Hello, world!</h1>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Pariatur excepturi labore tempore expedita, et iste tenetur suscipit explicabo! Dolores, aperiam non officia eos quod asperiores
|
||||
</p>
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
metaInfo: {
|
||||
title: 'Hello, world!'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.home-links a {
|
||||
margin-right: 1rem;
|
||||
}
|
||||
</style>
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
@@ -0,0 +1,11 @@
|
||||
<template>
|
||||
<div v-html="$static.article.title" />
|
||||
</template>
|
||||
|
||||
<static-query>
|
||||
query Post {
|
||||
article(id: "2172000") {
|
||||
title
|
||||
}
|
||||
}
|
||||
</static-query>
|
||||
Reference in New Issue
Block a user