Skip to content

Commit 37816d8

Browse files
authored
Add index.html to GitHub Pages website (SchemaStore#4757)
1 parent ec4d381 commit 37816d8

File tree

1 file changed

+213
-0
lines changed

1 file changed

+213
-0
lines changed

cli.js

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,219 @@ async function taskBuildWebsite() {
934934
})
935935
}),
936936
)
937+
938+
const pageTitle = 'JSON Schema Store'
939+
const pageDescription = 'JSON Schemas for common JSON file formats'
940+
const body = `<article id="schemalist">
941+
<h3 id="count">JSON Schemas are available for the following {0} files:</h3>
942+
943+
<input type="search" placeholder="Search schemas" id="search" />
944+
<ul id="schemas" class="columns" role="directory" data-api="/api/json/catalog.json"></ul>
945+
</article>
946+
947+
<article>
948+
<h3 id="auto-completion">Auto completion</h3>
949+
<p>
950+
<img src="/img/autocomplete.png" width="354" height="171" alt="JSON schema auto completion" class="left" />
951+
In supported JSON editors like Visual Studio and Visual Studio Code,
952+
schema files can offer auto-completion and validation to make sure your JSON document is correct.
953+
</p>
954+
955+
<p>
956+
See <a href="https://json-schema.org/tools">a list</a>
957+
of editors, validators and other software supporting JSON schemas.
958+
</p>
959+
</article>
960+
961+
<article>
962+
<h3 id="tooltips">Tooltips</h3>
963+
<p>
964+
<img src="/img/tooltip.png" width="411" height="98" alt="JSON schema tooltip" class="right" />
965+
When a JSON editor supports schemas, tooltips can help inform the user
966+
about the various properties and values.
967+
</p>
968+
</article>
969+
970+
<article>
971+
<h3 id="api">Public API</h3>
972+
<p>
973+
<img src="/img/api.png" width="256" height="88" alt="Public API for JSON Schemas" class="left" />
974+
The JSON <a href="~/api/json/catalog.json">API</a> contains a list of JSON Schema files for known JSON file formats.
975+
Each schema file can be used in tooling such as command line validators, editor auto-completion etc.
976+
</p>
977+
<p>
978+
The API exposes metadata about each schema in the following format:
979+
</p>
980+
<pre>
981+
{
982+
"name": "bower.json",
983+
"description": "Bower package description file",
984+
"fileMatch": [ "bower.json", ".bower.json" ],
985+
"url": "https://json.schemastore.org/bower.json"
986+
}
987+
</pre>
988+
<p>
989+
<code>name</code>, <code>description</code> and <code>url</code> are all required properties.
990+
<br />
991+
The <code>url</code> property is an absolute URI pointing to the schema.
992+
It can be hosted anywhere on the web.
993+
<br />
994+
The <code>fileMatch</code> property is for specifying what known file names corresponds with
995+
the schema. This property is optional since not all JSON formats enforce a specific file name.
996+
</p>
997+
</article>
998+
999+
<article>
1000+
<h3 id="editors">Supporting editors</h3>
1001+
<p>
1002+
Various editors and IDEs have direct support for schemas hosted on SchemaStore.org.
1003+
</p>
1004+
1005+
<ul id="editorlist" class="columns">
1006+
<li>Android Studio</li>
1007+
<li>CLion</li>
1008+
<li>Emacs via <a href="https://github.com/joaotavora/eglot" target="_blank">eglot</a></li>
1009+
<li>IntelliJ IDEA</li>
1010+
<li>JSONBuddy</li>
1011+
<li>Neovim via <a href="https://github.com/b0o/SchemaStore.nvim" target="_blank">SchemaStore.nvim</a></li>
1012+
<li>PhpStorm</li>
1013+
<li>PyCharm</li>
1014+
<li>ReSharper</li>
1015+
<li>Rider</li>
1016+
<li>RubyMine</li>
1017+
<li>SublimeText via <a href="https://packagecontrol.io/packages/LSP-json" target="_blank">LSP-json</a>,<a href="https://packagecontrol.io/packages/LSP-yaml" target="_blank">LSP-yaml</a></li>
1018+
<li>Visual Studio</li>
1019+
<li>Visual Studio Code (<a href="https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml" target="_blank">YAML</a>,<a href="https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml" target="_blank">TOML</a>,<a href="https://marketplace.visualstudio.com/items?itemName=remcohaszing.schemastore" target="_blank">JSON</a>)</li>
1020+
<li>Visual Studio for Mac</li>
1021+
<li>WebStorm</li>
1022+
</ul>
1023+
1024+
<p>Any schema on SchemaStore.org will automatically be synchronized to the supporting editors.</p>
1025+
</article>
1026+
1027+
<article>
1028+
<h3 id="sponsor">Sponsorships <span style="color:mediumvioletred">♡</span></h3>
1029+
<p>
1030+
<img src="/img/sponsor.png" width="160" height="192" alt="Sponsor SchemaStore.org now" class="right" />
1031+
Over 1 TB of JSON Schema files are served each day from SchemaStore.org. It's a big effort to maintain
1032+
and keep running, and it's all done by JSON Schema loving volunteers.
1033+
1034+
If your business gets value from SchemaStore.org, please consider sponsoring to keep the project alive and healthy.
1035+
</p>
1036+
1037+
<p>Premium sponsors:</p>
1038+
1039+
<ul>
1040+
<li><strong>Microsoft</strong></li>
1041+
<li><strong>JetBrains</strong></li>
1042+
<li>Your business?</li>
1043+
</ul>
1044+
1045+
<p>
1046+
Do you build IDEs or editors that integrate with SchemaStore.org, or host a schema for your paying customers, consider a sponsorship.
1047+
</p>
1048+
1049+
<p><a href="https://github.com/sponsors/madskristensen">SchemaStore.org sponsorships <span style="color:mediumvioletred">♡</span></a></p>
1050+
</article>
1051+
1052+
<article>
1053+
<h3 id="ci">Supporting Continuous Integration tools</h3>
1054+
<p>
1055+
CI/CD applications can detect all JSON and YAML files and validate them if a matching schema is found on SchemaStore.org
1056+
</p>
1057+
1058+
<ul>
1059+
<li><a href="https://megalinter.github.io" target="_blank">MegaLinter</a></li>
1060+
</ul>
1061+
</article>
1062+
1063+
<article>
1064+
<h3 id="contribute">Contribute</h3>
1065+
<p>
1066+
<img src="/img/octocat.png" width="250" height="208" alt="Hosted on GitHub" class="left" />
1067+
The goal of this API is to include schemas for all commonly
1068+
known JSON file formats. To do that we encourage contributions in terms of new schemas,
1069+
modifications and test files.
1070+
</p>
1071+
1072+
<p>
1073+
SchemaStore.org is owned by the community, and we have a history of accepting most pull requests.
1074+
Even if you're new to JSON Schemas, please submit new schemas anyway. We have many contributors that
1075+
will help turn the schemas into perfection.
1076+
</p>
1077+
</article>`
1078+
1079+
await fs.writeFile(
1080+
'./website/index.html',
1081+
`<!DOCTYPE html>
1082+
<html>
1083+
<head prefix="og: http://ogp.me/ns#">
1084+
<title>${pageTitle}</title>
1085+
1086+
<base href="https://www.schemastore.org/" />
1087+
<meta charset="utf-8" />
1088+
<meta name="description" content="${pageDescription}" />
1089+
<meta name="viewport" content="initial-scale=1.0" />
1090+
1091+
<link href="/css/site.css" rel="stylesheet" />
1092+
1093+
<link rel="apple-touch-icon" sizes="57x57" href="/img/favicon/apple-touch-icon-57x57.png" />
1094+
<link rel="apple-touch-icon" sizes="114x114" href="/img/favicon/apple-touch-icon-114x114.png" />
1095+
<link rel="apple-touch-icon" sizes="72x72" href="/img/favicon/apple-touch-icon-72x72.png" />
1096+
<link rel="apple-touch-icon" sizes="144x144" href="/img/favicon/apple-touch-icon-144x144.png" />
1097+
<link rel="apple-touch-icon" sizes="60x60" href="/img/favicon/apple-touch-icon-60x60.png" />
1098+
<link rel="apple-touch-icon" sizes="120x120" href="/img/favicon/apple-touch-icon-120x120.png" />
1099+
<link rel="apple-touch-icon" sizes="76x76" href="/img/favicon/apple-touch-icon-76x76.png" />
1100+
<link rel="apple-touch-icon" sizes="152x152" href="/img/favicon/apple-touch-icon-152x152.png" />
1101+
<link rel="apple-touch-icon" sizes="180x180" href="/img/favicon/apple-touch-icon-180x180.png" />
1102+
1103+
<link rel="icon" type="image/png" href="/img/favicon/favicon-192x192.png" sizes="192x192" />
1104+
<link rel="icon" type="image/png" href="/img/favicon/favicon-160x160.png" sizes="160x160" />
1105+
<link rel="icon" type="image/png" href="/img/favicon/favicon-96x96.png" sizes="96x96" />
1106+
<link rel="icon" type="image/png" href="/img/favicon/favicon-16x16.png" sizes="16x16" />
1107+
<link rel="icon" type="image/png" href="/img/favicon/favicon-32x32.png" sizes="32x32" />
1108+
1109+
<meta name="msapplication-TileColor" content="#da532c" />
1110+
<meta name="msapplication-TileImage" content="/img/favicon/mstile-144x144.png" />
1111+
<meta name="msapplication-config" content="/img/favicon/browserconfig.xml" />
1112+
1113+
<meta name="twitter:card" content="summary" />
1114+
<meta name="twitter:title" content="${pageTitle}" />
1115+
<meta name="twitter:description" content="${pageDescription}" />
1116+
<meta name="twitter:image" content="http://schemastore.org/img/json-logo.png" />
1117+
1118+
<meta property="og:title" content="${pageTitle}" />
1119+
<meta property="og:description" content="${pageDescription}" />
1120+
<meta property="og:type" content="website" />
1121+
<meta property="og:url" content="http://schemastore.org" />
1122+
<meta property="og:image" content="http://schemastore.org/img/json-logo.png" />
1123+
</head>
1124+
<body>
1125+
1126+
<header role="banner">
1127+
<div class="container">
1128+
<h1><a href="/" itemprop="name">${pageTitle}</a></h1>
1129+
</div>
1130+
</header>
1131+
<nav>
1132+
<ul class="container">
1133+
<li><a href="/json/">JSON</a></li>
1134+
</ul>
1135+
</nav>
1136+
1137+
<div role="main" id="main" class="container">
1138+
${body}
1139+
</div>
1140+
1141+
<footer role="contentinfo" class="container">
1142+
<p>Open source on <a href="https://github.com/schemastore/schemastore/">GitHub</a></p>
1143+
</footer>
1144+
1145+
<script src="/js/site.js" async defer></script>
1146+
</body>
1147+
</html>
1148+
`,
1149+
)
9371150
}
9381151

9391152
async function assertFileSystemIsValid() {

0 commit comments

Comments
 (0)