Show both page.title and default title in OG

This commit is contained in:
lostinlight 2020-09-25 00:10:11 +03:00
parent 60366935fa
commit 50370143fa
4 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
---
layout: "fediverse"
title: "FEDIVERSE"
title: "About Fediverse"
subtitle: "diversity is strength"
banner: "/img/fediverse-bg.jpg"
percent: "50% 50%"

View File

@ -1,7 +1,7 @@
---
layout: "knowledge"
title: "KNOWLEDGE"
title: "Knowledge"
subtitle: "the truth isn't always beauty, but the hunger for it is"
banner: "/img/knowledge-bg.jpg"
percent: "50% 50%"

View File

@ -10,7 +10,7 @@
<% } %>
</title>
<meta name="description" content="<%=config.description%>">
<meta property="og:title" content="<%if (page.title) {%><%=page.title%><%} else {%><%=config.title%><%}%>">
<meta property="og:title" content="<%if (page.title) {%><%=page.title%><%}%> - <%=config.title%>">
<meta property="og:description" content="<%if (page.preview) {%><%=page.preview%><%} else {%><%=config.description%><%}%>">
<meta property="og:type" content="website">
<meta property="og:image" content="<%=config.url %>/<% if (page.path.match(/post/) && page.banner) {%><%=page.path%><%=page.banner%><%} else {%><%=config.ogImage%><%}%>">
@ -18,7 +18,7 @@
<meta property="og:image:height" content="270">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:description" content="<%if (page.preview) {%><%=page.preview%><%} else {%><%=config.description%><%}%>">
<meta name="twitter:title" content="<%if (page.title) {%><%=page.title%><%} else {%><%=config.title%><%}%>">
<meta name="twitter:title" content="<%if (page.title) {%><%=page.title%><%}%> - <%=config.title%>">
<meta name="twitter:image" content="<%=config.url %>/<% if (page.path.match(/post/) && page.banner) {%><%=page.path%><%=page.banner%><%} else {%><%=config.ogImage%><%}%>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="canonical" href="https://fediverse.party">

View File

@ -8,7 +8,7 @@
<% if (post) {%> <%- url_for(post + '/' + page.banner) %> <%} else { %> <%- url_for(page.banner) %> <% } %>
<% } else { %> <%= url_for('img/knowledge-bg.jpg') %> <% } %>') <% if (page.percent) { %> <%= page.percent %> <% } else { %> 50% 50% <% } %> no-repeat; background-size: cover;">
<div class="heading">
<h1><%= page.title %></h1>
<h1><%=page.title%></h1>
<h4 class="subheading"><%= page.subtitle || "" %></h4>
<small><%- date %></small>
<% if (page.authors) { %>