Skip to content

Commit

Permalink
Added setting for using full resolution images
Browse files Browse the repository at this point in the history
  • Loading branch information
oleeskild committed Jan 18, 2024
1 parent 1f4150b commit 699e92d
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const DEFAULT_SETTINGS: DigitalGardenSettings = {
baseTheme: "dark",
theme: '{"name": "default", "modes": ["dark"]}',
faviconPath: "",
useFullResolutionImages: false,
noteSettingsIsInitialized: false,
siteName: "Digital Garden",
mainLanguage: "en",
Expand Down
2 changes: 1 addition & 1 deletion manifest-beta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "digitalgarden",
"name": "Digital Garden",
"version": "2.55.1",
"version": "2.56.0",
"minAppVersion": "0.12.0",
"description": "Publish your notes to the web for others to enjoy. For free.",
"author": "Ole Eskild Steensen",
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "digitalgarden",
"name": "Digital Garden",
"version": "2.55.1",
"version": "2.56.0",
"minAppVersion": "0.12.0",
"description": "Publish your notes to the web for others to enjoy. For free.",
"author": "Ole Eskild Steensen",
Expand Down
1 change: 1 addition & 0 deletions scripts/generateGardenSettings.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const gardenSettings = {
baseTheme: "dark",
theme: '{"name": "default", "modes": ["dark"]}',
faviconPath: "",
useFullResolutionImages: false,
noteSettingsIsInitialized: true,
siteName: "Digital Garden",
mainLanguage: "en",
Expand Down
1 change: 1 addition & 0 deletions src/models/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default interface DigitalGardenSettings {
baseTheme: string;
faviconPath: string;
mainLanguage: string;
useFullResolutionImages: boolean;

siteName: string;

Expand Down
1 change: 1 addition & 0 deletions src/repositoryConnection/DigitalGardenSiteManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export default class DigitalGardenSiteManager {
NOTE_ICON_BACK_LINKS: this.settings.showNoteIconOnBackLink,
STYLE_SETTINGS_CSS: this.settings.styleSettingsCss,
STYLE_SETTINGS_BODY_CLASSES: this.settings.styleSettingsBodyClasses,
USE_FULL_RESOLUTION_IMAGES: this.settings.useFullResolutionImages,
} as Record<string, string | boolean>;

if (theme.name !== "default") {
Expand Down
16 changes: 15 additions & 1 deletion src/views/SettingsView/SettingView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ export default class SettingView {
new Setting(themeModal.contentEl)
.setName("Apply current style settings to site")
.setDesc(
"Click the apply button to use the current style settings from the Style Settings Plugin on your site. (The plugin looks at the currently APPLIED settings. Meaning you need to have the theme you want are using in the garden selected in Obsidian before applying)",
"Click the apply button to use the current style settings from the Style Settings Plugin on your site. (The plugin looks at the currently APPLIED settings. Meaning you need to have the theme you are using in the garden selected in Obsidian before applying)",
)
.addButton((btn) => {
btn.setButtonText("Apply Style Settings");
Expand Down Expand Up @@ -559,6 +559,20 @@ export default class SettingView {
new SvgFileSuggest(this.app, tc.inputEl);
});

new Setting(themeModal.contentEl)
.setName("Use full resolution images")
.setDesc(
"By default, the images on your site are compressed to make your site load faster. If you instead want to use the full resolution images, enable this setting.",
)
.addToggle((toggle) => {
toggle.setValue(this.settings.useFullResolutionImages);

toggle.onChange(async (val) => {
this.settings.useFullResolutionImages = val;
await this.saveSettings();
});
});

new Setting(themeModal.contentEl).addButton(handleSaveSettingsButton);

themeModal.contentEl
Expand Down
1 change: 1 addition & 0 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"2.56.0": "0.12.0",
"2.55.1": "0.12.0",
"2.55.0": "0.12.0",
"2.54.1": "0.12.0",
Expand Down

0 comments on commit 699e92d

Please sign in to comment.