diff --git a/readme.md b/readme.md index 021df32..178f943 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,5 @@ # MessageBroker + ![Lifecycle Active](https://badgen.net/badge/Lifecycle/Active/green) ![NPM](https://img.shields.io/npm/l/@morgan-stanley/message-broker) ![npm](https://img.shields.io/npm/v/@morgan-stanley/message-broker) @@ -8,7 +9,7 @@ MessageBroker provides framework agnostic, decoupled communication between publishers and subscribers. This library is fully type safe and works in both browsers and Node.js. MessageBroker is built ontop of [RxJS](https://rxjs.dev/guide/overview) providing access to observables and a comprehensive list of operators. -Full documentation can be found at http://opensource.morganstanley.com/message-broker/ +Full documentation can be found at https://morganstanley.github.io/message-broker/ ## Basic Usage diff --git a/site/gatsby-config.js b/site/gatsby-config.js index d988995..85552d5 100644 --- a/site/gatsby-config.js +++ b/site/gatsby-config.js @@ -2,12 +2,12 @@ const { plugins } = require('./src/config/base-gatsby-plugins'); module.exports = { siteMetadata: { - title: `Project GitHub Pages Template`, - description: `Morgan Stanley Open Source Software`, - siteUrl: 'http://opensource.morganstanley.com', + title: `Message Broker`, + description: `a Typescript library which aims to provide asynchronous communication between typescript components`, + siteUrl: 'https://morganstanley.github.io', documentationUrl: false, // documentationUrl: url-of.documentation.site, }, - pathPrefix: `/`, // put GitHub project url slug here e.g. github.com/morganstanley/ + pathPrefix: `/message-broker`, // put GitHub project url slug here e.g. github.com/morganstanley/ plugins, }; diff --git a/site/package-lock.json b/site/package-lock.json index 8aaec8b..ccf7409 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -11857,16 +11857,16 @@ } }, "node_modules/express": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", - "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -11944,10 +11944,9 @@ } }, "node_modules/express/node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", - "license": "MIT", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", "engines": { "node": ">= 0.6" } diff --git a/site/src/components/header.js b/site/src/components/header.js index 4809e6c..86a9ad8 100644 --- a/site/src/components/header.js +++ b/site/src/components/header.js @@ -19,7 +19,7 @@ const Header = ({ location, links }) => { return (

