Skip to content

Commit 31e9682

Browse files
authored
Merge pull request #3236 from XRPLF/fix_blog_case_study_category
Fix blog landing bugs & add case study category
2 parents d903bf9 + e12e40a commit 31e9682

File tree

6 files changed

+26
-24
lines changed

6 files changed

+26
-24
lines changed

blog/index.page.tsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ export const frontmatter = {
1111
},
1212
};
1313

14-
const target = { prefix: "" }; // TODO: fixme
15-
1614
const categories = {
1715
general: "General",
1816
release_notes: "Release Notes",
1917
advisories: "Advisories",
2018
amendments: "Amendments",
19+
case_study: "Case Study",
2120
development: "Development",
2221
developer_reflections: "Developer Reflections",
2322
features: "Features",
@@ -89,7 +88,7 @@ export default function Index() {
8988
<div className="col">
9089
<div className="text-bg">
9190
<h4 className="mb-3 eyebrow text-uppercase font-weight-light">
92-
<span className="post-date pb-2">
91+
<span className="hero-post-date pb-2">
9392
{moment(heroPost.date).format(translate("blog.banner.date.part1","MMM"))}
9493
</span>
9594
{translate("blog.banner.date.part2", " ")}
@@ -135,14 +134,14 @@ export default function Index() {
135134
className={`blog-filter input_${item}`}
136135
type="checkbox"
137136
name="categories"
138-
id={`input_${item}`}
137+
id={`input_desktop_${item}`}
139138
defaultValue={`${item}`}
140139
onChange={() => toggleCategory(item)}
141140
defaultChecked
142141
/>
143142
<label
144143
className="font-weight-bold"
145-
htmlFor={`input_${item}`}
144+
htmlFor={`input_desktop_${item}`}
146145
>
147146
{translate(categories[item])}
148147
</label>
@@ -173,14 +172,14 @@ export default function Index() {
173172
className={`blog-filter input_${item}`}
174173
type="checkbox"
175174
name="categories"
176-
id={`input_${item}`}
175+
id={`input_mobile_${item}`}
177176
defaultValue={`${item}`}
178177
onChange={() => toggleCategory(item)}
179178
defaultChecked
180179
/>
181180
<label
182181
className="font-weight-bold"
183-
htmlFor={`input_${item}`}
182+
htmlFor={`input_mobile_${item}`}
184183
>
185184
{translate(categories[item])}
186185
</label>
@@ -200,10 +199,9 @@ export default function Index() {
200199
className={`${card.category_id} pb-5 px-lg-4`}
201200
id={card.title + i}
202201
>
203-
<div className="mb-4" id="category-list">
202+
<div className="mb-4 category-list">
204203
<img
205-
alt="card block"
206-
id={`${card.category_id}`}
204+
alt=""
207205
className="mb-4"
208206
/>
209207
<div
@@ -213,7 +211,7 @@ export default function Index() {
213211
</div>
214212
</div>
215213
<div>
216-
<p id="card-date" className="mb-0">
214+
<p className="mb-0 card-date">
217215
{moment(card.date).format(translate("blog.card.date","MMM DD, YYYY"))}
218216
{ card.author ? ` by ${card.author}` : ""}
219217
</p>

blog/sidebars.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Blog sidebar file. Reminder: blogs must use one of the hard-coded categories
2+
## in their labels frontmatter, or they won't show up in the list below the
3+
## latest post, and they won't have an image.
4+
15
- group: Blog
26
groupTranslationKey: sidebar.blog
37
page: index.page.tsx

static/css/devportal2024-v1.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/img/blog/case_study.png

61.1 KB
Loading

styles/_blog.scss

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,32 @@
3636
left: 0px;
3737
}
3838

39-
#card-date {
39+
.card-date {
4040
color: $gray-400;
4141
}
4242

43-
.post-date {
43+
.hero-post-date {
4444
text-decoration: overline solid #32E685 10%;
4545
}
4646

47-
#category-list {
48-
@each $category in "general", "developer_reflections", "amendments",
49-
"advisories", "release_notes", "development", "gateway_bulletins", "features", "security"
50-
51-
{
52-
##{$category} {
47+
@each $category in "general", "developer_reflections", "amendments",
48+
"case_study", "advisories", "release_notes", "development",
49+
"gateway_bulletins", "features", "security" {
50+
.#{$category} .category-list {
51+
img {
5352
content: url("../img/blog/#{$category}.png");
5453
max-width: 100%;
5554
width: 100%;
5655
}
57-
}
58-
.label{
59-
width: fit-content;
56+
.label{
57+
width: fit-content;
58+
}
6059
}
6160
}
6261

6362
// Add styles to ensure proper wrapping on tablet sizes
6463
@media (min-width: 768px) and (max-width: 991px) {
65-
#category-list {
64+
.category-list {
6665
display: block;
6766

6867
img {

styles/_status-labels.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@
385385
&.label-use-developer_tooling,
386386
&.label-use-payments,
387387
&.blog-category-developer_reflections,
388+
&.blog-category-case_study,
388389
&.chip-blue {
389390
@include chip-blue;
390391
}

0 commit comments

Comments
 (0)