Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #985 from parameter1/link-header
Browse files Browse the repository at this point in the history
Add link header support to latest content list block
  • Loading branch information
brandonbk authored Oct 13, 2024
2 parents b59b3ae + 00397d5 commit 1f777e2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ $ const modifiers = ["latest-content-list", ...(input.modifiers ? input.modifier
$ const title = defaultValue(input.title, 'Latest in');
$ const withSection = defaultValue(input.withSection, false);
$ const withNativeXSection = defaultValue(input.withNativeXSection, true);
$ const linkHeader = input.linkHeader || false;
$ const link = getAsObject(input, "link");

$ const nodeInput = {
withTeaser: false,
imagePosition: "right",
Expand All @@ -31,7 +34,16 @@ $ const nodeImageInput = {
with-native-x-section=withNativeXSection
class=input.class
>
<@header>${title}</@header>
<@header>
<if(linkHeader && (input.alias || input.title))>
<marko-web-link href=`${input.alias}` ...link>
${title}
</marko-web-link>
</if>
<else>
${title}
</else>
</@header>
<@node ...nodeInput >
<@image ...nodeImageInput />
</@node>
Expand Down Expand Up @@ -59,7 +71,16 @@ $ const nodeImageInput = {
with-native-x-section=withNativeXSection
class=input.class
>
<@header>${title}</@header>
<@header>
<if(linkHeader && (input.alias || input.title))>
<marko-web-link href=`${input.alias}` ...link>
${title}
</marko-web-link>
</if>
<else>
${title}
</else>
</@header>
<@node ...nodeInput >
<@image ...nodeImageInput />
</@node>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@
},
"<node>": {},
"<query-params>": {},
"<link>": {},
"@class": "string",
"@modifiers": "array",
"@query-name": "string",
"@flush-x": "boolean",
"@flush-y": "boolean",
"@link-header": "boolean",
"@with-native-x-section": "boolean",
"@nodes": "array",
"@title": "string",
Expand Down
1 change: 1 addition & 0 deletions packages/marko-web-theme-monorail/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ $theme-card-header-font-weight: $font-weight-bold !default;
$theme-card-header-text-transform: none !default;
$theme-card-header-border: none !default;

$theme-card-header-link-color: $gray-800 !default;
$theme-card-header-link-hover-color: $primary !default;
$theme-card-header-link-hover-decoration: none !default;

Expand Down

0 comments on commit 1f777e2

Please sign in to comment.