Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(website): Use article in og:type tag in blog articles. #1084

Closed
wants to merge 3 commits into from
Closed
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
10 changes: 9 additions & 1 deletion website/public/blog/blog-head.ejs.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<%#
<!-- Copyright (C) 2020 Matthew "strager" Glazar -->
<!-- See end of file for extended copyright information. -->
%>
%> <% if (typeof meta.blogDate !== 'undefined') { %>
<meta property="og:type" content="article" />
<meta property="article:section" content="Technology" />
<meta property="article:published_time" content="<%= meta.blogDate %>" />
Comment on lines +4 to +7
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We know this is a blog article because the file is called blog-head.ejs.html. Shouldn't we only put the if around article:published_time?

Suggested change
%> <% if (typeof meta.blogDate !== 'undefined') { %>
<meta property="og:type" content="article" />
<meta property="article:section" content="Technology" />
<meta property="article:published_time" content="<%= meta.blogDate %>" />
%>
<meta property="og:type" content="article" />
<meta property="article:section" content="Technology" />
<% if (typeof meta.blogDate !== 'undefined') { %>
<meta property="article:published_time" content="<%= meta.blogDate %>" />

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is also included in /blog.

<% } %> <% if (typeof meta.blogModifiedDate !== 'undefined') { %>
<meta property="article:modified_time" content="<%= meta.blogModifiedDate %>" />
<% } %> <% if (typeof meta.blogAuthor !== 'undefined') { %>
<meta property="article:author" content="<%= meta.blogAuthor %>" />
<% } %>

<link
rel="alternate"
Expand Down
3 changes: 2 additions & 1 deletion website/public/blog/bug-journey/index.ejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"linkLabelHTML": "Sometimes it <em>is</em> a compiler bug",
"description": "My journey in finding and fixing a bug in a C++ toolchain",
"navTitle": "Compiler bug",
"blogAuthor": "Matthew \"strager\" Glazar",
"blogDate": "2022-05-25T21:04:02-07:00"
}--->

Expand Down Expand Up @@ -652,7 +653,7 @@ <h2>Fixing the bug</h2>
../../../bfd/../mkinstalldirs /ucrt64/share; \
else \
../../../bfd/mkinstalldirs /ucrt64/share; \
fi
fi
installing da.gmo as <mark>/ucrt64/share/locale/da/LC_MESSAGES/bfd.mo</mark>
installing es.gmo as <mark>/ucrt64/share/locale/es/LC_MESSAGES/bfd.mo</mark>
installing fi.gmo as <mark>/ucrt64/share/locale/fi/LC_MESSAGES/bfd.mo</mark>
Expand Down
4 changes: 3 additions & 1 deletion website/public/blog/cpp-vs-rust-build-times/index.ejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"description": "A practical comparison of build and test speed between C++ and Rust.",
"navTitle": "C++ vs Rust",
"image": "/blog/cpp-vs-rust-build-times/cpp-vs-rust.jpg",
"blogDate": "2023-01-05T21:32:37-08:00"
"blogAuthor": "Matthew \"strager\" Glazar",
"blogDate": "2023-01-05T21:32:37-08:00",
"blogLastModified": "2023-01-07T16:48:07.000-07:00"
}--->

<!DOCTYPE html>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"description": "How to install Homebrew, Neovim, and quick-lint-js on macOS to show JavaScript syntax errors while editing",
"navTitle": "Neovim for JS",
"image": "/blog/show-js-errors-neovim-macos/neovim-demo.png",
"blogDate": "2022-02-16T21:48:38-08:00"
"blogAuthor": "Matthew \"strager\" Glazar",
"blogDate": "2022-02-16T21:48:38-08:00",
"blogLastModified": "2023-08-01T16:48:07.000-07:00"
}--->

<!DOCTYPE html>
Expand Down
4 changes: 3 additions & 1 deletion website/public/blog/syntax-errors-2021/index.ejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"title": "JavaScript syntax errors compared (2021)",
"description": "Comparison of errors produced by different JavaScript parsers",
"navTitle": "JS errors",
"blogDate": "2021-12-11T17:19:10-08:00"
"blogAuthor": "Matthew \"strager\" Glazar",
"blogDate": "2021-12-11T17:19:10-08:00",
"blogModifiedDate": "2023-07-29T02:15:59-07:00"
}--->

<!DOCTYPE html>
Expand Down
1 change: 1 addition & 0 deletions website/public/blog/version-1.0/index.ejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"linkLabelHTML": "Release: version 1.0",
"description": "Faster, easier, friendlier: how quick-lint-js will take over ESLint",
"navTitle": "Release 1.0",
"blogAuthor": "Matthew \"strager\" Glazar",
"blogDate": "2021-12-13T19:27:37-08:00"
}--->

Expand Down
1 change: 1 addition & 0 deletions website/public/blog/version-2.0/index.ejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"linkLabelHTML": "Release: version 2.0",
"description": "We are proud to announce version 2.0 of quick-lint-js!",
"navTitle": "Release 2.0",
"blogAuthor": "Matthew \"strager\" Glazar",
"blogDate": "2022-02-04T21:43:20-08:00"
}--->

Expand Down
3 changes: 3 additions & 0 deletions website/public/common-head.ejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
content="<%= locals.image ?? meta.image ?? '/vscode-demo-small.gif' %>"
/>
<meta name="theme-color" content="#a76851" />
<% if (typeof meta.blogDate === 'undefined') { %>
<meta property="og:type" content="website" />
<% } %> <%# NOTE: See /website/public/blog/blog-head.ejs.html for blog article related tags %>

<meta name="twitter:card" content="summary_large_image" />
<%#
<!--
Expand Down