-
Notifications
You must be signed in to change notification settings - Fork 53
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
Replace hero image with carousel slider #544
Replace hero image with carousel slider #544
Conversation
@TimOsahenru I'm glad to hear that you were able to get the tests passing? What did you wind up doing in the end? |
This is a great start! There are a couple of things that I would like to see refined before we go live with the changes. That said I don't want to lose this work so I've created a new branch called Quick List of things to address:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TimOsahenru great work on this...
I know there are a lot of comments which is why I want to use this as the start for the work in New Carousel
and then iterate on that work to get it live on the page. This has been excellent so far!
@@ -12,7 +12,7 @@ def page_url(xprocess, url_port): | |||
url, port = url_port | |||
|
|||
class Starter(ProcessStarter): | |||
timeout = 4 | |||
timeout = 20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah so your server wasn't ready yet. This is a good solution... great work troubleshooting and catching this!!
@@ -12,6 +12,7 @@ | |||
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}" /> | |||
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ '/feed.xml' | prepend: site.baseurl | prepend: site.url }}" /> | |||
<link rel="icon" href="https://fav.farm/%E2%9C%8A%F0%9F%8F%BE" type="image/svg" /> | |||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You chose to use bootstrap. Interesting... I wonder what the load time difference is between using bootstrap versus a solution that uses css with transitions and animations.
Adding bootstrap for a singular component doesn't feel great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You’re absolutely right; I hadn’t fully considered the impact of load time when choosing Bootstrap. I felt custom CSS might be re-inventing the wheel.
I’ll look into using a custom CSS and explore the impact both has on our load time. Thanks for the insight
<img src="{{ post.featured_image | default: post.content | split: '!' | first | split: '(' | last | split: ')' | first | default: 'default-image.jpg' }}" alt="{{ post.title }}"> | ||
</div> | ||
<h3 class="post-title">{{ post.title }}</h3> | ||
<p class="post-summary">{{ post.excerpt | strip_html | truncatewords: 20 }}</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates some interesting issues... Perhaps we can request a description on each article (I mentioned this in the comments)
{% for post in site.posts %} | ||
<div class="carousel-item {% if forloop.first %}active{% endif %}"> | ||
<div class="email-circle"> | ||
<img src="{{ post.featured_image | default: post.content | split: '!' | first | split: '(' | last | split: ')' | first | default: 'default-image.jpg' }}" alt="{{ post.title }}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is creating some issues in that the default image is not being selected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha! Working on it. Thanks
padding: 40px; | ||
border-radius: 10px; | ||
margin: 0 auto; | ||
width: 85%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This width inside the container makes the carousel smaller than everything around it. I'd suggest making it 100%.
width: 85%; | ||
/* max-width: 1000px; */ | ||
} | ||
.email-circle { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this called email circle...
Naming is important... I hope we can name it something that matches the description.
@@ -99,3 +99,16 @@ def test_mailto_bpdevs(page_url: tuple[Page, str]) -> None: | |||
page.goto(live_server_url) | |||
mailto = page.get_by_role("link", name="email") | |||
expect(mailto).to_have_attribute("href", "mailto:[email protected]") | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests that we have coded for that I would like to see.
Test 1:
- Add a small post as a demo (in test as a test case and destroy it after)
- Wait and let it rebuild and then check to see if the default image is grabbed.
Test 2
- If you select the next_button you expect the image to change to a new one. Same for prev_button
Test 3
- That slides match the links in the recent posts section
Test 4
- When you click the links in the carousel they go to the corresponding webpages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Jay. I'll get to implementing these changes right away
I tried a couple of unconventional things 😆, but ultimately increasing the server time from 4 to 20 was what did the trick for me. |
Thanks. I'll effect all these changes and make a push to |
Issue Link 🔗:
Issue: #365
Type of Change
Description 📋
Replaced static hero image with a dynamic Bootstrap carousel for improved user experiece.
Checklist ✅
pre-commit run --all
Additional Notes & Screenshots
Add any additional notes or comments that might be helpful for the reviewers.