diff --git a/theme/config.json b/theme/config.json index 4605a27..bfd895a 100644 --- a/theme/config.json +++ b/theme/config.json @@ -1,6 +1,9 @@ { - "TrackSolved": true, - "Titles": false, + "PuzzleList": { + "TrackSolved": true, + "Titles": false, + "": 0 + }, "Puzzle": { "SyntaxHighlighting": true, "": 0 diff --git a/theme/index.mjs b/theme/index.mjs index e9f80cc..923b020 100644 --- a/theme/index.mjs +++ b/theme/index.mjs @@ -88,7 +88,7 @@ class App { // Update elements with data-track-solved for (let e of document.querySelectorAll("[data-track-solved]")) { // Only display if data-track-solved is the same as config.trackSolved - e.classList.toggle("hidden", common.Truthy(e.dataset.trackSolved) != this.config.TrackSolved) + e.classList.toggle("hidden", common.Truthy(e.dataset.trackSolved) != this.config.PuzzleList?.TrackSolved) } for (let e of document.querySelectorAll(".login")) { @@ -152,10 +152,10 @@ class App { a.href = url a.target = "_blank" - if (this.config.TrackSolved) { + if (this.config.PuzzleList?.TrackSolved) { a.classList.toggle("solved", this.state.IsSolved(puzzle)) } - if (this.config.Titles) { + if (this.config.PuzzleList?.Titles) { this.loadTitle(puzzle, i) } }