Skip to content

Commit

Permalink
Add Redux.dev course banners
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Nov 7, 2024
1 parent 7af5345 commit 1b9ece9
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 0 deletions.
15 changes: 15 additions & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,21 @@ module.exports = {
colorMode: {
respectPrefersColorScheme: true,
},
announcementBar: {
id: 'redux-dev-course',
content: `
<a href="https://redux.dev">
<img
src="/img/course-callout-wide.svg"
alt="Redux.dev - a new course by Mark Erikson + ui.dev - Learn more"
style="margin-top: 5px;"
/>
</a>
`,
backgroundColor: '#fafbfc',
textColor: '#091E42',
isCloseable: false,
},
navbar: {
title: 'Redux Toolkit',
logo: {
Expand Down
12 changes: 12 additions & 0 deletions website/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,15 @@ table.checkbox-table tbody td {
color: var(--ifm-color-info);
position: relative;
}

/* course callout on home page */
.course-callout.home-mid {
max-width: 900px;
margin: 1rem auto 2rem;
}

div[class*='announcementBar_'] {
/* Intentionally override the theme behavior,
so that the course banner image is effectively cropped*/
z-index: calc(var(--ifm-z-index-fixed) -1) !important;
}
8 changes: 8 additions & 0 deletions website/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ function Home() {
</div>
</section>
)}
<section className="course-callout home-mid">
<a href="https://redux.dev">
<img
src="/img/course-callout-mid.svg"
alt="Redux.dev - a new course by Mark Erikson + ui.dev - Learn more"
/>
</a>
</section>
{otherLibraries && otherLibraries.length && (
<section className={styles.features}>
<div className="container">
Expand Down
1 change: 1 addition & 0 deletions website/static/img/course-callout-mid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions website/static/img/course-callout-narrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions website/static/img/course-callout-wide.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1b9ece9

Please sign in to comment.