Skip to content

Commit be5cecc

Browse files
authored
Merge pull request #2422 from SgiobairOg/1074-make-language-specific-favicon-optional
[1074] Make Language Specific Favicon Optional
2 parents 1c07f17 + 5add0f9 commit be5cecc

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ docker run --name devdocs -d -p 9292:9292 devdocs
4646

4747
DevDocs is made of two pieces: a Ruby scraper that generates the documentation and metadata, and a JavaScript app powered by a small Sinatra app.
4848

49-
DevDocs requires Ruby 3.3.0 (defined in [`Gemfile`](./Gemfile)), libcurl, and a JavaScript runtime supported by [ExecJS](https://github.com/rails/execjs#readme) (included in OS X and Windows; [Node.js](https://nodejs.org/en/) on Linux). Once you have these installed, run the following commands:
49+
DevDocs requires Ruby 3.4.1 (defined in [`Gemfile`](./Gemfile)), libcurl, and a JavaScript runtime supported by [ExecJS](https://github.com/rails/execjs#readme) (included in OS X and Windows; [Node.js](https://nodejs.org/en/) on Linux). Once you have these installed, run the following commands:
5050

5151
```sh
5252
git clone https://github.com/freeCodeCamp/devdocs.git && cd devdocs

assets/javascripts/app/settings.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ app.Settings = class Settings {
1616
"autoInstall",
1717
"spaceScroll",
1818
"spaceTimeout",
19+
"noDocSpecificIcon",
1920
];
2021

2122
static INTERNAL_KEYS = ["count", "schema", "version", "news"];
@@ -38,6 +39,7 @@ app.Settings = class Settings {
3839
theme: "auto",
3940
spaceScroll: 1,
4041
spaceTimeout: 0.5,
42+
noDocSpecificIcon: false,
4143
};
4244

4345
constructor() {

assets/javascripts/lib/favicon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const withImage = function (url, action) {
1919
};
2020

2121
this.setFaviconForDoc = function (doc) {
22-
if (currentSlug === doc.slug) {
22+
if (currentSlug === doc.slug || app.settings.get("noDocSpecificIcon")) {
2323
return;
2424
}
2525

assets/javascripts/templates/pages/settings_tmpl.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ app.templates.settingsPage = (settings) => `\
6666
}>Enable tracking cookies
6767
<small>With this checked, we enable Google Analytics and Gauges to collect anonymous traffic information.</small>
6868
</label>
69+
<label class="_settings-label _hide-on-mobile">
70+
<input type="checkbox" form="settings" name="noDocSpecificIcon"${
71+
settings.noDocSpecificIcon ? " checked" : ""
72+
}>Disable Language-specific Doc Favicons
73+
<small>With this checked, we will display the default DevDocs icon for all pages.</small>
74+
</label>
6975
</div>
7076
</div>
7177

assets/javascripts/views/content/settings_page.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ app.views.SettingsPage = class SettingsPage extends app.View {
2020
settings.analyticsConsent = app.settings.get("analyticsConsent");
2121
settings.spaceScroll = app.settings.get("spaceScroll");
2222
settings.spaceTimeout = app.settings.get("spaceTimeout");
23+
settings.noDocSpecificIcon = app.settings.get("noDocSpecificIcon");
2324
settings.autoSupported = app.settings.autoSupported;
2425
for (var layout of app.Settings.LAYOUTS) {
2526
settings[layout] = app.settings.hasLayout(layout);

0 commit comments

Comments
 (0)