This repository was archived by the owner on Mar 9, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +41
-9
lines changed Expand file tree Collapse file tree 3 files changed +41
-9
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22import Head from 'next/head' ;
33
4- export default ( { title } ) => (
4+ export default ( { title, description , image } ) => (
55 < Head >
66 < meta charSet = "utf-8" />
77 < meta
@@ -46,15 +46,18 @@ export default ({ title }) => (
4646 href = "https://cdn.rawgit.com/konpa/devicon/df6431e323547add1b4cf45992913f15286456d3/devicon.min.css"
4747 />
4848 < title > { title } </ title >
49- < meta name = "description" content = "coderplex" />
49+ < meta name = "description" content = { description } />
5050 < meta property = "og:type" content = "website" />
5151 < meta property = "og:title" content = { title } />
5252 < meta property = "og:url" content = "https://coderplex.org" />
5353 < meta
5454 property = "og:image"
55- content = "https://coderplex.org/static/favicons/android-chrome-512x512.png"
55+ content = {
56+ image ||
57+ 'https://coderplex.org/static/favicons/android-chrome-512x512.png'
58+ }
5659 />
57- < meta property = "og:site_name" content = "coderplex" />
58- < meta property = "og:description" content = "coderplex" />
60+ < meta property = "og:site_name" content = "coderplex.org " />
61+ < meta property = "og:description" content = { description } />
5962 </ Head >
6063) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import GoStar from 'react-icons/lib/md/library-books';
99import GoCalender from 'react-icons/lib/go/calendar' ;
1010import GoOrg from 'react-icons/lib/go/organization' ;
1111
12+ import MetaInfo from '../config/meta-info' ;
1213import GlobalStyles from './global-styles' ;
1314import Head from './head' ;
1415
@@ -26,9 +27,8 @@ Router.onRouteChangeError = () => {
2627
2728export default props => {
2829 const title =
29- props . url . pathname === '/'
30- ? 'Home'
31- : props . url . pathname . split ( '/' ) [ 1 ] . toUpperCase ( ) ;
30+ props . url . pathname === '/' ? 'home' : props . url . pathname . split ( '/' ) [ 1 ] ;
31+ const metaData = MetaInfo [ title ] ;
3232 const navItems = [
3333 {
3434 title : 'Home' ,
@@ -64,7 +64,11 @@ export default props => {
6464 return (
6565 < Headroom >
6666 < header >
67- < Head title = { `${ title } | Coderplex` } />
67+ < Head
68+ title = { metaData . title }
69+ description = { metaData . description }
70+ image = { metaData . image }
71+ />
6872 < GlobalStyles />
6973 < div className = "header__container" >
7074 < nav >
Original file line number Diff line number Diff line change 1+ {
2+ "home" : {
3+ "title" : " Coderplex | Learn, Collaborate and Create with a Community" ,
4+ "description" :
5+ " We're a non-profit startup on a mission to improve the state of tech across India" ,
6+ "image" : " "
7+ },
8+ "learn" : {
9+ "title" : " Free and Open Source Learning Guides | Coderplex" ,
10+ "description" :
11+ " Curated guides with crowd-sourced recommendations of the best free online resources to learn various modern technologies" ,
12+ "image" : " "
13+ },
14+ "space" : {
15+ "title" : " Offline Co-learning Spaces | Coderplex" ,
16+ "description" :
17+ " A network of off-learning spaces for autodidacts to come and engage in peer-learning and collaboration" ,
18+ "image" : " "
19+ },
20+ "events" : {
21+ "title" : " Online and Offline Tech Events | Coderplex" ,
22+ "description" : " We host frequent online and offline events, from sessions to competitions" ,
23+ "image" : " "
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments