From 689d200e9945a60c05028bd0fd42fbfdf9a6d0e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aar=C3=B3n=20Garc=C3=ADa=20Herv=C3=A1s?= Date: Wed, 25 Nov 2020 12:46:24 +0100 Subject: [PATCH] Allow alt for footer logo to be empty --- .../src/__tests__/validateThemeConfig.test.js | 20 +++++++++++++++++++ .../src/validateThemeConfig.js | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-theme-classic/src/__tests__/validateThemeConfig.test.js b/packages/docusaurus-theme-classic/src/__tests__/validateThemeConfig.test.js index c04f9097045b..7d090c9c6059 100644 --- a/packages/docusaurus-theme-classic/src/__tests__/validateThemeConfig.test.js +++ b/packages/docusaurus-theme-classic/src/__tests__/validateThemeConfig.test.js @@ -198,6 +198,26 @@ describe('themeConfig', () => { }); }); + test('should allow empty alt tags for the logo image in the footer', () => { + const partialConfig = { + footer: { + logo: { + alt: '', + src: '/arbitrary-logo.png', + }, + }, + }; + const normalizedConfig = testValidateThemeConfig(partialConfig); + + expect(normalizedConfig).toEqual({ + ...normalizedConfig, + footer: { + ...normalizedConfig.footer, + ...partialConfig.footer, + }, + }); + }); + test('should accept valid prism config', () => { const prismConfig = { prism: { diff --git a/packages/docusaurus-theme-classic/src/validateThemeConfig.js b/packages/docusaurus-theme-classic/src/validateThemeConfig.js index 729c83c9a498..03f5c8dd332c 100644 --- a/packages/docusaurus-theme-classic/src/validateThemeConfig.js +++ b/packages/docusaurus-theme-classic/src/validateThemeConfig.js @@ -254,7 +254,7 @@ const ThemeConfigSchema = Joi.object({ footer: Joi.object({ style: Joi.string().equal('dark', 'light').default('light'), logo: Joi.object({ - alt: Joi.string(), + alt: Joi.string().allow(''), src: Joi.string(), href: Joi.string(), }),