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 { export interface PostMetadata extends Metadata {
title: string; title: string;
htmlTitle?: string;
slug: string; slug: string;
tags: string[]; tags: string[];
tagSlugs: string[]; tagSlugs: string[];

View File

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

View File

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