From 189f9c1c96055ba40c285ce81276c2b7d90c6530 Mon Sep 17 00:00:00 2001 From: Daniel Soares Date: Mon, 14 Dec 2020 04:33:31 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Data=20import=20(#34)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 🐛 Data imports * fix: 🐛 Bug in the preview of Link-free metadata * chore:👷 Adds more scripts * chore: ✅ Update tests --- content/metadata.json | 20 -------------------- content/metadata.yaml | 16 ++++++++++++++++ gatsby-config.js | 7 ++++++- package.json | 3 ++- 4 files changed, 24 insertions(+), 22 deletions(-) delete mode 100644 content/metadata.json create mode 100644 content/metadata.yaml diff --git a/content/metadata.json b/content/metadata.json deleted file mode 100644 index 94b086c..0000000 --- a/content/metadata.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "title": "Link free", - "shortTitle": "Link free", - "siteUrl": "https://themes.marscollective.co/link-free", - "description": "", - "lang": "en", - "logo": "logo.png", - "favicon": "favicon.png", - "rounded": "16", - "colors": { - "DEFAULT": "#FAFAFA", - "highlight": "#00d1b7", - "accent": "#262626", - "background": "#262626" - }, - "tracking": { - "which": "none", - "id": "" - } -} diff --git a/content/metadata.yaml b/content/metadata.yaml new file mode 100644 index 0000000..8d7033c --- /dev/null +++ b/content/metadata.yaml @@ -0,0 +1,16 @@ +title: Link free +shortTitle: Link free +siteUrl: https://themes.marscollective.co/link-free +description: '' +lang: en +logo: logo.png +favicon: favicon.png +rounded: '16' +colors: + DEFAULT: '#FAFAFA' + highlight: '#00d1b7' + accent: '#262626' + background: '#262626' +tracking: + which: none + id: '' diff --git a/gatsby-config.js b/gatsby-config.js index e00f880..873bdc7 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,4 +1,9 @@ -const metadata = require(`./content/metadata.json`) +const fs = require('fs') +const yaml = require('js-yaml') +const metadata = yaml.safeLoad( + fs.readFileSync('./content/metadata.yaml', 'utf8') +) + module.exports = { plugins: [ { diff --git a/package.json b/package.json index eac779e..d89b012 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "build": "GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES=true gatsby build --log-pages", "dev": "gatsby develop", "serve": "gatsby serve", - "clean": "gatsby clean" + "clean": "gatsby clean", + "deploy": "yarn build && netlify deploy -p" }, "dependencies": { "@marscollective/gatsby-theme-link-free": "^0.1.0",