Skip to content

Commit 4464856

Browse files
committed
wip(web): mock control-file and META.json blocks on the adminpack catalog page
1 parent 69b7947 commit 4464856

2 files changed

Lines changed: 111 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Extension packaging metadata shown on the catalog detail page.
2+
# One file per extension under data/catalog/extension_meta/<name>.yaml;
3+
# the extension template renders these blocks when a file exists.
4+
#
5+
# control: fetched verbatim from the PostgreSQL source tree (REL_16_STABLE —
6+
# adminpack was removed in PostgreSQL 17):
7+
# https://raw.githubusercontent.com/postgres/postgres/REL_16_STABLE/contrib/adminpack/adminpack.control
8+
#
9+
# meta: MOCK. adminpack is a core contrib module and is NOT distributed on
10+
# PGXN, so no META.json exists upstream. This block is synthesized following
11+
# the PGXN Meta Spec v1.0.0 with adminpack's real facts, as a shape preview
12+
# for extensions that do ship one.
13+
14+
control:
15+
source: https://github.com/postgres/postgres/blob/REL_16_STABLE/contrib/adminpack/adminpack.control
16+
fields:
17+
comment: administrative functions for PostgreSQL
18+
default_version: "2.1"
19+
module_pathname: "$libdir/adminpack"
20+
relocatable: "false"
21+
schema: pg_catalog
22+
23+
meta:
24+
mock: true
25+
name: adminpack
26+
abstract: administrative functions for PostgreSQL
27+
version: "2.1.0"
28+
maintainer: PostgreSQL Global Development Group
29+
license: postgresql
30+
release_status: stable
31+
provides:
32+
adminpack:
33+
file: adminpack--1.0.sql
34+
version: "2.1.0"
35+
abstract: administrative functions for PostgreSQL
36+
resources:
37+
repository: https://github.com/postgres/postgres/tree/REL_16_STABLE/contrib/adminpack
38+
documentation: https://www.postgresql.org/docs/16/adminpack.html
39+
tags:
40+
- admin
41+
- administration
42+
- files
43+
- contrib

web/layouts/catalog/single.html

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,74 @@ <h2 style="margin-top:2rem;">Versions</h2>
8989
</table>
9090
{{ end }}
9191

92+
{{ with index (site.Data.catalog.extension_meta | default dict) $c.name }}
93+
{{ with .control }}
94+
<h2 style="margin-top:2rem;">Control file</h2>
95+
<table class="versions-table">
96+
<tbody>
97+
{{ range $k, $v := .fields }}
98+
<tr><td class="mono">{{ $k }}</td><td class="mono">{{ $v }}</td></tr>
99+
{{ end }}
100+
</tbody>
101+
</table>
102+
{{ with .source }}
103+
<p style="font-size:0.8rem; color:hsl(var(--muted-foreground)); margin-top:0.75rem;">
104+
Source: <a href="{{ . }}" target="_blank" rel="noopener">{{ $c.name }}.control ↗</a>
105+
</p>
106+
{{ end }}
107+
{{ end }}
108+
109+
{{ with .meta }}
110+
<h2 style="margin-top:2rem;">Distribution metadata (META.json){{ if .mock }} <span class="pill pill-light">mock</span>{{ end }}</h2>
111+
<div class="component-meta-grid">
112+
<div class="meta-block">
113+
<h3>Distribution</h3>
114+
<p>{{ .abstract }}</p>
115+
<span class="pill mono">v{{ .version }}</span>
116+
<span class="pill">{{ .release_status }}</span>
117+
</div>
118+
<div class="meta-block">
119+
<h3>Maintainer</h3>
120+
<p>{{ .maintainer }}</p>
121+
</div>
122+
<div class="meta-block">
123+
<h3>License</h3>
124+
<span class="pill mono">{{ .license }}</span>
125+
</div>
126+
{{ with .resources }}
127+
<div class="meta-block">
128+
<h3>Resources</h3>
129+
<ul>
130+
{{ with .repository }}<li><a href="{{ . }}" target="_blank" rel="noopener">Repository ↗</a></li>{{ end }}
131+
{{ with .documentation }}<li><a href="{{ . }}" target="_blank" rel="noopener">Documentation ↗</a></li>{{ end }}
132+
</ul>
133+
</div>
134+
{{ end }}
135+
{{ with .tags }}
136+
<div class="meta-block">
137+
<h3>Tags</h3>
138+
{{ range . }}<span class="pill">{{ . }}</span> {{ end }}
139+
</div>
140+
{{ end }}
141+
</div>
142+
{{ with .provides }}
143+
<h3 style="margin-top:1.5rem;">Provides</h3>
144+
<table class="versions-table">
145+
<thead><tr><th>Extension</th><th>Version</th><th>File</th></tr></thead>
146+
<tbody>
147+
{{ range $name, $p := . }}
148+
<tr>
149+
<td class="mono">{{ $name }}</td>
150+
<td class="mono">{{ $p.version }}</td>
151+
<td class="mono">{{ $p.file }}</td>
152+
</tr>
153+
{{ end }}
154+
</tbody>
155+
</table>
156+
{{ end }}
157+
{{ end }}
158+
{{ end }}
159+
92160
{{ else if eq $category "addon" }}
93161
{{ with index $c.versions 0 }}
94162
<p class="component-description">{{ .longDescription | default .description }}</p>

0 commit comments

Comments
 (0)