mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-30 09:27:04 +02:00
feat(v2): prevent using remote image urls in showcase (#3560)
* prevent using remote image urls in showcase * remove old/duplicate user image self-hosted check * fix unavailable str.startsWith * fix external image check due to ideal-image plugin * fix external image check due to ideal-image plugin
This commit is contained in:
parent
d444ab75ef
commit
a3ab9c116f
3 changed files with 23 additions and 10 deletions
|
@ -5,7 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
module.exports = [
|
||||
const users = [
|
||||
// Please add your logo in alphabetical order of caption.
|
||||
{
|
||||
caption: '1Hive',
|
||||
|
@ -892,3 +892,13 @@ module.exports = [
|
|||
|
||||
// Please add your logo in alphabetical order of caption.
|
||||
];
|
||||
|
||||
users.forEach((user) => {
|
||||
if (!user.image || !user.image.startsWith('/img/users/')) {
|
||||
throw new Error(
|
||||
`Bad user site image = ${user.image}. The image should be hosted on Docusaurus site, in /static/img/users/ folder, and not use remote http or https urls`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = users;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue