Skip to content

Commit

Permalink
fix: use relative url for card link (#52)
Browse files Browse the repository at this point in the history
* fix: cards links should not redirect to 404

* docs: update card links

* fix: use relURL for card link
  • Loading branch information
imfing authored Sep 13, 2023
1 parent 4a9a285 commit f70ba59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions exampleSite/content/docs/guide/shortcodes/cards.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ linkTitle: Cards
## Example

{{< cards >}}
{{< card link="/" title="Callout" icon="warning" >}}
{{< card link="../callout" title="Callout" icon="warning" >}}
{{< card link="/" title="No Icon" >}}
{{< /cards >}}

Expand All @@ -19,7 +19,7 @@ linkTitle: Cards

```
{{</* cards */>}}
{{</* card link="/" title="Callout" icon="warning" */>}}
{{</* card link="../callout" title="Callout" icon="warning" */>}}
{{</* card link="/" title="No Icon" */>}}
{{</* /cards */>}}
```
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<a
class="hextra-card group flex flex-col justify-start overflow-hidden rounded-lg border border-gray-200 text-current no-underline dark:shadow-none hover:shadow-gray-100 dark:hover:shadow-none shadow-gray-100 active:shadow-sm active:shadow-gray-200 transition-all duration-200 {{ $linkClass }}"
href="{{ $link }}"
href="{{ $link | relURL }}"
{{- if $external }}
target="_blank" rel="noreferrer"
{{- end -}}
Expand Down

0 comments on commit f70ba59

Please sign in to comment.