Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsaw Dave's feedback changes(#1 and #2) #1329

Merged
merged 3 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading