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

fix: usage of schema template #306

Merged
merged 5 commits into from
Aug 24, 2024
Merged
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
4 changes: 3 additions & 1 deletion docs/pages/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

None.
### Fixed

- Incorrect use of the `_internal/schema.html` template [#306](https://github.com/g1eny0ung/hugo-theme-dream/pull/306)

## [3.6.0] - 2024-08-24

Expand Down
6 changes: 4 additions & 2 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@
{{ .TableOfContents }}
</div>
{{ end }}
<article class="mx-auto prose dark:prose-invert" id="dream-single-post-main">
<article class="mx-auto prose dark:prose-invert" id="dream-single-post-main" itemscope itemtype="http://schema.org/Article">
{{ template "_internal/schema.html" . }}

<header>
<h1>{{ .Title }}</h1>
<h1 itemprop="headline">{{ .Title }}</h1>
<p class="text-sm">
{{ if site.Params.Experimental.jsDate }}
<span data-format="luxon">{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}</span>
Expand Down
10 changes: 6 additions & 4 deletions layouts/partials/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
<span>@</span>
{{ end }}

<span>
<span itemprop="author" itemscope itemtype="https://schema.org/Person">
{{ if .Params.author }}
{{ if and .Params.authorlink (eq .template "single") }}
<a href="{{ .Params.authorlink }}" target="_blank">{{ .Params.author }}</a>
<a itemprop="url" href="{{ .Params.authorlink }}" target="_blank">
<span itemprop="name">{{ .Params.author }}</span>
</a>
{{ else }}
{{ .Params.author }}
<span itemprop="name">{{ .Params.author }}</span>
{{ end }}
{{ else }}
{{ site.Params.author }}
<span itemprop="name">{{ site.Params.author }}</span>
{{ end }}
</span>
</div>
31 changes: 24 additions & 7 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,42 @@

<link rel="canonical" href="{{ .Permalink }}" />

{{ template "_internal/schema.html" . }}

{{ if eq .Type "posts" }}
<!-- Page Author -->
<!-- Page Author & Description -->
<meta name="author" content="{{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ site.Params.author }}{{ end }}" />
<meta name="description" content="{{ .Summary | plainify }}" />

<!-- Keywords -->
{{- $keywords := slice }}
{{- with .Keywords }}
{{- $keywords = . }}
{{- else }}
{{- range .GetTerms "tags" }}
{{- $keywords = $keywords | append .Title }}
{{- else }}
{{- range $taxonomy, $_ := site.Taxonomies }}
{{- range $.GetTerms $taxonomy }}
{{- $keywords = $keywords | append .Title }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
<meta name="keywords" content="{{ delimit $keywords `,` }}">
{{ else }}
<!-- Site Author -->
<!-- Site Author & Description -->
<meta name="author" content="{{ site.Params.author }}" />
<meta name="description" content="{{ site.Params.description | plainify }}" />
{{ end }}

<!-- Site Generator -->
{{ hugo.Generator }}

<!-- Open Graph -->
{{ template "_internal/opengraph.html" . }}

<!-- Twitter Cards -->
{{ template "_internal/twitter_cards.html" . }}

<!-- Site Generator -->
{{ hugo.Generator }}

<link rel="stylesheet" href="{{ "css/output.css" | relURL }}" />

{{ if or site.Params.backgroundImage site.Params.backgroundImageDark }}
Expand Down