Compare commits

...

7 Commits

Author SHA1 Message Date
Mark Dumay
8c4e11b99f Merge pull request #328 from gethinode/timeline
Fix incorrectly joined URLs
2023-07-04 09:42:51 +02:00
Mark Dumay
00818cb91f Merge branch 'main' into timeline 2023-07-04 09:35:27 +02:00
mark
b3469d277c Bump package release 2023-07-04 09:34:41 +02:00
mark
3627059227 Refactor code to join URL 2023-07-04 09:34:13 +02:00
mark
4f92886b21 Fix joining of URL 2023-07-04 09:33:59 +02:00
mark
0c2f951b81 Adjust formatting 2023-07-04 09:06:15 +02:00
mark
300efb780c Fix link behavior for non-urls 2023-07-04 09:05:49 +02:00
5 changed files with 24 additions and 8 deletions

View 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 -}}

View File

@@ -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"

View File

@@ -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
View File

@@ -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",

View File

@@ -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",