Skip to content

Commit

Permalink
Merge branch 'develop' into develop-xmr-tests-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Jul 6, 2018
2 parents 8f26263 + fcdc508 commit 9452637
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions routes/appendLocals.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
const url = require('url');
const helpers = require('../lib/helpers.js');
const config = require('../config');

Expand Down Expand Up @@ -38,8 +39,8 @@ function getThemeQuery(req) {
return query;
}

function generateBodyClass(url) {
let str = url;
function generateBodyClass(pageUrl) {
let str = url.parse(pageUrl).pathname;

if (str === '/') {
str = 'home'; // only for the index page
Expand All @@ -63,7 +64,7 @@ function generateSRI(file) {

function appendLocals(req, res) {
const siteUrl = getCurrentSiteurl(req);
const canonicalUrl = `${config.siteurl}${req.path}`;
const canonicalUrl = config.siteurl + url.parse(`${req.originalUrl}`).pathname;
const theme = getThemeQuery(req);
const pageUrl = req.originalUrl;
const bodyClass = generateBodyClass(pageUrl);
Expand Down
2 changes: 1 addition & 1 deletion views/_partials/head/social.pug
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
meta(property='og:title', content!=title)
meta(property='og:type', content='website')
meta(property='og:description', content!=pageDescription)
meta(property='og:url', content=siteUrl)
meta(property='og:url', content=`${siteUrl}${pageUrl}`)
meta(property='og:image', content=`${siteUrl.replace(/^https:/, 'http:')}${getVersionedPath('/assets/img/og.png')}`)
meta(property='og:image:secure_url', content=`${siteUrl}${getVersionedPath('/assets/img/og.png')}`)
meta(property='og:image:type', content='image/png')
Expand Down
6 changes: 3 additions & 3 deletions views/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ html(lang='en', prefix='og: http://ogp.me/ns#', itemscope, itemtype='http://sche

link(rel='canonical', href=canonicalUrl)

link(rel='dns-prefetch', href='//stackpath.bootstrapcdn.com')
link(rel='dns-prefetch', href='//code.jquery.com')
link(rel='dns-prefetch', href='//fonts.googleapis.com')
link(rel='dns-prefetch', href='https://stackpath.bootstrapcdn.com')
link(rel='dns-prefetch', href='https://code.jquery.com')
link(rel='dns-prefetch', href='https://fonts.googleapis.com')

meta(name='twitter:widgets:csp', content='on')

Expand Down

0 comments on commit 9452637

Please sign in to comment.