Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Option to disable ads #22574

Merged
merged 1 commit into from
Sep 13, 2020

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Sep 12, 2020

Ads are meant to sustain the MIT licensed code. I don't think that it makes sense to keep them for code released under a paid commercial license. This change allows https://github.com/mui-org/material-ui-x to disable ads, where relevant.

Usage example:

diff --git a/docs/pages/components/alert.js b/docs/pages/components/alert.js
index caeeb16f23..54f9f2bec9 100644
--- a/docs/pages/components/alert.js
+++ b/docs/pages/components/alert.js
@@ -11,7 +11,7 @@ const requireRaw = require.context(
 );

 export default function Page({ demos, docs }) {
-  return <MarkdownDocs demos={demos} docs={docs} requireDemo={requireDemo} />;
+  return <MarkdownDocs demos={demos} docs={docs} disableAd requireDemo={requireDemo} />;
 }

 Page.getInitialProps = () => {
diff --git a/docs/src/pages/components/alert/alert.md b/docs/src/pages/components/alert/alert.md
index f77f0250f8..5209e349ae 100644
--- a/docs/src/pages/components/alert/alert.md
+++ b/docs/src/pages/components/alert/alert.md
@@ -18,7 +18,7 @@ waiAria: https://www.w3.org/TR/wai-aria-practices/#alert

 The alert offers four severity levels that set a distinctive icon and color.

-{{"demo": "pages/components/alert/SimpleAlerts.js"}}
+{{"demo": "pages/components/alert/SimpleAlerts.js", "disableAd": true}}

 ## Description

Hopefully, one day, we will be able to kill all the ads.

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Sep 12, 2020
@mui-pr-bot
Copy link

No bundle size changes comparing e4d6eac...2996d22

Generated by 🚫 dangerJS against 2996d22

@oliviertassinari oliviertassinari merged commit 4f502ce into mui:next Sep 13, 2020
@oliviertassinari oliviertassinari deleted the docs-option-hide-ads branch September 13, 2020 09:22
oliviertassinari added a commit that referenced this pull request Sep 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants