init project
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
*.log
|
||||
.cache
|
||||
.DS_Store
|
||||
src/.temp
|
||||
node_modules
|
||||
dist
|
||||
.env
|
||||
.env.*
|
||||
@@ -0,0 +1,14 @@
|
||||
# Default starter for Gridsome
|
||||
|
||||
This is the project you get when you run `gridsome create new-project`.
|
||||
|
||||
### 1. Install Gridsome CLI tool if you don't have
|
||||
|
||||
`npm install --global @gridsome/cli`
|
||||
|
||||
### 2. Create a Gridsome project
|
||||
|
||||
1. `gridsome create my-gridsome-site` to install default starter
|
||||
2. `cd my-gridsome-site` to open the folder
|
||||
3. `gridsome develop` to start a local dev server at `http://localhost:8080`
|
||||
4. Happy coding 🎉🙌
|
||||
@@ -0,0 +1,10 @@
|
||||
// This is where project configuration and plugin options are located.
|
||||
// Learn more: https://gridsome.org/docs/config
|
||||
|
||||
// Changes here require a server restart.
|
||||
// To restart press CTRL + C in terminal and run `gridsome develop`
|
||||
|
||||
module.exports = {
|
||||
siteName: '',
|
||||
plugins: []
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
const axios = require('axios'),
|
||||
fs = require('fs');
|
||||
let param = JSON.parse(fs.readFileSync('param.JSON', 'utf-8'))
|
||||
|
||||
module.exports = function(api) {
|
||||
api.loadSource(async actions => {
|
||||
for (let d in param.meta) {
|
||||
actions.addMetadata(d, param.meta[d])
|
||||
}
|
||||
if (!param.search) throw "Nothing to search for";
|
||||
// Ajout des recherches
|
||||
let search = param.search.map(s => {
|
||||
return axios.get(`${param.source}${s}`);
|
||||
});
|
||||
await axios.all(search).then(res => {
|
||||
param.search.forEach((p, index) => {
|
||||
let action = actions.addCollection(p),
|
||||
{
|
||||
data
|
||||
} = res[index];
|
||||
for (const item of data) {
|
||||
action.addNode({
|
||||
id: item.id,
|
||||
titre: item.Titre,
|
||||
contenu: item.Contenu
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
}
|
||||
Generated
+10630
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "popsu_rouen_strapi",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "gridsome build",
|
||||
"develop": "gridsome develop",
|
||||
"explore": "gridsome explore"
|
||||
},
|
||||
"dependencies": {
|
||||
"gridsome": "^0.7.0",
|
||||
"gridsome-source-strapi": "^0.1.3"
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"meta": {
|
||||
"title": "",
|
||||
"subtitle": "",
|
||||
"authors": [
|
||||
"Jean Debrie",
|
||||
"Xavier Desjardins"
|
||||
]
|
||||
},
|
||||
"source": "https://popsu-rouen-en.strapi.figli.io/",
|
||||
"search": [
|
||||
"chapitres",
|
||||
"sections"
|
||||
]
|
||||
}
|
||||
@@ -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,24 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<!-- Contient les pages -->
|
||||
<slot/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<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;
|
||||
}
|
||||
|
||||
|
||||
</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,29 @@
|
||||
<template>
|
||||
<Layout>
|
||||
<!-- Mise en page -->
|
||||
<div v-for="edge in $page.chapitres.edges" :key="edge.node.id">
|
||||
{{edge.node.titre}}
|
||||
{{edge.node.contenu}}
|
||||
</div>
|
||||
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<page-query>
|
||||
query {
|
||||
chapitres: allChapitres {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
titre
|
||||
contenu
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</page-query>
|
||||
@@ -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,3 @@
|
||||
Add static files here. Files in this directory will be copied directly to `dist` folder during build. For example, /static/robots.txt will be located at https://yoursite.com/robots.txt.
|
||||
|
||||
This file should be deleted.
|
||||
Reference in New Issue
Block a user