Skip to content

Commit

Permalink
Fix various style and logic issues. (#118)
Browse files Browse the repository at this point in the history
* Fix various style and logic issues.

* Rebase error.
  • Loading branch information
bstopp authored Jan 24, 2024
1 parent 5f6fa18 commit 9236059
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 7 deletions.
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]);
});
});
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

0 comments on commit 9236059

Please sign in to comment.