Skip to content

Commit

Permalink
LCP fix (#65)
Browse files Browse the repository at this point in the history
* initial

* Update articleheader.css

* article image caption

* caption

* Update articleheader.css

* article header

* null check

* template styling

* Update styles.css

* Update articleheader.js
  • Loading branch information
kailasnadh790 authored Jan 15, 2024
1 parent c509114 commit 38191e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cigaradvisor/blocks/articleheader/articleheader.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function getRelativePath(path) {
}

export default async function decorate(block) {
const section = document.createElement('section');
const imageWrapper = document.createElement('div');
imageWrapper.classList.add('image-wrapper');
const picture = block.querySelector('picture');
Expand Down Expand Up @@ -46,6 +47,7 @@ export default async function decorate(block) {
readTimeEl.classList.add('article-read-time');
readTimeEl.innerHTML = `<span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time">${readTime}</span>`;
articleInfo.append(readTimeEl);
block.replaceChildren(imageWrapper);
block.append(articleInfo);
section.append(imageWrapper);
section.append(articleInfo);
block.replaceChildren(section);
}

0 comments on commit 38191e1

Please sign in to comment.