Skip to content

Commit

Permalink
add more open graph data
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickwasused committed Jan 26, 2024
1 parent 7a328e8 commit b779d64
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const eleventySass = require("eleventy-sass");

module.exports = function(eleventyConfig) {
eleventyConfig.addFilter("custom_date", function(value) { return value.toLocaleDateString() });
eleventyConfig.addFilter("custom_date_iso", function(value) { return value.toISOString().split('T')[0] });
eleventyConfig.addPassthroughCopy("src/basic.css");
eleventyConfig.addPassthroughCopy("src/lozad.js");
eleventyConfig.addPassthroughCopy("src/_headers");
Expand Down
14 changes: 13 additions & 1 deletion src/_includes/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,23 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="telephone=no" />
<title>{{ title | default: "Nick's Site" }}</title>
<meta name="description" content="{{ snippet | default: "This is a Tech focused blog where I write random posts." }}">
<link rel="alternate" type="application/rss+xml" href="/feed.xml" title="Nick's Site" />
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
<link rel="stylesheet" href="{{ "/basic.css" | rev }}" />
<link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml">
<meta property="og:title" content="{{ title | default: "Nick's Site" }}" />
<meta property="og:type" content="website" />
<meta property="og:locale" content="{{ locale | default: "en_US" }}" />
<meta property="og:description" content="{{ snippet | default: "This is a Tech focused blog where I write random posts." }}" />
<meta name="description" content="{{ snippet | default: "This is a Tech focused blog where I write random posts." }}">
<meta property="og:site_name" content="Nick's Site" />
{% if snippet %}
<meta property="article:published_time" content="{{ date | custom_date_iso }}" />
<meta property="article:section" content="Technology" />
{% for tag in tags %}
<meta property="article:tag" content="{{ tag }}" />
{% endfor %}
{% endif %}
</head>
<body>
<h1 class="title"><a href="/">Nick's Site</a></h1>
Expand Down

0 comments on commit b779d64

Please sign in to comment.