Skip to content

Commit

Permalink
Use Hugo twitter cards and opengraph templates
Browse files Browse the repository at this point in the history
  • Loading branch information
yochem committed Sep 19, 2024
1 parent 2eb590d commit e94ef8d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion content/posts/carnaval.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
language: nl
locale: nl-NL
date: 2024-07-08
title: Carnaval datum in je online agenda!
unlisted: true
Expand Down
7 changes: 7 additions & 0 deletions hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ disableKinds:
- taxonomy
- term

languageCode: en-US

markup:
goldmark:
extensions:
strikethrough: true
footnotes: true

params:
description: Yochem's personal website and blog
social:
twitter: yoch3m

menus:
footer:
- name: Home
Expand Down
24 changes: 13 additions & 11 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<!DOCTYPE html>

<html lang="{{ default "en" .Params.Language }}" dir="ltr">
<html lang="{{ or .Params.locale site.Language.LanguageCode }}" dir="ltr">

<head>
<title>{{ with .Title }}{{ . }} | {{ end }}{{ site.Title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<meta name="description" content="Yochem van Rosmalen personal website">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ with .Title }}{{ . }} | {{ end }}{{ site.Title }}</title>

<meta name="theme-color" content="#1b1b1b" media="(prefers-color-scheme: dark)">
<meta name="theme-color" content="lightgrey" media="(prefers-color-scheme: light)">
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@yoch3m" />
<meta name="twitter:creator" content="@yoch3m" />
<meta name="twitter:title" content="{{ site.Title }}" />
<meta name="twitter:description" content="Dutch AI student" />

<meta name="description" content="{{ site.Params.description }}">
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }}

{{- if .Params.noindex -}}
<meta name="robots" content="noindex" />
{{- end -}}
{{ $css := resources.Get "style.css" }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">

{{ with resources.Get "style.css" }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{ end }}
<link rel="icon" type="image/x-icon" href="/favicon.ico">
</head>

Expand Down

0 comments on commit e94ef8d

Please sign in to comment.