diff --git a/gatsby-config.js b/gatsby-config.js index de9a687..6048047 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,4 +1,14 @@ +const buildId = [ + process.env.CI_COMMIT_REF_SLUG || 'prerelese', + (process.env.CI_COMMIT_SHA || 'gitsha').slice(0, 7) +].join('-'); +const banner = (process.env.NODE_ENV === 'production') ? false : (process.env.NODE_ENV || 'development'); + module.exports = { + siteMetadata: { + buildId, + banner + }, plugins: [ 'gatsby-plugin-react-helmet', 'gatsby-plugin-postcss', diff --git a/src/components/Header/index.js b/src/components/Header/index.js index 28f1236..4e41169 100644 --- a/src/components/Header/index.js +++ b/src/components/Header/index.js @@ -1,12 +1,22 @@ import React from 'react'; -import { Link } from 'gatsby'; +import { Link, StaticQuery, graphql } from 'gatsby'; import GitlabIcon from 'react-feather/dist/icons/gitlab'; import style from './style.module.css'; -const Header = () => ( -
+const query = graphql` + query HeaderQuery { + site { + siteMetadata { + banner + } + } + } +`; + +const Header = () => ( +

Regexper

@@ -23,6 +33,6 @@ const Header = () => (
-); +) } />; export default Header; diff --git a/src/components/Header/style.module.css b/src/components/Header/style.module.css index aa4f0ac..a0973ac 100644 --- a/src/components/Header/style.module.css +++ b/src/components/Header/style.module.css @@ -10,6 +10,22 @@ position: relative; color: var(--color-black); + &:after { + content: attr(data-banner); + pointer-events: none; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: var(--header-height); + line-height: var(--header-height); + text-transform: uppercase; + text-align: center; + font-size: calc(var(--header-height) * 0.7); + font-weight: bold; + opacity: 0.2; + } + & h1 { flex-grow: 1; font-family: 'Bangers', 'cursive';