Skip to content

Commit 10101d4

Browse files
feat(frontend): allow additional links in card body
1 parent c6a6b9c commit 10101d4

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

packages/endpoint-posts/lib/controllers/posts.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ export const postsController = async (request, response, next) => {
4343
item.icon = item["post-type"];
4444
item.locale = application.locale;
4545
item.photo = getPhotoUrl(publication, item);
46-
item.description =
47-
item.summary ||
48-
(item.content?.text &&
49-
excerpt(item.content.text, 30, publication.locale));
46+
item.description = {
47+
text:
48+
item.summary ||
49+
(item.content?.text &&
50+
excerpt(item.content.text, 30, publication.locale)),
51+
};
5052
item.title = getPostName(publication, item);
5153
item.url = path.join(request.baseUrl, request.path, item.uid);
5254
item.badges = getPostStatusBadges(item, response);

packages/frontend/components/card/styles.css

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
margin-block-start: 0;
4343
min-inline-size: 67%;
4444
padding: var(--card-space, var(--space-s));
45+
46+
a:not([rel="bookmark"]) {
47+
position: relative;
48+
z-index: 1;
49+
}
4550
}
4651

4752
.card__title {

packages/frontend/components/card/template.njk

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
{% endif %}
2424
{{ prose({
2525
classes: "card__meta",
26-
text: opts.description | markdown | striptags
26+
text: opts.description.text,
27+
html: opts.description.html
2728
}) | indent(4) if opts.description }}
2829
{% if opts.published or opts.badges %}
2930
<footer class="card__footer">

0 commit comments

Comments
 (0)