diff --git a/packages/docusaurus-theme-classic/src/theme/Footer/index.js b/packages/docusaurus-theme-classic/src/theme/Footer/index.js
index 1652a3a91157..ea04c719ea96 100644
--- a/packages/docusaurus-theme-classic/src/theme/Footer/index.js
+++ b/packages/docusaurus-theme-classic/src/theme/Footer/index.js
@@ -20,6 +20,10 @@ function Footer() {
themeConfig: {footer},
} = siteConfig;
+ if (!footer) {
+ return null;
+ }
+
const {copyright, links = [], logo} = footer;
return (
@@ -30,15 +34,17 @@ function Footer() {
{links && links.length > 0 && (
- {links.map(linkItem => (
-
+ {links.map((linkItem, i) => (
+
{linkItem.title != null ? (
{linkItem.title}
) : null}
- {linkItem.items != null && linkItem.items.length > 0 ? (
+ {linkItem.items != null &&
+ Array.isArray(linkItem.items) &&
+ linkItem.items.length > 0 ? (
{linkItem.items.map(item => (
- -
+
-
`'${field}'`).join(', ');
}
-function loadConfig(siteDir, deleteCache = true) {
+function loadConfig(siteDir) {
const configPath = path.resolve(siteDir, CONFIG_FILE_NAME);
- if (deleteCache) {
- delete require.cache[configPath];
- }
let loadedConfig = {};
if (fs.existsSync(configPath)) {
- loadedConfig = require(configPath); // eslint-disable-line
+ loadedConfig = importFresh(configPath);
}
const missingFields = REQUIRED_FIELDS.filter(
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index b3e1ed67fa77..0a1b6d23639d 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -52,6 +52,10 @@ module.exports = {
label: 'Feedback',
to: 'feedback',
},
+ {
+ label: 'Discord',
+ href: 'https://discordapp.com/invite/docusaurus',
+ },
],
},
{