Moves site config to content/site.config.json
Torey Heinz
committed Apr 13, 2020
commit d0c517f5cad9cc8dfafd097ee8595ec886177708
Showing 6
changed files with
26 additions
and 60 deletions
content/site.config.json
+20
-0
| @@ | @@ -0,0 +1,20 @@ |
| + | { |
| + | "siteName": "Anchor Rock Foundation", |
| + | "headerNavigation": [ |
| + | { |
| + | "text": "Home", |
| + | "link": "/", |
| + | "external": false |
| + | }, |
| + | { |
| + | "text": "COVID-19", |
| + | "link": "/COVID-19", |
| + | "external": false |
| + | }, |
| + | { |
| + | "text": "Volunteer", |
| + | "link": "/volunteer", |
| + | "external": false |
| + | } |
| + | ] |
| + | } |
gridsome.config.js
+2
-7
| @@ | @@ -4,16 +4,11 @@ |
| // Changes here require a server restart. | |
| // To restart press CTRL + C in terminal and run `gridsome develop` | |
| + | const config = require("../content/site.config.json") |
| module.exports = { | |
| - | siteName: "Anchor Rock Foundation", |
| + | siteName: config.siteName, |
| plugins: [ | |
| "gridsome-plugin-pug", | |
| - | { |
| - | use: "gridsome-source-static-meta", |
| - | options: { |
| - | path: "site.config.json", |
| - | }, |
| - | }, |
| { | |
| use: "@gridsome/vue-remark", | |
| options: { | |
package.json
+1
-2
| @@ | @@ -17,10 +17,9 @@ |
| "@gridsome/vue-remark": "^0.1.10", | |
| "gridsome": "^0.7.0", | |
| "gridsome-plugin-pug": "^0.0.3", | |
| - | "gridsome-source-static-meta": "^1.0.1", |
| "minimist": "^1.2.5", | |
| "node-sass": "^4.13.1", | |
| "pug": "^2.0.4", | |
| "sass-loader": "^8.0.2" | |
| } | |
| - | } |
| \ No newline at end of file | |
| + | } |
site.config.json
+0
-36
| @@ | @@ -1,36 +0,0 @@ |
| - | { |
| - | "headerNavigation": [ |
| - | { |
| - | "text": "Home", |
| - | "link": "/", |
| - | "external": false |
| - | }, |
| - | { |
| - | "text": "COVID-19", |
| - | "link": "/COVID-19", |
| - | "external": false |
| - | } |
| - | ], |
| - | "footerNavigation": [ |
| - | { |
| - | "name": "Latest Posts", |
| - | "link": "/", |
| - | "external": false |
| - | }, |
| - | { |
| - | "name": "Facebook", |
| - | "link": "https://www.facebook.com", |
| - | "external": true |
| - | }, |
| - | { |
| - | "name": "Gridsome", |
| - | "link": "https://www.gridsome.org", |
| - | "external": true |
| - | }, |
| - | { |
| - | "name": "RSS", |
| - | "link": "/rss.xml", |
| - | "external": false |
| - | } |
| - | ] |
| - | } |
src/layouts/Default.vue
+2
-15
| @@ | @@ -4,7 +4,7 @@ |
| div.container | |
| div.navbar-brand | |
| g-link(to="/").navbar-item | |
| - | g-image(src="~/images/logo.png" width="400" :immediate="true" :alt="$static.metadata.siteName") |
| + | g-image(src="~/images/logo.png" width="400" :immediate="true" :alt="$site.siteName") |
| a.navbar-burger(@click="$state.navbarIsActive = !$state.navbarIsActive") | |
| span | |
| @@ | @@ -16,7 +16,7 @@ |
| //- g-link(to="/" active-class="is-active" exact).navbar-item.is-tab Home | |
| div.navbar-end | |
| - | template(v-for="(item, index) in $static.metadata.headerNavigation") |
| + | template(v-for="(item, index) in $site.headerNavigation") |
| a( | |
| v-if="item.external" | |
| :href="item.link" | |
| @@ | @@ -37,16 +37,3 @@ |
| input(type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" | |
| title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button") | |
| </template> | |
| - | |
| - | <static-query> |
| - | query { |
| - | metadata { |
| - | siteName |
| - | headerNavigation : headerNavigation { |
| - | text |
| - | link |
| - | external |
| - | } |
| - | } |
| - | } |
| - | </static-query> |
src/main.js
+1
-0
| @@ | @@ -5,4 +5,5 @@ export default function (Vue, { router, head, isClient }) { |
| Vue.component("Layout", () => import("~/layouts/Default.vue")) | |
| Vue.component("BaseLink", () => import("~/components/BaseLink.vue")) | |
| + | Vue.prototype.$site = require("../content/site.config.json") |
| } | |