mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-07 01:54:23 +00:00
Merge pull request #328 from gethinode/timeline
Fix incorrectly joined URLs
This commit is contained in:
16
layouts/partials/utilities/URLJoin.html
Normal file
16
layouts/partials/utilities/URLJoin.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{{- $base := .base -}}
|
||||
{{- if not $base }}
|
||||
{{- errorf "partial [assets/utilities/URLJoin.html] - Expected param 'base'" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $path := .path -}}
|
||||
{{- if not $path }}
|
||||
{{- errorf "partial [assets/utilities/URLJoin.html] - Expected param 'path'" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $url := $path -}}
|
||||
{{- if not (hasPrefix $path "http") -}}
|
||||
{{- $url = printf "%s/%s" (strings.TrimSuffix "/" $base) $path -}}
|
||||
{{- end }}
|
||||
|
||||
{{- return $url -}}
|
@@ -58,7 +58,7 @@
|
||||
<div class="pb-3">
|
||||
{{- partial "assets/button.html" (dict
|
||||
"title" $title
|
||||
"href" (printf "%s/%s" (strings.TrimSuffix "/" site.Params.docs.release) $version)
|
||||
"href" (partial "partials/utilities/URLJoin.html" (dict "base" site.Params.docs.release "path" $version))
|
||||
"size" "sm"
|
||||
"color" $color
|
||||
"outline" "true"
|
||||
|
@@ -45,9 +45,9 @@
|
||||
{{- $badge := .badge -}}
|
||||
{{- $url := .url -}}
|
||||
{{- $date := .date -}}
|
||||
{{ if and $url (not (hasPrefix $url "http")) }}
|
||||
{{ $url = path.Join site.Params.docs.release $url }}
|
||||
{{ end }}
|
||||
{{- if and $url (not (hasPrefix $url "http")) -}}
|
||||
{{- $url = partial "partials/utilities/URLJoin.html" (dict "base" site.Params.docs.release "path" $url) }}
|
||||
{{- end -}}
|
||||
{{- $direction := .direction -}}
|
||||
|
||||
<div class="col-{{ $col }} d-flex align-items-center">
|
||||
@@ -59,7 +59,7 @@
|
||||
<a class="fs-5 fw-bold text-uppercase link-{{ $color }} text-break align-middle" href="{{ . }}">{{ $title }}</a>
|
||||
<span class="badge rounded-pill text-bg-{{ $color }} ms-1">{{ if $badge }}<a class="link-bg-{{ $color }}" href="{{ . }}">{{ $badge }}</a>{{ end }}</span>
|
||||
{{ else}}
|
||||
<span class="fs-5 fw-bold text-uppercase link-{{ $color }} text-break align-middle">{{ $title }}</span>
|
||||
<span class="fs-5 fw-bold text-uppercase text-{{ $color }} text-break align-middle">{{ $title }}</span>
|
||||
<span class="badge rounded-pill text-bg-{{ $color }} ms-1">{{ if $badge }}{{ $badge }}{{ end }}</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.15.4",
|
||||
"version": "0.15.5",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.15.4",
|
||||
"version": "0.15.5",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@fortawesome/fontawesome-free": "^6.4.0",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.15.4",
|
||||
"version": "0.15.5",
|
||||
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
|
||||
"keywords": [
|
||||
"hugo",
|
||||
|
Reference in New Issue
Block a user