Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"fs": "0.0.1-security",
"fs-extra": "^2.0.0",
"history": "^1.17.0",
"html-entities": "^1.2.1",
"http-proxy-middleware": "^0.17.4",
"http-server": "^0.8.5",
"immutable": "^3.7.6",
Expand Down
10 changes: 10 additions & 0 deletions server.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ import {
get_related_content
} from 'utils/redux_loader';
import redirects_map from './redirects';
// page meta data decoding
const Entities = require('html-entities').XmlEntities;
const entities = new Entities();


import {reducer as formReducer} from 'redux-form'

Expand Down Expand Up @@ -451,6 +455,12 @@ function renderView(store, renderProps, location) {
activePageComponent = (activePageComponent.length > 0) ? activePageComponent[0] : null;
if (activePageComponent) {
meta = extend(meta, activePageComponent.getPageMeta(state));
meta = {
title: entities.encode(meta.title),
description: entities.encode(meta.description),
author: entities.encode(meta.author),
keywoards: entities.encode(meta.keywoards),
}
}

return {
Expand Down
2 changes: 1 addition & 1 deletion shared/Blog/Routes/BlogContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class BlogContainer extends Component {

static getPageMeta() {
return {
title: 'Blogs | Data Skeptic'
title: `Blogs | Data Skeptic`
}
}

Expand Down
36 changes: 18 additions & 18 deletions shared/Blog/Routes/BlogRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class BlogRouter extends React.Component {
console.log(payload)
dispatch({type: "CMS_LOAD_RECENT_BLOGS", payload })
}
//const {title} = BlogRouter.getPageMeta(this.props);
//dispatch(changePageTitle(title));
}

componentWillReceiveProps(nextProps) {
Expand All @@ -63,25 +61,27 @@ class BlogRouter extends React.Component {
}

static getPageMeta(state) {
const isExists = state.blogs.getIn(['blog_focus', 'blog']);
if (!isExists) {
return {
title: 'Data Skeptic',
description: ''
}
}
var ocms = state.cms.toJS()
var blogs = ocms['recent_blogs']

let meta = {}

const post = state.blogs.getIn(['blog_focus', 'blog']).toJS();
const isEpisode = !isUndefined(post.guid);
if (blogs.length === 0) {
return {
title: 'Blog Not Found'
}
}

let meta = {
//title: `${post.title} | Data Skeptic`,
title: `Data Skeptic`,
description: post.desc
};
if (blogs.length === 1) {
const post = blogs[0]
const isEpisode = !isUndefined(post.guid)

if (isEpisode) {
meta.image = post.preview;
meta.title = `Data Skeptic`
meta.description = post.desc

if (isEpisode) {
meta.image = post.preview;
}
}

return meta;
Expand Down
2 changes: 1 addition & 1 deletion shared/Checkout/Routes/Checkout/Checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Checkout extends Component {

static getPageMeta() {
return {
title: 'Checkout | Data Skeptic'
title: `Checkout | Data Skeptic`
}
}

Expand Down
4 changes: 2 additions & 2 deletions shared/Contacts/Routes/ContactUs.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class ContactUs extends React.Component {

static getPageMeta() {
return {
title: 'Contact Us | Data Skeptic',
description: 'We hope to respond to all inquiries, but sometimes the volume of incoming questions can cause our queue to explode. We prioritize responses to Data Skeptic members first, and to those who ask questions in a public forum like Twitter, our Facebook wall (not Facebook direct message), or Slack. Many people can benefit from responses in public places.'
title: `Contact Us | Data Skeptic`,
description: `We hope to respond to all inquiries, but sometimes the volume of incoming questions can cause our queue to explode. We prioritize responses to Data Skeptic members first, and to those who ask questions in a public forum like Twitter, our Facebook wall (not Facebook direct message), or Slack. Many people can benefit from responses in public places.`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/Podcasts/Routes/Podcast.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Podcast extends Component {

static getPageMeta() {
return {
title: 'Podcasts | Data Skeptic'
title: `Podcasts | Data Skeptic`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/Proposals/Routes/Proposals.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Proposals extends Component {

static getPageMeta() {
return {
title: 'Request for Comment | Data Skeptic'
title: `Request for Comment | Data Skeptic`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/Proposals/Routes/ThankYou/ThankYouPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ProposalsThankYouPage extends Component {

static getPageMeta() {
return {
title: 'Thank you | Data Skeptic'
title: `Thank you | Data Skeptic`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/components/Advertising.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Advertising extends Component {

static getPageMeta() {
return {
title: 'Advertising | Data Skeptic'
title: `Advertising | Data Skeptic`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/components/Analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AnalyticsPage extends Component {

static getPageMeta() {
return {
title: 'Analytics | Data Skeptic'
title: `Analytics | Data Skeptic`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/components/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Home extends Component {

static getPageMeta() {
return {
title: 'Data Skeptic'
title: `Data Skeptic`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/components/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Login extends Component {

static getPageMeta() {
return {
title: 'Login | Data Skeptic'
title: `Login | Data Skeptic`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/components/Logout.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Logout extends Component {

static getPageMeta() {
return {
title: 'Logout | Data Skeptic'
title: `Logout | Data Skeptic`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/components/Membership.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Membership extends Component {

static getPageMeta() {
return {
title: 'Membership | Data Skeptic'
title: `Membership | Data Skeptic`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/components/MembershipPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MembershipPortal extends Component {

static getPageMeta() {
return {
title: 'Membership Portal | Data Skeptic'
title: `Membership Portal | Data Skeptic`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/components/Press.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Coaching extends Component {

static getPageMeta() {
return {
title: 'Coaching | Data Skeptic'
title: `Coaching | Data Skeptic`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/components/Projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Projects extends Component {

static getPageMeta() {
return {
title: 'Projects | Data Skeptic'
title: `Projects | Data Skeptic`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/components/Services.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Services extends React.Component {

static getPageMeta() {
return {
title: 'Services | Data Skeptic'
title: `Services | Data Skeptic`
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/components/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Store extends React.Component {

static getPageMeta() {
return {
title: 'Store | Data Skeptic'
title: `Store | Data Skeptic`
}
}

Expand Down
5 changes: 3 additions & 2 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
<title><%- meta.title %></title>
<meta name="apple-itunes-app" content="app-id=<%- itunesId %>" />
<meta name="author" content="<%- meta.author %>">
<meta name="description" content="<%- meta.description %>">
<meta property="og:title" content="<%- meta.title %>">
<meta property="og:description" content="<%- meta.description %>">
<% if(meta.description){ %><meta name="description" content="<%- meta.description %>"><% } %>
<% if(meta.description){ %><meta property="og:description" content="<%- meta.description %>"><% } %>
<% if(meta.image){ %><meta property="og:image" content="<%- meta.image %>"><% } %>
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.6/cosmo/bootstrap.min.css" type="text/css" rel="stylesheet"/>
<%- env === 'prod' ? '<link href="/main.css" type="text/css" rel="stylesheet"/>' : '' -%>
Expand Down