- + + {title} | Morgan Stanley + {children} + + ); +} + +export default PageHead; diff --git a/site/src/components/seo.js b/site/src/components/seo.js deleted file mode 100644 index aaefff1..0000000 --- a/site/src/components/seo.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Seo component that queries for data with - * Gatsby's useStaticQuery React hook - * - * See: https://www.gatsbyjs.org/docs/use-static-query/ - */ - -import React from 'react'; -import PropTypes from 'prop-types'; -import Helmet from 'react-helmet'; -import { useStaticQuery, graphql } from 'gatsby'; - -const Seo = ({ description, lang, meta, title }) => { - const { site } = useStaticQuery( - graphql` - query { - site { - siteMetadata { - title - description - } - } - } - ` - ); - - const metaDescription = description || site.siteMetadata.description; - - return ( - - ); -}; - -Seo.defaultProps = { - lang: `en`, - meta: [], - description: ``, -}; - -Seo.propTypes = { - description: PropTypes.string, - lang: PropTypes.string, - meta: PropTypes.arrayOf(PropTypes.object), - title: PropTypes.string.isRequired, -}; - -export default Seo; diff --git a/site/src/pages/404.js b/site/src/pages/404.js index f65073c..8bb6d37 100644 --- a/site/src/pages/404.js +++ b/site/src/pages/404.js @@ -3,6 +3,7 @@ import { graphql } from 'gatsby'; import Hero from '../components/hero'; import Layout from '../components/layout'; +import PageHead from '../components/page-head'; const NotFoundPage = ({ data, location }) => { return ( @@ -18,7 +19,10 @@ const NotFoundPage = ({ data, location }) => { export default NotFoundPage; -export const Head = () => 404: Not Found; +export const Head = ({ data }) => { + const title = `404: Not Found | ${data.site.siteMetadata.title}`; + return ; +}; export const pageQuery = graphql` query { diff --git a/site/src/pages/documentation/index.js b/site/src/pages/documentation/index.js index 827bead..5e85edb 100644 --- a/site/src/pages/documentation/index.js +++ b/site/src/pages/documentation/index.js @@ -1,13 +1,14 @@ import React, { useCallback, useState } from 'react'; import { Link, graphql } from 'gatsby'; import Box from '@mui/material/Box'; +import Toolbar from '@mui/material/Toolbar'; +import PageHead from '../../components/page-head'; import Layout from '../../components/layout'; import VersionSelect from '../../components/version-select'; import { getDocsVersion } from '../../utils/version-docs'; import HeroContent from '../../../content/hero.mdx'; -import { Toolbar } from '@mui/material'; const DocumentationIndex = ({ data, location }) => { const allDocs = data.allMdx.nodes; @@ -66,7 +67,10 @@ const DocumentationIndex = ({ data, location }) => { export default DocumentationIndex; -export const Head = () => Documentation; +export const Head = ({ data }) => { + const title = `Documentation | ${data.site.siteMetadata.title}`; + return ; +}; export const pageQuery = graphql` query { diff --git a/site/src/pages/index.js b/site/src/pages/index.js index 2fa6728..7fe701a 100644 --- a/site/src/pages/index.js +++ b/site/src/pages/index.js @@ -8,6 +8,7 @@ import HeroContent from '../../content/hero.mdx'; import UseCases from '../../content/use-cases.mdx'; import Article from '../components/article'; +import PageHead from '../components/page-head'; import Layout from '../components/layout'; const SiteIndex = ({ data, location }) => { @@ -34,6 +35,10 @@ const SiteIndex = ({ data, location }) => { ); }; +export const Head = ({ data }) => ( + +); + export default SiteIndex; export const pageQuery = graphql` diff --git a/site/src/pages/news/index.js b/site/src/pages/news/index.js index 888966a..a4a9269 100644 --- a/site/src/pages/news/index.js +++ b/site/src/pages/news/index.js @@ -2,6 +2,7 @@ import React from 'react'; import { Link, graphql } from 'gatsby'; import Layout from '../../components/layout'; +import PageHead from '../../components/page-head'; import HeroContent from '../../../content/hero.mdx'; @@ -32,7 +33,9 @@ const NewsIndex = ({ data, location }) => { export default NewsIndex; -export const Head = () => News; +export const Head = ({ data }) => ( + +); export const pageQuery = graphql` query { diff --git a/site/src/templates/documentation.js b/site/src/templates/documentation.js index 381c9ef..ac1ceb7 100644 --- a/site/src/templates/documentation.js +++ b/site/src/templates/documentation.js @@ -3,6 +3,7 @@ import { Link, navigate, graphql } from 'gatsby'; import { Box } from '@mui/material'; import Layout from '../components/layout'; +import PageHead from '../components/page-head'; import VersionSelect from '../components/version-select'; import { getCurrentVersion, getDocsVersion } from '../utils/version-docs'; @@ -83,12 +84,14 @@ const DocumentationTemplate = ({ children, data, pageContext, location }) => { export default DocumentationTemplate; -export const Head = ({ pageContext }) => ( - <> - {pageContext.frontmatter.title} - - -); +export const Head = ({ data, pageContext }) => { + const title = `${pageContext.frontmatter.title} | ${data.site.siteMetadata.title}`; + return ( + + + + ); +}; export const pageQuery = graphql` query ($id: String!) { diff --git a/site/src/templates/news.js b/site/src/templates/news.js index 05624b3..ed0af4f 100644 --- a/site/src/templates/news.js +++ b/site/src/templates/news.js @@ -2,6 +2,7 @@ import React from 'react'; import { graphql } from 'gatsby'; import Layout from '../components/layout'; +import PageHead from '../components/page-head'; import Section from '../components/section'; const NewsPostTemplate = ({ children, data, pageContext, location }) => { @@ -24,12 +25,14 @@ const NewsPostTemplate = ({ children, data, pageContext, location }) => { export default NewsPostTemplate; -export const Head = ({ pageContext }) => ( - <> - {pageContext.title} - - -); +export const Head = ({ data, pageContext }) => { + const title = `${pageContext.frontmatter.title} | ${data.site.siteMetadata.title}`; + return ( + + + + ); +}; export const pageQuery = graphql` query ($id: String!) { diff --git a/site/src/templates/page.js b/site/src/templates/page.js index bac4bd7..51a0f49 100644 --- a/site/src/templates/page.js +++ b/site/src/templates/page.js @@ -2,6 +2,7 @@ import React from 'react'; import { graphql } from 'gatsby'; import Layout from '../components/layout'; +import PageHead from '../components/page-head'; const PageTemplate = ({ title, data, location, children }) => { return ( @@ -18,12 +19,14 @@ const PageTemplate = ({ title, data, location, children }) => { export default PageTemplate; -export const Head = ({ pageContext }) => ( - <> - {pageContext.title} - - -); +export const Head = ({ data, pageContext }) => { + const title = `${pageContext.frontmatter.title} | ${data.site.siteMetadata.title}`; + return ( + + + + ); +}; export const pageQuery = graphql` query ($id: String!) {