Skip to content

Commit

Permalink
Remove more
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodmillman committed Mar 6, 2024
1 parent a30ef49 commit 8918601
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 59 deletions.
18 changes: 0 additions & 18 deletions assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,6 @@ table.spec__table thead {
text-decoration: none;
}

.admonition.spec-meta {
margin: 0.5625rem auto 1.5625rem;
}

table.spec-meta {
margin-bottom: 0;
line-height: 1.2em;
display: inline-block;
}

.spec-field {
}

.spec-field-name {
white-space: nowrap;
font-weight: bold;
vertical-align: top;
}
.gallery {
display: flex;
flex-wrap: wrap;
Expand Down
37 changes: 18 additions & 19 deletions layouts/partials/specs/project_meta.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
{{- $root := . -}}
<div class="spec-meta">
<table>
<div class="sd-card sd-mb-3 sd-shadow-sm">
<div class="sd-card-body">
{{ $meta_fields := (slice "homepage" "repository" "pypi" "libraries-io" "license" "license-type") }}
<dl class="field-list">
{{- range $attr := $meta_fields -}}
{{ $val := index $.Params $attr }}
<tr class="field">
<td class="field-name">
{{ $attr | humanize }}:
</td>
<td class="field-value">
{{ $val | markdownify }}
</td>
</tr>
<dt class="field-odd">
{{ $attr | humanize }}:
</dt>
<dd class="field-odd">
{{ $val | markdownify }}
</dd>
{{- end -}}
</table>
</dl>
</div>
</div>

<div class="endorsed-specs">
<h1>Endorsed SPECs</h1>
{{ $specs := where $.Site.Pages "Section" "specs" }}
<div class="article-content">
<h2>Endorsed SPECs</h1>
{{- $specs := where $.Site.Pages "Section" "specs" -}}
<ul class="endorsed-specs-list">
{{- range $specs -}}
{{ if not (in (lower .Title) "meta") }}
{{ if in ( index .Params "endorsed-by" ) $root.File.BaseFileName }}
{{- if not (in (lower .Title) "meta") -}}
{{- if in ( index .Params "endorsed-by" ) $root.File.BaseFileName }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
{{- end -}}
</ul>
</div>
37 changes: 16 additions & 21 deletions layouts/partials/specs/spec_meta.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{{ $page := . }}
{{ $isSpec := eq (len (findRE "^spec-\\d*" .File.ContentBaseName)) 1 }}
<div class="sd-container-fluid sd-mb-4" >
<div class="sd-row">
<div class="sd-col sd-d-flex-row">
<div class="sd-card sd-w-100 sd-shadow-sm">
<div class="sd-card sd-mb-3 sd-shadow-sm">
<div class="sd-card-body">
<table class="spec-meta">
{{ $meta_fields := (slice "author" "discussion" "history" "endorsed-by") }}
{{ $warn := "" }}
<dl class="field-list">
{{- range $attr := $meta_fields -}}
{{ $val := index $.Params $attr }}
{{ $attr := strings.TrimPrefix "spec_" $attr }}
Expand All @@ -24,13 +22,12 @@
{{- end -}}
{{ $isSpecField := (in (slice "endorsed-by" "discussion" ) $attr) }}
{{ if (or $isSpec (not $isSpecField)) }}
<tr class="spec-field">
<td class="spec-field-name">
{{ $attr | humanize }}:
</td>
<dt class="field-odd">
{{ $attr | humanize }}<span class="colon">:</span></dt>
</dt>
{{- if (reflect.IsSlice $val) -}}
{{ $len := len $val }}
<td class="spec-field-value">
<dd class="field-odd">
{{- range $idx, $el := $val }}
{{ if eq $attr "endorsed-by" }}
<a href="{{ relref $.Page.CurrentSection (printf "core-projects/%s" $el) }}">{{ $el }}</a>
Expand All @@ -39,28 +36,26 @@
{{- end -}}
{{- if not (eq (add $idx 1) $len) -}},{{ end }}
{{ end }}
</td>
</dd>
{{- else }}
<td class="spec-field-value">
<dd class="field-odd">
{{ $val | markdownify }}
</td>
</dd>
{{- end -}}
</tr>
{{- end -}}
{{/* add warning that this is a draft, i.e. has not been endorsed by 2 projects or more */}}
{{- if (and (eq $attr "endorsed-by") (lt (len (or $val "")) 2)) -}}
{{/* add warning */}}
<div class="admonition attention spec-meta">
{{ $warn = "True" }}
{{- end -}}
{{- end -}}
</dl>
{{- if $warn }}
<div class="admonition attention">
<div class="admonition-title">
Attention
</div>
<p>This is a draft document.</p>
</div>
{{- end -}}
{{- end -}}
</table>
</div>
</div>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion layouts/specs/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1>{{ .Title }}</h1>
<h5 class="subtitle">{{ .Params.Subtitle }}</h5>
{{ end }}
{{ with partial "specs/meta.html" . -}}
<div class="post-meta">{{ . }}</div>
{{ . }}
{{- end }}

<div class="article-content">
Expand Down

0 comments on commit 8918601

Please sign in to comment.