diff --git a/components/helmet/index.js b/components/helmet/index.js new file mode 100644 index 000000000..bfdb2ca45 --- /dev/null +++ b/components/helmet/index.js @@ -0,0 +1,58 @@ +import NextHead from 'next/head'; +import siteConfig from 'data/site'; + +const prepareTitle = (givenTitle) => { + givenTitle = givenTitle || siteConfig.title; + return `${givenTitle} - ${siteConfig.name}`; +}; + +const prepareDescription = (givenDescription) => { + return givenDescription || siteConfig.description; +}; + +const Helmet = (props) => ( + + + + { prepareTitle(props.title) } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +); + +export default Helmet; diff --git a/components/page-header/index.js b/components/page-header/index.js index 2a9684827..485a22659 100644 --- a/components/page-header/index.js +++ b/components/page-header/index.js @@ -19,4 +19,4 @@ const PageHeader = () => ( ); -export default PageHeader; \ No newline at end of file +export default PageHeader; diff --git a/data/site.json b/data/site.json index c178ae8a3..ae9082baf 100644 --- a/data/site.json +++ b/data/site.json @@ -1,6 +1,31 @@ { - "twitter": "roadmapsh", + "author": "Kamran Ahmed", + "title": "Roadmaps to becoming a modern developer", + "name": "roadmap.sh", + "description": "Roadmaps, articles and resources to help you choose your path, learn and improve.", + "twitter": "kamranahmedse", + "facebook": "kamranahmedse", "url": "https://roadmap.sh", + "logo": "/static/brand.png", "repoUrl": "https://github.com/kamranahmedse/roadmap-next", - "dataUrl": "/tree/master/data" + "dataUrl": "/tree/master/data", + "keywords": [ + "roadmap", + "developer roadmaps", + "developer roadmap", + "frontend developer", + "frontend developer roadmap", + "frontend", + "frontend roadmap", + "backend", + "backend developer", + "backend developer roadmap", + "devops", + "devops roadmap", + "fullstack developer roadmap", + "guide to becoming a developer", + "sre roadmap", + "sre", + "operations roadmap" + ] } diff --git a/layouts/default/head.js b/layouts/default/head.js deleted file mode 100644 index 3551dfd24..000000000 --- a/layouts/default/head.js +++ /dev/null @@ -1,19 +0,0 @@ -import NextHead from 'next/head'; - -const defaultDescription = 'Roadmaps, articles and resources for modern developers'; -const defaultOgUrl = 'https://roadmap.sh'; - -const Head = (props) => ( - - - { props.title || '' } - - - - - - - -); - -export default Head; \ No newline at end of file diff --git a/layouts/default/index.js b/layouts/default/index.js index 439b39bac..778951879 100644 --- a/layouts/default/index.js +++ b/layouts/default/index.js @@ -1,11 +1,11 @@ -import Head from './head'; +import Helmet from 'components/helmet'; import './global.scss'; const DefaultLayout = (props) => (
- + { props.children }
); -export default DefaultLayout; \ No newline at end of file +export default DefaultLayout; diff --git a/pages/guides/[guide].js b/pages/guides/[guide].js index 8e5dc688c..330f096d1 100644 --- a/pages/guides/[guide].js +++ b/pages/guides/[guide].js @@ -6,18 +6,20 @@ import GuideBody from 'components/guide-body'; import ShareGuide from 'components/share-guide'; import GuideFooter from 'components/guide-footer'; import { getRequestedGuide } from "lib/guide"; +import Helmet from '../../components/helmet'; const Guide = ({ guide }) => { if (!guide) { - return + return } return ( + - + @@ -26,7 +28,7 @@ const Guide = ({ guide }) => { Guide.getInitialProps = serverOnlyProps(({ req }) => { return { - guide: getRequestedGuide(req) + guide: getRequestedGuide(req), }; }); diff --git a/static/favicon.ico b/static/favicon.ico deleted file mode 100644 index b1bbb39ba..000000000 Binary files a/static/favicon.ico and /dev/null differ diff --git a/static/manifest/apple-touch-icon.png b/static/manifest/apple-touch-icon.png new file mode 100755 index 000000000..736fdfea2 Binary files /dev/null and b/static/manifest/apple-touch-icon.png differ diff --git a/static/manifest/favicon.ico b/static/manifest/favicon.ico new file mode 100755 index 000000000..3dca3a22c Binary files /dev/null and b/static/manifest/favicon.ico differ diff --git a/static/manifest/icon152.png b/static/manifest/icon152.png new file mode 100755 index 000000000..2fa1f417c Binary files /dev/null and b/static/manifest/icon152.png differ diff --git a/static/manifest/icon16.png b/static/manifest/icon16.png new file mode 100755 index 000000000..043b2b275 Binary files /dev/null and b/static/manifest/icon16.png differ diff --git a/static/manifest/icon196.png b/static/manifest/icon196.png new file mode 100755 index 000000000..63dbf37bb Binary files /dev/null and b/static/manifest/icon196.png differ diff --git a/static/manifest/icon32.png b/static/manifest/icon32.png new file mode 100755 index 000000000..90706bc95 Binary files /dev/null and b/static/manifest/icon32.png differ diff --git a/static/manifest/manifest.json b/static/manifest/manifest.json new file mode 100644 index 000000000..30ad83f03 --- /dev/null +++ b/static/manifest/manifest.json @@ -0,0 +1,27 @@ +{ + "dir": "ltr", + "lang": "en", + "name": "Roadmap", + "scope": "/", + "display": "standalone", + "start_url": "https://roadmap.sh/", + "short_name": "Roadmap", + "theme_color": "#EDD07E", + "description": "Roadmaps to becoming a Modern Developer – roadmap.sh", + "orientation": "any", + "background_color": "#101010", + "related_applications": [], + "prefer_related_applications": false, + "icons": [ + { + "src": "/static/manifest/icon152.png", + "sizes": "152x152", + "type": "image/png" + }, + { + "src": "/static/manifest/icon196.png", + "sizes": "196x196", + "type": "image/png" + } + ] +}