Skip to content

Commit

Permalink
Fix anchor handling of cover image
Browse files Browse the repository at this point in the history
  • Loading branch information
markdumay committed Nov 19, 2024
1 parent b7fb5be commit 2b6fc61
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 191 deletions.
190 changes: 3 additions & 187 deletions hugo_stats.json
Original file line number Diff line number Diff line change
@@ -1,191 +1,7 @@
{
"htmlElements": {
"tags": [
"a",
"body",
"button",
"div",
"footer",
"form",
"head",
"html",
"img",
"input",
"label",
"li",
"link",
"meta",
"nav",
"ol",
"p",
"path",
"script",
"small",
"span",
"strong",
"svg",
"symbol",
"title",
"ul",
"use"
],
"classes": [
"active",
"align-items-center",
"align-self-center",
"align-self-end",
"ball",
"bg-body",
"bg-opacity-10",
"bg-primary",
"bottom-0",
"bottom-bar",
"breadcrumb",
"breadcrumb-item",
"btn",
"btn-close",
"btn-primary",
"checkbox",
"col",
"col-12",
"col-6",
"col-md-2",
"col-md-3",
"col-md-4",
"col-md-8",
"col-md-9",
"col-sm-12",
"collapse",
"collapsed",
"container-fluid",
"container-xxl",
"d-flex",
"d-inline",
"d-md-block",
"d-none",
"display-1",
"display-4",
"emphasis",
"end-0",
"fa",
"fa-10x",
"fa-2x",
"fa-book-open",
"fa-ellipsis",
"fa-face-frown",
"fa-fw",
"fa-github",
"fa-linkedin",
"fa-medium",
"fa-moon",
"fa-sun",
"fab",
"fas",
"fixed-top",
"flex-column",
"flex-fill",
"footer",
"form-control",
"fs-3",
"fs-5",
"fw-30",
"fw-bold",
"hstack",
"img-fluid",
"img-wrap",
"invisible",
"is-search",
"justify-content-center",
"justify-content-end",
"justify-content-start",
"label",
"link-bg-footer",
"link-secondary",
"main-content",
"main-nav-toggler",
"me-auto",
"middle-bar",
"min-vh-100",
"mode-switch",
"ms-auto",
"ms-md-3",
"mt-3",
"mt-4",
"mt-5",
"mt-md-0",
"mx-auto",
"mx-md-0",
"my-auto",
"my-md-auto",
"nav-item",
"nav-link",
"navbar",
"navbar-brand",
"navbar-collapse",
"navbar-container",
"navbar-expand-md",
"navbar-fixed-top",
"navbar-mode-selector",
"navbar-nav",
"navbar-toggler",
"no-js",
"order-0",
"order-1",
"order-md-0",
"order-md-1",
"p-0",
"p-2",
"p-3",
"p-4",
"pb-4",
"pb-md-0",
"position-fixed",
"position-relative",
"ps-1",
"pt-4",
"pt-5",
"pt-md-3",
"px-4",
"px-xxl-0",
"py-3",
"rounded",
"row",
"row-cols-1",
"row-cols-2",
"row-cols-md-2",
"row-cols-sm-3",
"search",
"search-input",
"search-suggestions",
"shadow",
"svg-inline--fa",
"text-center",
"text-decoration-none",
"text-muted",
"text-secondary",
"text-sm-start",
"text-start",
"toast",
"toast-body",
"toast-container",
"toast-header",
"toggler-icon",
"top-bar"
],
"ids": [
"fa-face-frown",
"fab-github",
"fab-linkedin",
"fab-medium",
"fas-book-open",
"fas-ellipsis",
"fas-moon",
"fas-sun",
"navbar-0-collapse",
"navbar-mode",
"navbar-mode-checkbox",
"toast-container",
"toast-copied-code-message"
]
"tags": null,
"classes": null,
"ids": null
}
}
14 changes: 13 additions & 1 deletion layouts/partials/single/thumbnail.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
{{ with .class }}{{ $class = . }}{{ end }}
{{- $ratio := .ratio | default "21x9" -}}
{{- $thumbnail := "" -}}
{{- $anchor := "" -}}
{{- $credits := "" -}}
{{ $figclass := .figclass }}

{{- if reflect.IsMap $page.Params.Thumbnail -}}
{{- $thumbnail = $page.Params.Thumbnail.url -}}
{{- $anchor = $page.Params.Thumbnail.anchor }}
{{- $author := "" -}}
{{- if and $page.Params.Thumbnail.authorURL "text" $page.Params.Thumbnail.author }}
{{- $author = partial "assets/link.html" (dict "destination" $page.Params.Thumbnail.authorURL "text" $page.Params.Thumbnail.author "page" $page) -}}
Expand Down Expand Up @@ -38,5 +40,15 @@
{{- end -}}

{{ if $thumbnail -}}
{{- partial "assets/image.html" (dict "url" $thumbnail "ratio" $ratio "wrapper" $wrapper "class" $class "title" $page.Params.title "caption" $credits "figclass" $figclass "priority" "high") -}}
{{- partial "assets/image.html" (dict
"url" $thumbnail
"anchor" $anchor
"ratio" $ratio
"wrapper" $wrapper
"class" $class
"title" $page.Params.title
"caption" $credits
"figclass" $figclass
"priority" "high"
) -}}
{{ end -}}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gethinode/hinode",
"version": "0.27.9",
"version": "0.27.10",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [
"hugo",
Expand Down

0 comments on commit 2b6fc61

Please sign in to comment.