Skip to content

Commit

Permalink
Merge pull request #1329 from hlxsites/wsaw-updts-latst
Browse files Browse the repository at this point in the history
wsaw Dave's feedback changes(#1 and #2)
  • Loading branch information
davenichols-DHLS authored Dec 16, 2024
2 parents 0deef94 + 7605551 commit 39151f6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
24 changes: 15 additions & 9 deletions blocks/card-list/articleCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { formatDateUTCSeconds, imageHelper, makePublicUrl } from '../../scripts/
import {
li, a, p, div, time, span, h3,
} from '../../scripts/dom-builder.js';
import { getMetadata } from '../../scripts/lib-franklin.js';

const template = getMetadata('template');
const linkText = template === 'wsaw' ? 'Learn More →' : 'Read Article →';

export default function createCard(article, firstCard = false) {
const cardTitle = article.title.indexOf('| Danaher Life Sciences') > -1
Expand All @@ -17,14 +21,7 @@ export default function createCard(article, firstCard = false) {
{ class: 'eyebrow-sm' },
article.brand || 'Danaher Corporation',
),
p(
{ class: 'text-base text-gray-500 font-extralight' },
time(
{ datetime: formatDateUTCSeconds(article.publishDate) },
formatDateUTCSeconds(article.publishDate, { month: 'long' }),
),
span({ class: 'pl-2' }, `${article.readingTime} min read`),
),

h3(
{
class:
Expand All @@ -37,10 +34,19 @@ export default function createCard(article, firstCard = false) {
class:
'mt-auto inline-flex w-full py-5 text-base text-danaherpurple-500 font-semibold',
},
'Read Article →',
linkText,
),
),
);
const showDateTime = p(
{ class: 'text-base text-gray-500 font-extralight' },
time(
{ datetime: formatDateUTCSeconds(article.publishDate) },
formatDateUTCSeconds(article.publishDate, { month: 'long' }),
),
span({ class: 'pl-2' }, `${article.readingTime} min read`),
);
if (template !== 'wsaw') cardWrapper.querySelector('.eyebrow-sm')?.after(showDateTime);

return li(
{
Expand Down
4 changes: 4 additions & 0 deletions tools/importer/transformers/cardList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ const URLS_TO_BLOCK_MAP = [
url: '/we-see-a-way.html',
blockName: 'Card List (wsaw)',
},
{
url: '/we-see-a-way/solutions/analytical-tools.html',
blockName: 'Card List (wsaw)',
},
{
url: '/blog.html',
blockName: 'Card List (blog)',
Expand Down

0 comments on commit 39151f6

Please sign in to comment.