ZORALab / Hestia

One Peaceful Frontend+Backend Software Library Suite.
https://hestia.zoralab.com
Other
19 stars 1 forks source link

LD+JSON Breadcrumb Requires Adjustment #391

Closed hollowaykeanho closed 1 year ago

hollowaykeanho commented 1 year ago

Description

Please provide a short description of what you have encountered below.

LD+JSON Breadcrumb generated a bunch of bad values for WebPage type. It's a bug

Expected Behavior

Please specify the expected behavior of your usage below.

Patch this in its function:

{{- /* prepare breadcrumb as WebPage has such a field */ -}}
{{- $breadcrumb = dict -}}
{{- if len $Page.Nav.Parents -}}
        {{- $breadcrumb = slice -}}
        {{- range $i, $v := $Page.Nav.Parents -}}
                {{- $breadcrumb = append (dict
                        "@type" "ListItem"
                        "item" (dict
                                "@type" "Thing"
                                "name" $v.Titles.Page
                                "url" (string $v.URL.Current.Absolute)
                        )
                        "position" (add 1 (int $i))
                ) $breadcrumb -}}
        {{- end -}}
        {{- $breadcrumb = dict
                "@type" "BreadcrumbList"
                "itemListElement" $breadcrumb
                "itemListOrder" "Ascending"
                "numberOfItems" (len $Page.Nav.Parents)
        -}}
{{- end -}}

Current Behavior

Please specify the current behavior of software below.

2023-07-10-11-22-00

Steps to Reproduce (COMPULSORY)

Please specify all the steps required to re-produce the problem.

Attachments

Please drag and drop the necessary data files (e.g. screenshot, logs, etc)
below.
JeanShuralyov commented 1 year ago

=p

hollowaykeanho commented 1 year ago

Implemented in e9afe87b66a4898ed7f821376e9358984aaf6890

hollowaykeanho commented 1 year ago

Released in v1.2.1.