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

Fix various style and logic issues. #118

Merged
merged 3 commits into from
Jan 24, 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
2 changes: 1 addition & 1 deletion cigaradvisor/blocks/article-list/article-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function decorate(block) {
});
await Promise.all(promises).then((result) => {
result.forEach((detail) => {
if (detail) tmp.push(detail);
if (detail && detail.length > 0) tmp.push(detail[0]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

article list not rendering..

});
});
articles = tmp;
Expand Down
5 changes: 4 additions & 1 deletion cigaradvisor/blocks/article-teaser/article-teaser.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export default async function decorate(block) {
const filterPath = block.querySelector('a')?.getAttribute('href');
let article;
if (filterPath) {
article = await fetchPostsInfo(filterPath);
const list = await fetchPostsInfo(filterPath);
if (list && list.length > 0) {
[article] = list;
}
} else if (block.querySelector(':scope > div > div:nth-of-type(2)').textContent.toLowerCase() === 'next') {
block.classList.add('next');
const idx = document.querySelectorAll('main .article-teaser.block.next').length;
Expand Down
1 change: 1 addition & 0 deletions cigaradvisor/blocks/author-detail/author-detail.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ main .section.author-detail-container > div {
align-items: center;
margin: 0;
gap: 25px;
list-style-type: none;
}

.author-detail.block picture.bg-image {
Expand Down
5 changes: 2 additions & 3 deletions cigaradvisor/blocks/carousel/carousel.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.carousel-wrapper {
position: relative;
padding-left: 0;
padding-right: 0;
padding: 10px 0;
width: 100%;
margin-left: auto;
margin-right: auto;
Expand Down Expand Up @@ -105,4 +104,4 @@
.carousel.block .slide {
flex: 1 0 50%;
}
}
}
2 changes: 2 additions & 0 deletions cigaradvisor/blocks/header/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
display: flex;
margin: 0;
padding: 0;
list-style-type: none;
}

.header.block nav .top-nav-right ul li {
Expand Down Expand Up @@ -234,6 +235,7 @@
column-count: 3;
width: 100%;
padding: 3em;
list-style-type: none;
}

.header.block nav .secondary-nav-box.browse-categories ul li {
Expand Down
2 changes: 1 addition & 1 deletion cigaradvisor/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export async function fetchPostsInfo(filterValue, filterParam = 'path') {
let filter = filterValue;
filter = getRelativePath(filterValue);
await loadPosts();
return articleIndexData.find((obj) => obj[filterParam] === filter);
return articleIndexData.filter((obj) => obj[filterParam] === filter);
}

/**
Expand Down
13 changes: 12 additions & 1 deletion cigaradvisor/styles/templates/blog-post.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
/** Override global settings for hero **/
body.blog-post-template main .articleheader-container > div {
padding: 0;
max-width: unset;
}

body.blog-post-template main .articleheader-container > div {
max-width: unset;
}

/** End Global overrides **/

body.blog-post-template main main .default-content-wrapper {
body.blog-post-template main .default-content-wrapper {
padding: 0 15px;
width: 100%;
margin-left: auto;
Expand Down