Skip to content

Commit

Permalink
social.html: include microdata template
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Mar 25, 2024
1 parent 431a6e7 commit cd2ed51
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ params:
analytics:
fathom_site: "ITUSEYJG"

# This is currently used by Hugo's internal twitter_cards.html and opengraph.html templates;
# the first image in the following array is always used, unless specified in the front matter
# This is currently used by Hugo's internal templates; the first image
# in the following array is always used, unless specified in the front matter
images:
- "/assets/img/bootstrap-social.png"

Expand Down
2 changes: 1 addition & 1 deletion src/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="{{ site.Language.LanguageCode }}">
<html lang="{{ site.Language.LanguageCode }}" itemscope itemtype="http://schema.org/WebPage">
<head>
{{ partial "head" . }}
</head>
Expand Down
9 changes: 2 additions & 7 deletions src/layouts/partials/social.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@
<meta name="author" content="{{ $author | default .Site.Params.author }}">

{{ template "_internal/twitter_cards.html" . -}}
{{- /* Manually add `twitter:creator` since Hugo's internal shortcode has some issues */ -}}
{{- /* Manually add `twitter:creator` since Hugo's internal shortcode doesn't add it */ -}}
<meta name="twitter:creator" content="@{{ $authorTwitter | default .Site.Params.twitter }}">

{{ template "_internal/opengraph.html" . -}}

{{- /* Manually add `og:image`'s dimensions since Hugo's internal shortcode doesn't do it */ -}}
{{- $socialImage := path.Join "src/static" (index $.Site.Params.images 0) -}}
{{- with imageConfig $socialImage -}}
<meta property="og:image:width" content="{{ .Width }}">
<meta property="og:image:height" content="{{ .Height }}">
{{- end }}
{{ template "_internal/schema.html" . -}}

0 comments on commit cd2ed51

Please sign in to comment.