Skip to content

Commit 24286f1

Browse files
authored
Merge pull request #4694 from reduxjs/docs/course-banners
Add Redux.dev course banners
2 parents 7af5345 + 1b9ece9 commit 24286f1

File tree

6 files changed

+38
-0
lines changed

6 files changed

+38
-0
lines changed

website/docusaurus.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,21 @@ module.exports = {
7171
colorMode: {
7272
respectPrefersColorScheme: true,
7373
},
74+
announcementBar: {
75+
id: 'redux-dev-course',
76+
content: `
77+
<a href="https://redux.dev">
78+
<img
79+
src="/img/course-callout-wide.svg"
80+
alt="Redux.dev - a new course by Mark Erikson + ui.dev - Learn more"
81+
style="margin-top: 5px;"
82+
/>
83+
</a>
84+
`,
85+
backgroundColor: '#fafbfc',
86+
textColor: '#091E42',
87+
isCloseable: false,
88+
},
7489
navbar: {
7590
title: 'Redux Toolkit',
7691
logo: {

website/src/css/custom.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,3 +272,15 @@ table.checkbox-table tbody td {
272272
color: var(--ifm-color-info);
273273
position: relative;
274274
}
275+
276+
/* course callout on home page */
277+
.course-callout.home-mid {
278+
max-width: 900px;
279+
margin: 1rem auto 2rem;
280+
}
281+
282+
div[class*='announcementBar_'] {
283+
/* Intentionally override the theme behavior,
284+
so that the course banner image is effectively cropped*/
285+
z-index: calc(var(--ifm-z-index-fixed) -1) !important;
286+
}

website/src/pages/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ function Home() {
176176
</div>
177177
</section>
178178
)}
179+
<section className="course-callout home-mid">
180+
<a href="https://redux.dev">
181+
<img
182+
src="/img/course-callout-mid.svg"
183+
alt="Redux.dev - a new course by Mark Erikson + ui.dev - Learn more"
184+
/>
185+
</a>
186+
</section>
179187
{otherLibraries && otherLibraries.length && (
180188
<section className={styles.features}>
181189
<div className="container">

website/static/img/course-callout-mid.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

website/static/img/course-callout-wide.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)