Skip to content

Commit

Permalink
gestion retour au thème par défaut
Browse files Browse the repository at this point in the history
  • Loading branch information
eyssette committed Jul 22, 2024
1 parent d9018a7 commit 9d6ebcd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,19 @@
$: if ($markdownSource.split("---").length > 2) {
try {
yamlData = yaml.load($markdownSource.split("---")[1]);
maxWidthFromYAML = yamlData.hasOwnProperty('maxWidth') ? yamlData.maxWidth : 500;
style = yamlData.hasOwnProperty('style') ? yamlData.style : '';
colorFreezeLevel = yamlData.hasOwnProperty('colorFreezeLevel') ? yamlData.colorFreezeLevel : 0;
initialExpandLevel = yamlData.hasOwnProperty('initialExpandLevel') ? yamlData.initialExpandLevel : -1;
openLinksInNewTab = yamlData.hasOwnProperty('openLinksInNewTab') ? yamlData.openLinksInNewTab : false;
theme = yamlData.hasOwnProperty('theme') ? yamlData.theme : '';
if(theme == 'focus') {
maxWidthFromYAML = yamlData.hasOwnProperty('maxWidth') ? yamlData.maxWidth : 250;
initialExpandLevel = yamlData.hasOwnProperty('initialExpandLevel') ? yamlData.initialExpandLevel : 2;
colorFreezeLevel = yamlData.hasOwnProperty('colorFreezeLevel') ? yamlData.colorFreezeLevel : 2;
style = style + ' ' + focusStyle;
} else {
maxWidthFromYAML = yamlData.hasOwnProperty('maxWidth') ? yamlData.maxWidth : 500;
initialExpandLevel = yamlData.hasOwnProperty('initialExpandLevel') ? yamlData.initialExpandLevel : -1;
colorFreezeLevel = yamlData.hasOwnProperty('colorFreezeLevel') ? yamlData.colorFreezeLevel : 0;
style = style;
}
} catch (e) {
Expand Down

0 comments on commit 9d6ebcd

Please sign in to comment.