Skip to content

Commit b0a52a5

Browse files
committed
Add more open graph tags
1 parent 9e1554f commit b0a52a5

3 files changed

Lines changed: 34 additions & 3 deletions

File tree

  • config/_default
  • content/blog/2025/Debofuscating-Javascript-to-fix-a-neopets-game
  • themes/customTheme/layouts/partials

config/_default/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ languageCode = 'en-us'
33
title = 'Personal website'
44
theme = ['hugo-video', 'customTheme']
55
summaryLength = "2"
6+
timeZone = "America/Chicago"
67

78
enableInlineShortcodes = true
89

content/blog/2025/Debofuscating-Javascript-to-fix-a-neopets-game/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ authors: Andrew Long
55
type: blog
66
tags: ["Neopets", "Reverse Engineering"]
77
summary: "A Neopets game doesn't work too good, so I learned how to deobfuscate JavaScript to fix it."
8+
open_graph:
9+
image: "settings-mock-up.webp"
10+
video: "after-raf.webm"
811
toc: false
912
---
1013

themes/customTheme/layouts/partials/head.html

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,42 @@
1+
{{ $are_prof_slice := reflect.IsSlice .Params.authors }}
2+
13
<meta name="viewport" content="width=device-width, initial-scale=1">
24
<meta name="description" content="{{ .Params.description }}">
35
{{ range $key, $value := $.Params.meta }}
4-
<meta name="{{ $key }}" {{ range $k, $v := $value }}{{ printf "%s=\"%s\"" $k $v | safeHTMLAttr }}{{ end }}>
6+
<meta name="{{ $key }}" {{ range $k, $v := $value }}{{ printf "%s=\"%s\"" $k $v | safeHTMLAttr }}{{ end }}>
57
{{ end }}
6-
<title>{{ .Page.Title }} - {{ .Site.Data._author.name }}</title>
8+
9+
<title>{{ .Page.Title }} - {{ if $are_prof_slice }}{{ delimit .Params.authors ", " }}{{ else }}{{ .Params.authors }}{{ end }}</title>
710
<meta property="og:title" content="{{ .Params.Title }}" />
811
<meta property="og:description" content="{{ .Params.summary }}" />
912
<meta property="og:type" content="website" />
1013
<meta property="og:locale" content="en_US" />
1114
<meta property="og:url" content="{{ .Permalink }}" />
12-
<meta property="og:video" content="{{ with .Resources.Get "after-raf.webm" }} {{ .Permalink }} {{ end }}">
15+
16+
{{ if $are_prof_slice }}
17+
{{ range .Params.authors }}
18+
<meta property="article:author" content="{{ . }}">
19+
{{ end }}
20+
{{ else }}
21+
<meta property="article:author" content="{{ .Params.authors }}">
22+
{{ end }}
23+
24+
{{ $are_tags_slice := reflect.IsSlice .Params.tags }}
25+
{{ if $are_tags_slice }}
26+
{{ range .Params.tags }}
27+
<meta property="og:tag" content="{{ . }}" />
28+
{{ end }}
29+
{{ else }}
30+
<meta property="og:tag" content="{{ .Params.tags }}" />
31+
{{ end }}
32+
33+
{{ $layout := "2006-01-02T15:04:05-07:00" }}
34+
{{ if .Params.date }}
35+
<meta property="article:published_time" content="{{ time.AsTime .Params.date | time.Format $layout }}">
36+
{{ end }}
37+
38+
<meta property="og:image" content="{{ with .Resources.Get .Params.open_graph.image }}{{ .Permalink }}{{ end }}">
39+
<meta property="og:video" content="{{ with .Resources.Get .Params.open_graph.video }}{{ .Permalink }}{{ end }}">
1340
<!-- <meta property="og:image" content="https://ia.media-imdb.com/images/rock.jpg" /> -->
1441

1542
<link rel="icon" type="image/x-icon" href="/img/favicon.png">

0 commit comments

Comments
 (0)