From 62f5bd4df71260cc0476828827874e1ff017f5cb Mon Sep 17 00:00:00 2001 From: Cayla Hamann Date: Wed, 8 Jul 2020 11:01:43 -0400 Subject: [PATCH] feat: uses gatsby plugin for last updated --- gatsby-config.js | 1 + package-lock.json | 13 +++++++++++++ package.json | 1 + src/components/Footer.js | 11 ++++++++++- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/gatsby-config.js b/gatsby-config.js index f035b6e64..4f2e83c13 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -73,6 +73,7 @@ module.exports = { 'gatsby-plugin-use-dark-mode', 'gatsby-plugin-sitemap', 'gatsby-plugin-meta-redirect', + 'gatsby-plugin-build-date', { resolve: 'gatsby-plugin-newrelic', options: { diff --git a/package-lock.json b/package-lock.json index 748b81c30..f79ae7542 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8019,6 +8019,11 @@ "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", "integrity": "sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==" }, + "date-and-time": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.11.1.tgz", + "integrity": "sha512-+1JkWME+UWRpCfvE1T0Vfbw629Ego0IcfHH0qtP4KhAXs7IJT2qsg1hNePqZhyD8Wby46HlW393lSL5PZSzDsA==" + }, "date-fns": { "version": "2.14.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.14.0.tgz", @@ -12549,6 +12554,14 @@ } } }, + "gatsby-plugin-build-date": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gatsby-plugin-build-date/-/gatsby-plugin-build-date-1.0.0.tgz", + "integrity": "sha512-XlR4w3mQqhRE241Kx4/0lFY78/TnY1IDqgvKzgk17RZUcM13QYk7GyuN5Ifx96NMbMEwUUeal4lDqSigfr2Ydw==", + "requires": { + "date-and-time": "^0.11.1" + } + }, "gatsby-plugin-google-tagmanager": { "version": "2.3.5", "resolved": "https://registry.npmjs.org/gatsby-plugin-google-tagmanager/-/gatsby-plugin-google-tagmanager-2.3.5.tgz", diff --git a/package.json b/package.json index c430e6b3e..c205e284e 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "eslint-plugin-react-hooks": "^4.0.4", "gatsby": "^2.23.3", "gatsby-image": "^2.4.9", + "gatsby-plugin-build-date": "^1.0.0", "gatsby-plugin-google-tagmanager": "^2.3.5", "gatsby-plugin-manifest": "^2.4.11", "gatsby-plugin-mdx": "^1.2.14", diff --git a/src/components/Footer.js b/src/components/Footer.js index 5452fd58c..a1e7d8735 100644 --- a/src/components/Footer.js +++ b/src/components/Footer.js @@ -1,5 +1,5 @@ import React, { useContext } from 'react'; -import { Link } from 'gatsby'; +import { Link, useStaticQuery, graphql } from 'gatsby'; import cx from 'classnames'; import ExternalLink from './ExternalLink'; import { PageContext } from './PageContext'; @@ -15,6 +15,15 @@ const Footer = ({ className }) => { 'src/markdown-pages/components' ); + const data = useStaticQuery(graphql` + query { + currentBuildDate { + currentDate + } + } + `); + console.log(data, 'footer'); + return (