Skip to content

Commit 582c168

Browse files
committed
Fix comment permalinks
1 parent a8fa1df commit 582c168

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

.changeset/smart-windows-buy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudfour/patterns': patch
3+
---
4+
5+
Comment permalinks now resolve to the hash URL of the comment ID rather than a nonexistent Timber `comment.link` property

src/components/comment/comment.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ test(
2020
await commentMarkup({
2121
comment: {
2222
ID: 1,
23-
link: '#comment-1',
2423
date: new Date('January 1 2000'),
2524
avatar: '',
2625
author: {

src/components/comment/comment.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<div class="c-comment__meta">
5252
<div class="c-comment__meta-detail">
5353
<a class="c-comment__meta-link"
54-
href="{{comment.link}}">
54+
href="#comment-{{comment.ID}}">
5555
<span class="c-comment__meta-icon">
5656
{% include '@cloudfour/components/icon/icon.twig' with {
5757
name: 'link',

src/components/comment/demo/data.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export const makeComment = ({
9090

9191
const result = {
9292
ID: id,
93-
link: `#comment-${id}`,
9493
date: new Date(),
9594
avatar: `https://placeimg.com/92/92/${sample(placeImgCategories)}`,
9695
author: {

0 commit comments

Comments
 (0)