Skip to content

Commit 71d84a6

Browse files
authored
Update README.md
1 parent 406fb57 commit 71d84a6

File tree

1 file changed

+17
-24
lines changed

1 file changed

+17
-24
lines changed

README.md

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,29 @@
11
# Kirby JSON Schema
22

3+
[![Kirby 3](https://flat.badgen.net/badge/Kirby/3?color=ECC748)](https://getkirby.com)
4+
[![Kirby 4](https://flat.badgen.net/badge/Kirby/4?color=ECC748)](https://getkirby.com)
5+
[![Kirby 5](https://flat.badgen.net/badge/Kirby/5?color=ECC748)](https://getkirby.com)
36
![Release](https://flat.badgen.net/github/release/bnomei/kirby3-schema?color=ae81ff)
47
![Checks](https://flat.badgen.net//github/checks/bnomei/kirby3-schema)
58
[![Discord](https://flat.badgen.net/badge/discord/bnomei?color=7289da)](https://discordapp.com/users/bnomei)
69

710
JSON Schema file for Kirby blueprints
811

9-
## Commercial Usage
10-
11-
> <br>
12-
> <b>Support open source!</b><br><br>
13-
> This schema file is free but if you use it in a commercial project please consider to sponsor me or make a donation.<br>
14-
> If my work helped you to make some cash it seems fair to me that I might get a little reward as well, right?<br><br>
15-
> Be kind. Share a little. Thanks.<br><br>
16-
> &dash; Bruno<br>
17-
> &nbsp;
18-
19-
| M | O | N | E | Y |
20-
|---|----|---|---|---|
21-
| [Github sponsor](https://github.com/sponsors/bnomei) | [Patreon](https://patreon.com/bnomei) | [Buy Me a Coffee](https://buymeacoff.ee/bnomei) | [Paypal dontation](https://www.paypal.me/bnomei/15) | [Hire me](mailto:[email protected]?subject=Kirby) |
22-
2312
## Install
2413

2514
### Schemastore (not yet)
2615

27-
Ideally the schema of this repo would be available from the [Schemastore](https://www.schemastore.org/json/) and it would be almost zero configuration in most IDEs. But that is something the Kirby CMS team should do eventually, not me.
16+
Ideally, this repo's schema would be available from the [Schemastore](https://www.schemastore.org/json/), and there would be almost zero configuration in most IDEs. But that is something the Kirby CMS team should eventually do, not me.
2817

29-
### Manual IDE configuration
18+
### Download the Schema
3019

31-
#### VSCode
20+
You can clone the entire repo or download the file `kirbyX-blueprints.schema.json`, where `X` matches your intended Kirby version. Put that file inside your project or in a global space of your dev setup. Then configure your IDE to use that file to get Schema information for Kirby's blueprints.
3221

33-
You will need the [Red Hat VS Code YAML Extension](https://github.com/redhat-developer/vscode-yaml) and then you can use the `yaml.schemas` setting to add your schema like this:
22+
## Configure your IDE
23+
24+
### VSCode
25+
26+
You will need the [Red Hat VS Code YAML Extension](https://github.com/redhat-developer/vscode-yaml), and then you can use the `yaml.schemas` setting to add your schema like this:
3427

3528
```yaml
3629
"yaml.schemas": {
@@ -42,20 +35,20 @@ This will automatically use the schema for all blueprint files.
4235

4336
The extension prepends `/` on the path so its `/~/YOUR_FOLDER/kirby3-schema/kirby4-blueprints.schema.json`.
4437

38+
> [!NOTE]
4539
> thanks @tobimori and @iskrisis
4640
47-
#### PHP Storm
48-
49-
Clone this repo to your local machine. Open the IDE settings and search for `JSON Schema`. Then select `Languages & Frameworks` » `Schemas and DTDs` » `JSON Schema Mappings`. Click the `+` button at the top to add a new JSON validate configuration. Then fill in the corresponding name, file or URL, and version.
41+
### PHPStorm
5042

51-
For testing I mapped it to my `site/blueprints` folder.
43+
Clone this repo to your local machine. Open the IDE settings and search for `JSON Schema`. Then select `Languages & Frameworks` » `Schemas and DTDs` » `JSON Schema Mappings`. Click the `+` button at the top to add a new JSON validate configuration. Then, fill in the corresponding name, file or URL, and version.
5244

45+
For testing, I mapped it to my `site/blueprints` folder.
5346

54-
#### Sublime Text
47+
### Sublime Text
5548

5649
You can use the schema in Sublime Text by cloning this repo to your local machine and setting a custom JSON schema location using [this Sublime Text extension]([https://github.com/sublimelsp/LSP-json?tab=readme-ov-file#custom-schemas](https://github.com/sublimelsp/LSP-yaml) and wildcards in `fileMatch` [schema settings](https://github.com/sublimelsp/LSP-yaml/blob/7b928a7b84f25381b01fa98c04ca7b1418b3a465/LSP-yaml.sublime-settings#L37) ([more](https://github.com/sublimelsp/LSP-json?tab=readme-ov-file#custom-schemas)].
5750

58-
### Blueprint detection
51+
## Blueprint detection
5952

6053
Since Kirby reuses some types like `file`, `info`, `pages` in fields and sections the schema can not always determine which blueprint you are working on with absolute certainty. For now, I introduced a `blueprint` property to solve this. Use it in your `file`, `page`, `user` and `site` blueprints.
6154

0 commit comments

Comments
 (0)