From 186ebe2caaba2f6d7af82fd090b164cfcd5e2414 Mon Sep 17 00:00:00 2001 From: Kevin Kandlbinder Date: Tue, 22 Dec 2020 17:09:22 +0100 Subject: [PATCH] Delegate site-config to config.js --- config.js | 8 ++++++++ gatsby-config.js | 19 +++++++++++-------- src/components/seo.js | 3 ++- 3 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 config.js diff --git a/config.js b/config.js new file mode 100644 index 0000000..e97bfbf --- /dev/null +++ b/config.js @@ -0,0 +1,8 @@ +module.exports = { + "siteName": "KevinK.dev", + "siteAuthor": "@Unkn0wnKevin", + "siteURL": "https://kevink.dev", + "siteKeywords": "Kevin Kandlbinder, Kevin, Kandlbinder, Web, Web Developer, Developer, JavaScript, PHP, Java, Photos, Fotos", + "iconPath": "src/images/fullbglogo@10x.png", + "languages": ["en", "de"] +}; \ No newline at end of file diff --git a/gatsby-config.js b/gatsby-config.js index 3998ae9..bea375d 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,8 +1,11 @@ +const extConfig = require("./config") + module.exports = { siteMetadata: { - title: `KevinK.dev`, - author: `@Unkn0wnKevin`, - siteUrl: `https://kevink.dev`, + title: extConfig.siteName, + author: extConfig.siteAuthor, + siteUrl: extConfig.siteURL, + keywords: extConfig.siteKeywords }, plugins: [ `gatsby-plugin-sharp`, @@ -17,13 +20,13 @@ module.exports = { { resolve: `gatsby-plugin-manifest`, options: { - name: `KevinK.dev`, - short_name: `KevinK.dev`, + name: extConfig.siteName, + short_name: extConfig.siteName, start_url: `/`, background_color: `#000710`, theme_color: `#000710`, display: `minimal-ui`, - icon: `src/images/fullbglogo@10x.png`, // This path is relative to the root of the site. + icon: extConfig.iconPath, // This path is relative to the root of the site. cache_busting_mode: 'none', }, }, @@ -43,7 +46,7 @@ module.exports = { resolve: `gatsby-plugin-react-i18next`, options: { path: `${__dirname}/locales`, - languages: [`en`, `de`], + languages: extConfig.languages, defaultLanguage: null, siteURL: "https://kevink.dev", i18nextOptions: { @@ -57,7 +60,7 @@ module.exports = { { matchPath: '/:lang/projects/:urlname', getLanguageFromPath: true, - excludeLanguages: ['en', 'de'] + excludeLanguages: extConfig.languages } ] } diff --git a/src/components/seo.js b/src/components/seo.js index c3a0a27..af235e7 100644 --- a/src/components/seo.js +++ b/src/components/seo.js @@ -13,6 +13,7 @@ function SEO({ description, meta, title }) { siteMetadata { title author + keywords } } } @@ -60,7 +61,7 @@ function SEO({ description, meta, title }) { }, { name: "keywords", - content: "Kevin Kandlbinder, Kevin, Kandlbinder, Web, Web Developer, Developer, JavaScript, PHP, Java, Photos, Fotos" + content: site.siteMetadata.keywords } ].concat(meta)} >