Add html titles for posts

This commit is contained in:
Shadowfacts 2022-01-20 12:46:17 -05:00
parent d96af5537f
commit 629e3def20
3 changed files with 12 additions and 3 deletions

View File

@ -15,6 +15,7 @@ export interface Metadata {
export interface PostMetadata extends Metadata {
title: string;
htmlTitle?: string;
slug: string;
tags: string[];
tagSlugs: string[];

View File

@ -1,7 +1,11 @@
<article itemscope itemtype="https://schema.org/BlogPosting">
<h2 class="article-title" itemprop="headline">
<a href="<%= post.metadata.permalink %>" itemprop="url mainEntityOfPage">
<% if (post.metadata.htmlTitle) { %>
<%- post.metadata.htmlTitle %>
<% } else { %>
<%= post.metadata.title %>
<% } %>
</a>
</h2>
<%- include("article-meta.html.ejs", { metadata: post.metadata }) %>

View File

@ -5,7 +5,11 @@ metadata.layout = "default.html.ejs"
<article itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<meta itemprop="mainEntityOfPage" content="https://shadowfacts.net<%= metadata.permalink %>">
<h1 class="article-title" itemprop="name headline">
<% if (metadata.htmlTitle) { %>
<%- metadata.htmlTitle %>
<% } else { %>
<%= metadata.title %>
<% } %>
</h1>
<%- include("../includes/article-meta.html.ejs", { metadata }) %>
<div class="article-content" itemprop="articleBody">