├── .editorconfig
├── .github
└── workflows
│ ├── release-version.yml
│ └── release.yml
├── .gitignore
├── LICENSE
├── README.md
├── alternate_checkboxes.png
├── base_color_from_accent.png
├── base_color_from_style_settings.png
├── close_buttons.png
├── consistent_controls.png
├── controls.png
├── hero.png
├── light_and_dark.png
├── manifest.json
├── mobile.png
├── package.json
├── plugin_support.png
├── primary_secondary_colors.png
├── properties_below_content.png
├── screenshot.png
├── theme.css
├── version-bump.mjs
└── versions.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # top-most EditorConfig file
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | end_of_line = lf
7 | insert_final_newline = true
8 | indent_style = spaces
9 | indent_size = 2
10 | tab_width = 2
11 |
--------------------------------------------------------------------------------
/.github/workflows/release-version.yml:
--------------------------------------------------------------------------------
1 | name: Publish new theme version
2 |
3 | on:
4 | push:
5 | # Sequence of patterns matched against refs/tags
6 | tags:
7 | - "*" # Push events to matching any tag format, i.e. 1.0, 20.15.10
8 | workflow_dispatch:
9 |
10 | jobs:
11 | build:
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - uses: actions/checkout@v3
16 | - name: Bundle
17 | id: bundle
18 | run: |
19 | ls
20 | echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)"
21 | - name: Create Release
22 | id: create_release
23 | uses: actions/create-release@v1
24 | env:
25 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 | VERSION: ${{ github.ref }}
27 | with:
28 | tag_name: ${{ github.ref }}
29 | release_name: ${{ github.ref }}
30 | draft: false
31 | prerelease: false
32 | - name: Upload manifest.json
33 | id: upload-manifest
34 | uses: actions/upload-release-asset@v1
35 | env:
36 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 | with:
38 | upload_url: ${{ steps.create_release.outputs.upload_url }}
39 | asset_path: ./manifest.json
40 | asset_name: manifest.json
41 | asset_content_type: application/json
42 | - name: Upload theme.css
43 | id: upload-css
44 | uses: actions/upload-release-asset@v1
45 | env:
46 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47 | with:
48 | upload_url: ${{ steps.create_release.outputs.upload_url }}
49 | asset_path: ./theme.css
50 | asset_name: theme.css
51 | asset_content_type: text/css
52 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release Obsidian theme
2 |
3 | on:
4 | push:
5 | tags:
6 | - "*"
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - uses: actions/checkout@v3
14 |
15 | - name: Create release
16 | env:
17 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 | run: |
19 | tag="${GITHUB_REF#refs/tags/}"
20 |
21 | gh release create "$tag" \
22 | --title="$tag" \
23 | --generate-notes \
24 | --draft \
25 | manifest.json theme.css
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # vscode
2 | .vscode
3 | *.code-workspace
4 |
5 | # Intellij
6 | *.iml
7 | .idea
8 |
9 | # npm
10 | node_modules
11 |
12 | # Exclude sourcemaps
13 | *.map
14 |
15 | # Exclude macOS Finder (System Explorer) View States
16 | .DS_Store
17 |
18 | dev/*
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Isaac Freeman
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Kakano
2 |
3 | 
4 |
5 | Kakano is an [Obsidian](https://obsidian.md/) theme with a smooth gradient background derived from a user-selected base color.
6 |
7 |
12 |
13 |
14 | - [Kakano](#kakano)
15 | - [Getting started](#getting-started)
16 | - [Principles](#principles)
17 | - [Features](#features)
18 | - [Choose a base color](#choose-a-base-color)
19 | - [Light mode, dark mode, and mobile](#light-mode-dark-mode-and-mobile)
20 | - [Standardised controls](#standardised-controls)
21 | - [Properties below content](#properties-below-content)
22 | - [Follows OS standards by default](#follows-os-standards-by-default)
23 | - [Selected alternate checkboxes](#selected-alternate-checkboxes)
24 | - [Supports core plugins](#supports-core-plugins)
25 | - [And so much more](#and-so-much-more)
26 | - [Settings](#settings)
27 | - [Base color](#base-color)
28 | - [Background](#background)
29 | - [Notes](#notes)
30 | - [Typography settings](#typography-settings)
31 | - [Editing settings](#editing-settings)
32 | - [Mobile settings](#mobile-settings)
33 | - [Compatibility](#compatibility)
34 | - [Helper Classes](#helper-classes)
35 | - [Plugin support](#plugin-support)
36 | - [Core Plugins supported](#core-plugins-supported)
37 | - [Community Plugins supported](#community-plugins-supported)
38 | - [Roadmap](#roadmap)
39 | - [About](#about)
40 | - [Credits](#credits)
41 | - [License](#license)
42 | - [Disclaimer](#disclaimer)
43 |
44 | ## Getting started
45 |
46 | 1. Install the Kakano theme
47 | [Open directly in Obsidian](obsidian://show-theme?name=Kakano) or open Obsidian settings and navigate to `Appearance`, then `Manage` and type "Kakano" into the `FIlter...` field. Click on `Install and use`.
48 | 2. (Recommended, but optional) Install the [Style Settings plugin](https://github.com/mgmeyers/obsidian-style-settings)
49 | This will give you access to some additional theme settings.
50 | 3. Set your vault's base color
51 | - If you're not using Style Settings, navigate to `Appearance` in the Obsidian settings, and use the `Accent color` control.
52 | - If you're using Style Settings, navigate to `Style Settings` in the Obsidian settings and open the `Kakano` section. Use the `Base color` control.
53 |
54 | > [!info]
55 | > I use Kakano with Obsidian settings that defer to OS standards:
56 | > - Obsidian settings -> `Appearance` -> `Native menus`
57 | > - Obsidian settings -> `Appearance` -> `Window frame style` -> `Native frame`
58 | > I've aimed to also have it look good with other settings, but I've given more attention to this OS-native configuration.
59 |
60 | ## Principles
61 |
62 | - **Strong color**
63 | Users should be able to easily select a color for each vault and have the theme generate shades and gradients automatically.
64 | - **Help new users**
65 | Obsidian can be intimidating for new users. I think a good way to help with this is to clarify which parts of the window are user content (white background, strong contrast) and which are navigation and other controls (colored background, lower contrast).
66 | - **Standardise controls**
67 | Obsidian’s exuberant plugin scene is fantastic, but it also means that there’s a lot of inconsistency in the design of controls and modals – even between core plugins. I’ve tried to find ways to make similar controls have similar appearance. Likewise, I’ve aimed to follow conventions from the underlying OS, such as having close controls on the left on macOS.
68 | - **Be opinionated enough**
69 | I’d like Kakano to provide a great user experience by default without the user having to make any choices beyond their base color. It has settings, but I want each one to be there because different users genuinely have different needs, not just because I failed to make a decision.
70 |
71 | ## Features
72 |
73 | ### Choose a base color
74 | 
75 | 
76 |
77 | Kakano starts with a user-selected base color, and generates lighter and darker versions for a cohesive overall user interface with smooth gradient backgrounds. If you reguarly use multiple vaults, set a different accent color for each to make them easy to tell apart at a glance. With Obsidian controls placed on a colored background, there's a clear visual distinction between your content and the tool you use to manage it.
78 |
79 | > [!info]
80 | > I use a work vault with a company brand color, and a separate green vault for my own personal notes.
81 |
82 | - With core plugins, the base color will be your accent color.
83 | - If the [Style Settings](https://github.com/mgmeyers/obsidian-style-settings) plugin is installed, it provides a separate Kakano base color setting, so you can have one color for your overall theme, and keep the accent color for links and tags.
84 | - With [Style Settings](https://github.com/mgmeyers/obsidian-style-settings), there's also an option to change the level of contrast in background gradients. Set it to zero for a completely flat background color, or stronger for more dynamic range.
85 |
86 | ### Light mode, dark mode, and mobile
87 | 
88 | 
89 | Supports light mode and dark mode with the same base color, on desktop and mobile.
90 |
91 | - With [Style Settings](https://github.com/mgmeyers/obsidian-style-settings), choose whether the note background is near black or full black.
92 |
93 | ### Standardised controls
94 | 
95 | The appearance of buttons, switches, form fields and other controls is standardised across different modules, so the user interface looks and behaves consistently.
96 |
97 | ### Properties below content
98 | 
100 | Some people pay a lot of attention to propertioes on their notes, others use them occasionally. If you want them around but not in the way, Kakano let syou place them below your main note content. Currently this only works for Live Preview mode.
101 |
102 | ### Follows OS standards by default
103 | 
104 | - On macOS, close buttons appear at the left of tabs and modals, as standard.
105 | - Kakano uses system fonts by default to be consistent with other apps. It respects user font choices if you prefer something else.
106 |
107 | ### Selected alternate checkboxes
108 | 
109 | Kakano doesn't try to support a huge range of specialised alternate checkbox marks, but focuses on the ones that are most useful in practice:
110 | `- [/]` for "partially done"
111 | `- [<]` for "scheduling"
112 | `- [-]` for "cancelled"
113 | `- [>]` for "forwarded"
114 | `- [!]` for "important"
115 | `- [?]` for "question"
116 |
117 | ### Supports core plugins
118 | 
119 | Kakano styles all the core Obsidian plugins.[^1]
120 |
121 | [^1]: OK, almost all of them. I have a couple left to finish.
122 |
123 | ### And so much more
124 | Kakano includes a lot of little details. Some notable examples are:
125 | - Large modals are resizeable. If you change settings that affect the user itnerface, you can often resize the setting smodal to see the effects without closing it.
126 | - When audio recording is active, the ribbon icon changes to a `REC` indicator with a pulsing red outline.
127 |
128 | ## Settings
129 | If the [Style Settings](https://github.com/mgmeyers/obsidian-style-settings) plugin is installed, Kakano offers the following settings.
130 | ### Base color
131 | Sets a base color that will be used by Kakano independently of the accent color. This allows you to use one color for Kakano, and a separate color for accents in your notes.
132 | - **Preset Base color**
133 | Select from one of the preset base color options
134 | - **Exact base color**
135 | Use a color requester to select an exact color. This is good if you want to match your organisation's branding, or you just know the precise color you want.
136 | ### Background
137 | - **Background gradient contrast**
138 | Adjusts the background gradient from a flat color to a strong difference between top and bottom.
139 | - **Custom Gradient**
140 | Kakano normally provides a smooth gradient background using the same hue as the base color. This setting overrides that so you can have a gradient with different hues top and bottom.
141 | - **Full width status bar**
142 | Kakano moves the status bad below the main content, which looks fine provided you don't have too many items there. If it gets too wide it overlaps with the sidebars, so this setting makes space for it use the full width of the window.
143 | ### Notes
144 | - **Note backgrounds (light and dark modes)**
145 | The background for notes in dark mode can be either full black (nice on OLED screens) or near-black (easier on the eye).
146 | - **Distinguish non-editable tabs**
147 | Use a different color for inactive tabs when they're not directly editable by the user (e.g. tabs with graphs, maps, calendar)
148 | - **Properties position**
149 | In Live Preview mode, properties can be positioned before (default) or after the main note content. If you rarely use properties, you may prefer to make them less prominent.
150 | _This setting only works for Live Preview mode. Reading mode doesn't provide suitable HTML structure to support it, and Source Mode makes properties editable within the main content area.
151 | - **Embedded note titles**
152 | WHen a note is embedded in another note, the title can be shown, hidden, or shown only on hover.
153 | - **Embedded links scroll position**
154 | EXPERIMENTAL Embedded links can be pinned to stay on screen as a note scrolls.
155 | ### Typography settings
156 | - **Heading scale factors**
157 | Rather than specify a size for every heading level independently, Kakano provides eight scale factor options that adjust the relative sizes of all heading levels together. If you like dramatic headings, the highest scale factor provides H1 headings 11 times the size of the body text, with other headings sized harmoniously in between. If you want to conserve space, the lowest setting makes H1 headings just 1.38 times the size of body text: the headings are still differentiated by size, but the ratio is smaller.
158 | There's a separate scale factor for phones, where space is at a premium.
159 | - **Style nested bullet levels differently**
160 | Show different bullets for different levels of nesting.
161 | - **Line length**
162 | Specify the line length in characters when Obsidian's Readable Line Length setting is enabled.
163 | Separate settings for editing and reading views.
164 | ### Editing settings
165 | - **Highlight active line**
166 | Show a background color behind the active line while editing.
167 | - **Line number sin code blocks**
168 | Toggle whether code blocks should show line numbers
169 | ### Mobile settings
170 | - **Mobile horizontal spacing**
171 | On mobile screens where space is at a premium, there's the option to show some of the background color on each side, or to have the note go to full width.
172 | - **Mobile cards UI**
173 | EXPERIMENTAL Work in progress to provide a 3D effect on mobile, with prompts and modals appearing to push the main content back when they appear in front. I'm not sure yet whether the HTML structure of Obsidian will allow me to apply this consistently, but it looks cool in the places I've tried it.
174 | ### Compatibility
175 | - **Enable built-in alternative checkboxes**
176 | Kakano has built-in styles for alternative checkboxes, but some users may prefer to use their own CSS snippets that work across multiple themes. This setting can disable the built-in alternative checkboxes to ensure that they don't clash with the snippet.
177 |
178 | ## Helper Classes
179 | Kakano provides heklper classes to modify notes
180 | | Helper class | Description |
181 | |---|---|
182 | | `cards` | Make tables generated by the Dataview plugin to appear as a set of cards. |
183 | | `list-cards` | Make bullet lists appear as a set of cards when the note is in Reading view |
184 |
185 |
186 | ## Plugin support
187 | Kakano has specific styling for the following plugins:
188 |
189 | ### Core Plugins supported
190 | - Audio recorder
191 | - Backlinks
192 | - Bookmarks
193 | - Canvas
194 | - Command Palette
195 | - Files
196 | - File Recovery
197 | - Format converter
198 | - Graph view
199 | - Note composer
200 | - Outgoing Links
201 | - Outline
202 | - Page Preview
203 | - Properties view
204 | - Quick switcher
205 | - Random note
206 | - Search
207 | - Slash commands
208 | - Slides
209 | - Sync
210 | - Tags view
211 | - Templates
212 | - Unique note creator
213 | - Word count
214 | - Workspaces
215 |
216 | ### Community Plugins supported
217 | - Advanced Tables
218 | - Calendar
219 | - Clear unused images
220 | - Columns
221 | - Dataview
222 | - Folder Note
223 | - Jira Issue
224 | - Kanban
225 | - Map View
226 | - Natural Language Dates
227 | - Recent files
228 | - Style settings
229 | - Table Editor
230 | - Tasks
231 |
232 | ## Roadmap
233 |
234 | Kakano is a one-person hobby. I'm having a great time exploring what Obsidian can do, and how far CSS has come in recent years. I want to sweat the details and apply good usability practices, but it's also something I'm doing for fun. Sometimes I'll change things on a whim, or focus on obscure areas of the UI because they present interesting challenges.
235 |
236 | There are, however, some key areas I want to improve:
237 |
238 | 1. Support for all the core plugins. I still need to work on Publish, as I don't use it personally.
239 | 2. Support for the most popular community plugins. Currently I'm aiming at the ones with over 500K downloads.
240 | 3. Dark mode. At the moment it's mostly just an inverse of light mode, but I'd like to give it specific attention.
241 | 4. Mobile.
242 | 5. Support widely-used features from other themes. I'd like to be easy to switch to and from Kakano.
243 |
244 | ## About
245 | I'm Isaac Freeman, a software developer in Aotearoa/New Zealand. I love to explore usability and design.
246 |
247 | - [Personal site](https://isaac.freeman.org.nz)
248 | - [Github profile](https://github.com/isaacfreeman)
249 | - [Mastodon](https://cloudisland.nz/@isaacfreeman)
250 | - [Email](mailto:isaac@freeman.org.nz)
251 |
252 | _Kakano_ means "color" in the Te Reo Māori – the Māori language of New Zealand.
253 |
254 | ## Credits
255 | - [Damian Korcz](https://github.com/damiankorcz) started the [Alternative Checkboxes Reference Set project](https://github.com/damiankorcz/Alternative-Checkboxes-Reference-Set).
256 | - [incantatem1](https://github.com/incantatem1) suggested a separate line length for Reading View.
257 | - [Ryan Johnson](linkedin.com/in/rydavjohnson) suggested the setting to hide titles for embedded notes, and the ability to pin embdded backlinks.
258 | - [WinnerWind](https://winnerwind.github.io) suggested the Mobile horizontal spacing setting, and assisted with debugging for Windows.
259 | - The [AnuPpuccin](https://github.com/AnubisNekhet/AnuPpuccin) theme by [Anubis](https://github.com/AnubisNekhet) provided the idea of adding icons to sections in Style Settings.
260 | - The [MagicUser](https://github.com/drbap/magicuser-theme-for-obsidian) theme by [Bernardo Pires](https://github.com/drbap) provided the idea of making selected modals resizeable.
261 | - The [Minimal](https://github.com/kepano/obsidian-minimal) theme by [Kepano](https://github.com/kepano) provided the idea of a card layout for the Dataview Plugin. I've also used a consistent card layout appearance for the Folder Note plugin.
262 |
263 | ## License
264 | Kakano is licensed under the MIT License which allows you to modify and redistribute the code, however you must preserve the copyright and license notice in your CSS file. This includes any code you may extract as standalone snippets.
265 |
266 | ## Disclaimer
267 | Kakano theme is provided as is, as a one-person hobby project I work on in my spare time. I use it on macOS and iOS, and it's not tested on other platforms. I always appreciate bug reports and suggestions, and I'll endeavour to fix problems as I hear of them, and as time permits.
268 |
269 | There are great themes for Obsidian that provide detailed settings for many aspects of the user interface, but the path I'm taking here is to reduce the number of choices users need to make. I enjoy and appreciate feedback and suggestions from users, but I may decide that some good ideas aren't Kakano ideas.
270 |
271 | Some of the choices I've made in Kakano may not be compatible with future updates to Obsidian, nor with custom CSS snippets. I'm aiming to keep it up to date but again, no promises.
272 |
--------------------------------------------------------------------------------
/alternate_checkboxes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isaacfreeman/kakano-obsidian-theme/cb6b3421c03bbd7cade55a0125c6501cb4c5e078/alternate_checkboxes.png
--------------------------------------------------------------------------------
/base_color_from_accent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isaacfreeman/kakano-obsidian-theme/cb6b3421c03bbd7cade55a0125c6501cb4c5e078/base_color_from_accent.png
--------------------------------------------------------------------------------
/base_color_from_style_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isaacfreeman/kakano-obsidian-theme/cb6b3421c03bbd7cade55a0125c6501cb4c5e078/base_color_from_style_settings.png
--------------------------------------------------------------------------------
/close_buttons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isaacfreeman/kakano-obsidian-theme/cb6b3421c03bbd7cade55a0125c6501cb4c5e078/close_buttons.png
--------------------------------------------------------------------------------
/consistent_controls.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isaacfreeman/kakano-obsidian-theme/cb6b3421c03bbd7cade55a0125c6501cb4c5e078/consistent_controls.png
--------------------------------------------------------------------------------
/controls.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isaacfreeman/kakano-obsidian-theme/cb6b3421c03bbd7cade55a0125c6501cb4c5e078/controls.png
--------------------------------------------------------------------------------
/hero.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isaacfreeman/kakano-obsidian-theme/cb6b3421c03bbd7cade55a0125c6501cb4c5e078/hero.png
--------------------------------------------------------------------------------
/light_and_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isaacfreeman/kakano-obsidian-theme/cb6b3421c03bbd7cade55a0125c6501cb4c5e078/light_and_dark.png
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Kakano",
3 | "version": "6.0.0",
4 | "minAppVersion": "1.9.0",
5 | "author": "Isaac Freeman",
6 | "authorUrl": "https://isaac.freeman.org.nz"
7 | }
--------------------------------------------------------------------------------
/mobile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isaacfreeman/kakano-obsidian-theme/cb6b3421c03bbd7cade55a0125c6501cb4c5e078/mobile.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "kakano-obsidian-theme",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "version": "node version-bump.mjs && git add manifest.json versions.json"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/plugin_support.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isaacfreeman/kakano-obsidian-theme/cb6b3421c03bbd7cade55a0125c6501cb4c5e078/plugin_support.png
--------------------------------------------------------------------------------
/primary_secondary_colors.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isaacfreeman/kakano-obsidian-theme/cb6b3421c03bbd7cade55a0125c6501cb4c5e078/primary_secondary_colors.png
--------------------------------------------------------------------------------
/properties_below_content.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isaacfreeman/kakano-obsidian-theme/cb6b3421c03bbd7cade55a0125c6501cb4c5e078/properties_below_content.png
--------------------------------------------------------------------------------
/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isaacfreeman/kakano-obsidian-theme/cb6b3421c03bbd7cade55a0125c6501cb4c5e078/screenshot.png
--------------------------------------------------------------------------------
/version-bump.mjs:
--------------------------------------------------------------------------------
1 | /**
2 | * This script makes it slightly easier to release new versions of your
3 | * theme. If you are not using Github Releases with your theme, or
4 | * you are not interested in automating the process, you can safely ignore
5 | * this script.
6 | *
7 | * Usage: `$ npm run version`
8 | *
9 | * This script will automatically add a new entry to the versions.json file for
10 | * the current version of your theme.
11 | */
12 |
13 | import { readFileSync, writeFileSync } from "fs";
14 |
15 | const targetVersion = process.env.npm_package_version;
16 |
17 | // read minAppVersion from manifest.json and bump version to target version
18 | let manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
19 | const { minAppVersion } = manifest;
20 | manifest.version = targetVersion;
21 | writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t"));
22 |
23 | // update versions.json with target version and minAppVersion from manifest.json
24 | let versions = JSON.parse(readFileSync("versions.json", "utf8"));
25 | versions[targetVersion] = minAppVersion;
26 | writeFileSync("versions.json", JSON.stringify(versions, null, "\t"));
27 |
--------------------------------------------------------------------------------
/versions.json:
--------------------------------------------------------------------------------
1 | {
2 | "1.11.0": "1.1.0",
3 | "2.20.2": "1.5.0",
4 | "3.2.0": "1.6.0",
5 | "4.7.1": "1.7.0",
6 | "5.1.2": "1.8.0",
7 | "6.0.0": "1.9.0"
8 | }
--------------------------------------------------------------------------------