Skip to content

Commit

Permalink
modules(modder): update json output and add schema
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Kollitsch <[email protected]>
  • Loading branch information
davidsneighbour committed Nov 10, 2024
1 parent fc87866 commit e0dfb07
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 10 deletions.
2 changes: 1 addition & 1 deletion modules/modder/layouts/index.modder.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
{{- end -}}

{{- $output = dict "js" (dict "imports" $jsImports "calls" $jsCalls) "scss" (dict "imports" $scssImports) -}}
{{- $output | encoding.Jsonify -}}
{{- $output | encoding.Jsonify (dict "indent" " ") -}}
16 changes: 8 additions & 8 deletions modules/modder/layouts/shortcodes/modules.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<table class="table table-striped">
{{ range $key, $value := site.Data.dnb.modder }}
<tr id="{{ $key }}">
{{- range $key, $value := site.Data.dnb.modder -}}
<tr id="{{- $key -}}">
<td class="align-middle">
<a href="{{ $value.homepage }}" target="_blank">
{{ $value.name }}
<a href="{{- $value.homepage -}}" target="_blank">
{{- $value.name -}}
</a>
</td>
<td>{{ $value.description }}</td>
<td style="width:100px;">{{ $value.version }}</td>
<td>{{- $value.description -}}</td>
<td style="width:100px;">{{- $value.version -}}</td>
</tr>
{{ end }}
</table>
{{- end -}}
</table>
2 changes: 1 addition & 1 deletion modules/modder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@davidsneighbour/release-config": "2024.4.8"
},
"scripts": {
"clean": "rimraf node_modules",
"clean": "rimraf node_modules changes.md response.json",
"release": "commit-and-tag-version --release-as patch -a -t \"modules/modder/v\" --releaseCommitMessageFormat \"chore(release): modules/modder/v{{currentTag}}\" && ./bin/repo/release/postrelease",
"release:minor": "commit-and-tag-version --release-as minor -a -t \"modules/modder/v\" --releaseCommitMessageFormat \"chore(release): modules/modder/v{{currentTag}}\" && ./bin/repo/release/postrelease",
"update": "npm-check-updates -u && npm install && git add package*"
Expand Down
42 changes: 42 additions & 0 deletions modules/modder/static/modder.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.dnbhub.xyz/modder.schema.json",
"title": "Modder assets schema",
"description": "",
"type": "object",
"properties": {
"js": {
"description": "",
"type": "object",
"properties": {
"imports": {
"description": "",
"type": "string",
"items": {
"type": "string"
}
},
"calls": {
"description": "",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"scss": {
"description": "",
"type": "object",
"properties": {
"imports": {
"description": "",
"type": "string",
"items": {
"type": "string"
}
}
}
}
}
}

0 comments on commit e0dfb07

Please sign in to comment.