Skip to content

Commit

Permalink
use metadata from optech topics inside tag's pages
Browse files Browse the repository at this point in the history
the metadata for each topic that we get from the `.json` file at the
prebuild step are added to the `_index.md` page for each topic/tag.
Here we display that data.
  • Loading branch information
kouloumos committed Jan 31, 2024
1 parent a3fd808 commit 9ec38b0
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 9 deletions.
16 changes: 15 additions & 1 deletion themes/ace-documentation/assets/css/ace.scss
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,13 @@ img {
}
.tags-container {
display: flex;
flex-wrap: wrap;
margin-top: 5px;
gap: 5px;
}
.tag {
text-transform: uppercase;
font-size: 0.7em;
margin-right: 5px;
border-radius: 8px;
padding: 4px;
padding-inline: 10px;
Expand All @@ -196,3 +197,16 @@ img {
.categories-container {
padding: 0px 40px;
}
.taxonomy-list {
padding-right: 40px;
}
.aliases {
font-style: italic;
}
.excerpt {
margin-bottom: 15px;
line-height: 1.5;
}
.source-info {
font-size: 0.8em;
}
2 changes: 1 addition & 1 deletion themes/ace-documentation/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{{- partial "menu.html" . -}}
</div>

{{- if and (ne .Site.Params.toc false) (ne .Params.toc false) (ne .IsHome true) }}
{{- if and (ne .Site.Params.toc false) (ne .Params.toc false) (ne .IsHome true) (ne .Kind "taxonomy" true) (ne .Kind "term" true) }}
<div class="docs-toc large order-lg-2 order-md-0 order-xs-1 col-12 col-lg-2 col-xl-2 position-sticky">
{{- partial "tableofcontents.html" . -}}
</div>
Expand Down
42 changes: 35 additions & 7 deletions themes/ace-documentation/layouts/_default/taxonomy.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,56 @@
{{ define "main" }}

<h1>{{ .Title | humanize | title }}</h1>

<ul>
<div class="tag-header">
{{ if .Params.optech_url }}
<h1>{{ .Title }}</h1>
{{ else }}
<h1>{{ .Title | humanize | title }}</h1>
{{ end }}
{{ with .Params.aliases }}
<p>
<em>
Also covering
{{ range $i, $e := . -}}
{{- if $i -}}, {{ end -}}
{{ $e }}
{{- end -}}
</em>
</p>
{{ end }}
{{ if .Params.excerpt }}
<div class="excerpt">
{{ .Params.excerpt | markdownify }}
{{ with .Params.optech_url }}
<span class="source-info"><a href="{{ . }}">Read More</a></span>
{{ end }}
</div>
{{ end }}
</div>
{{ if gt (len .Data.Pages) 0 }}
<ul class="taxonomy-list">
{{ range .Data.Pages }}
<div class="h6 child-links py-1">
<a href="{{.RelPermalink}}" class="list-group-item list-group-item-action flex-column align-items-start">
<div class="d-flex justify-content-between">
<div class="d-flex flex-wrap-reverse justify-content-between">
<h5 class="mb-1">{{ .Title }} </h5>
<small class="pl-1 text-muted font-italic align-self-start" style="white-space: nowrap;">{{ .Params.date.Format "Jan 02, 2006" }}</small>
<small class="text-muted font-italic ml-auto" style="white-space: nowrap;">{{ .Params.date.Format "Jan 02, 2006" }}</small>
</div>
{{ with .Params.speakers }}
<p class="mb-1 text-muted">{{ delimit . ", " }}</p>
{{ end }}
<div class="d-flex justify-content-between">
<div class="d-flex flex-wrap justify-content-between">
{{ template "tags" . }}
<small class="text-muted font-italic align-self-end" style="white-space: nowrap;">
<small class="text-muted font-italic align-self-end ml-auto" style="padding-top: 7px;">
{{ trim .File.Dir "/" }}
</small>
</div>
</a>
</div>
{{ end }}
</ul>
{{ else }}
<p style="padding: 20px; text-align: center;">No transcripts available for this tag yet.</p>
{{ end }}

{{ if .IsTranslated }}
<h4>{{ i18n "translations" }}</h4>
Expand Down

0 comments on commit 9ec38b0

Please sign in to comment.