Skip to content

Commit

Permalink
feat: add temporary notice for domain switch reminder in bulletin board
Browse files Browse the repository at this point in the history
  • Loading branch information
rockbenben committed Apr 11, 2023
1 parent a7c8cf2 commit cb9ba5f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ const config = {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
announcementBar: {
id: 'announcement_bar',
content: getAnnouncement(),
backgroundColor: '#fafbfc',
textColor: '#091E42',
isCloseable: false,
},
}),
};

Expand All @@ -114,3 +121,9 @@ function getNavbar() {
default: return zhNavbar;
}
}
function getAnnouncement() {
switch(process.env.DOCUSAURUS_CURRENT_LOCALE) {
case "en": return 'Old domain will expire soon. Please bookmark aishort.top';
default: return '旧域名即将失效,继续使用请收藏 aishort.top';
}
}

0 comments on commit cb9ba5f

Please sign in to comment.