diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 938fe7f..0c3edb4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -39,6 +39,9 @@ jobs: uses: docker/build-push-action@v2 with: context: . + build-args: | + PLAUSIBLE_CUSTOM_DOMAIN=${{ secrets.PLAUSIBLE_CUSTOM_DOMAIN }} + VERSION=${{ steps.get_version.outputs.VERSION }} tags: | ${{ secrets.REGISTRY_NAME }}/dwysokinski.me:latest ${{ secrets.REGISTRY_NAME }}/dwysokinski.me:${{ steps.get_version.outputs.VERSION }} diff --git a/Dockerfile b/Dockerfile index e31b42c..8ce5de6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ FROM node:14.18.1-alpine as build-deps -ENV NODE_ENV=production +ARG PLAUSIBLE_CUSTOM_DOMAIN="" + +ENV PLAUSIBLE_CUSTOM_DOMAIN=$PLAUSIBLE_CUSTOM_DOMAIN \ + NODE_ENV=production RUN apk --no-cache add shadow \ gcc \ diff --git a/gatsby-config.js b/gatsby-config.js index fdb39c0..63c73c0 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,4 +1,5 @@ -const siteUrl = 'https://dwysokinski.me'; +const DOMAIN = 'dwysokinski.me'; +const SITE_URL = 'https://' + DOMAIN; module.exports = { siteMetadata: { @@ -6,10 +7,11 @@ module.exports = { description: `Dawid Wysokiński - Full Stack Web Developer | Back End Developer | Front End Developer | Golang Developer | React Developer | JavaScript Developer`, authorTwitter: `@Dawid56143781`, authorFullName: 'Dawid Wysokiński', - siteUrl, + siteUrl: SITE_URL, email: 'contact@dwysokinski.me', github: 'https://github.com/Kichiyaki', facebook: 'https://www.facebook.com/dawidwysokinski00', + domain: DOMAIN, }, plugins: [ `gatsby-plugin-react-helmet`, @@ -25,7 +27,7 @@ module.exports = { { resolve: `gatsby-plugin-manifest`, options: { - name: `dwysokinski.me`, + name: DOMAIN, short_name: `dw`, start_url: `/`, background_color: `#303030`, @@ -53,8 +55,8 @@ module.exports = { { resolve: 'gatsby-plugin-robots-txt', options: { - host: siteUrl, - sitemap: siteUrl + '/sitemap.xml', + host: SITE_URL, + sitemap: SITE_URL + '/sitemap.xml', env: { development: { policy: [{ userAgent: '*', disallow: ['/'] }], @@ -65,5 +67,12 @@ module.exports = { }, }, }, + { + resolve: `@kichiyaki/gatsby-plugin-plausible`, + options: { + domain: DOMAIN, + customDomain: process.env.PLAUSIBLE_CUSTOM_DOMAIN, + }, + }, ], }; diff --git a/gatsby-node.js b/gatsby-node.js deleted file mode 100644 index 2f42665..0000000 --- a/gatsby-node.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Implement Gatsby's Node APIs in this file. - * - * See: https://www.gatsbyjs.org/docs/node-apis/ - */ - -// You can delete this file if you're not using it diff --git a/gatsby-ssr.js b/gatsby-ssr.js index b17b8fc..e69de29 100644 --- a/gatsby-ssr.js +++ b/gatsby-ssr.js @@ -1,7 +0,0 @@ -/** - * Implement Gatsby's SSR (Server Side Rendering) APIs in this file. - * - * See: https://www.gatsbyjs.org/docs/ssr-apis/ - */ - -// You can delete this file if you're not using it diff --git a/package.json b/package.json index 8c7fcb0..4ca8a5b 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "version": "0.1.0", "author": "Dawid Wysokiński ", "dependencies": { + "@kichiyaki/gatsby-plugin-plausible": "^0.0.8", "@kichiyaki/roboto": "^1.0.0", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", diff --git a/src/components/Seo.js b/src/components/Seo.js index 5bfcbf5..092996f 100644 --- a/src/components/Seo.js +++ b/src/components/Seo.js @@ -103,7 +103,7 @@ function Seo({ description, lang, meta, title, pathname }) { + /> ); } diff --git a/yarn.lock b/yarn.lock index a3a50fd..619bd8a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1646,6 +1646,15 @@ "@babel/runtime" "^7.7.2" regenerator-runtime "^0.13.3" +"@kichiyaki/gatsby-plugin-plausible@^0.0.8": + version "0.0.8" + resolved "https://registry.yarnpkg.com/@kichiyaki/gatsby-plugin-plausible/-/gatsby-plugin-plausible-0.0.8.tgz#94f53c5a8f768b934228e4f43c5493c38885152b" + integrity sha512-DO03Z6NHRiwh8XHJtBJcLxMZ1a8cDjYM0inuGmNI33ea7fV4wdGVF5uHidlbdlls2hLfYPDkjOc0y2Yz3Ff/nw== + dependencies: + "@babel/runtime" "^7.9.2" + minimatch "3.0.4" + react "^17.0.2" + "@kichiyaki/roboto@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@kichiyaki/roboto/-/roboto-1.0.0.tgz#6f5dfb40e2423940588946c952490b123ca8088b" @@ -10269,7 +10278,7 @@ react-transition-group@^4.4.0: loose-envify "^1.4.0" prop-types "^15.6.2" -react@^17.0.1: +react@^17.0.1, react@^17.0.2: version "17.0.2" resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==