Skip to content

Commit

Permalink
Add blog tag setup
Browse files Browse the repository at this point in the history
Previously was hard-coded due to using the wrong type of template
  • Loading branch information
FireIsGood committed Feb 19, 2025
1 parent 9738ed5 commit 837b5c9
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 24 deletions.
31 changes: 31 additions & 0 deletions themes/osuosl/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,29 @@ textarea {
margin-top: 50px;
}

.blog-split {
display: grid;
grid-template-columns: 1fr min(30%, 350px);
gap: 1rem 2rem;
}

.tag-cloud {
position: sticky;
top: 2rem;
}

.tag-cloud h2 {
margin-bottom: 0;
}

.tag-cloud :first-child {
margin-top: 0;
}

.tag-cloud :last-child {
margin-bottom: 0;
}

.blog-summaries {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -891,6 +914,14 @@ textarea {
display: flex;
flex-direction: row;
}

.blog-split {
grid-template-columns: 1fr;
}

.blog-split aside {
order: -1;
}
}

@media (max-width: 767px) {
Expand Down
12 changes: 12 additions & 0 deletions themes/osuosl/layouts/_default/taxonomy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ define "main" }}
{{- partial "menu.html" . -}}
<main class="main_content">
<h1>{{ .Title }}</h1>
{{ .Content }}
<ul>
{{ range .Data.Terms.ByCount }}
<li><a href="{{ .Page.RelPermalink }}" class="tag">#{{ .Page.LinkTitle }}</a> ({{ .Count }})</li>
{{ end }}
</ul>
</main>
{{ end }}
37 changes: 37 additions & 0 deletions themes/osuosl/layouts/_default/term.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{ define "main" }}
{{- partial "menu.html" . -}}
<main class="main_content">
<h1>Tag: #{{ .Title }}</h1>
<p>
<b>{{ .Pages.Len }}</b> posts tagged <a href="{{ .Page.RelPermalink }}" class="tag">#{{ .Page.LinkTitle }}</a>
</p>
{{ .Content }}
{{- $studentStories := where (where .Site.RegularPages "Section" "blog") "Params.tags" "intersect" (slice
"student-stories")
}}
<div class="blog-split">
<div>
{{ partial "pagination.html" . }}
<div class="blog-summaries">
{{- range .Paginator.Pages }}
{{- .Render "summary" }}
{{- end }}
</div>
{{ partial "pagination.html" . }}
</div>
<aside>
<div class="tag-cloud card">
<h2>Tags</h2>
<ul>
{{ range .Site.Taxonomies.tags.ByCount }}
<li>
<a href="{{ .Page.RelPermalink }}" class="tag">#{{ .Page.LinkTitle }}</a> ({{ .Count }})
{{- if eq .Page.Title $.Title -}}&nbsp;<small>&larr;</small>{{- end -}}
</li>
{{ end }}
</ul>
</div>
</aside>
</div>
</main>
{{ end }}
29 changes: 19 additions & 10 deletions themes/osuosl/layouts/blog/list.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
{{ define "main" }}
{{- partial "menu.html" . -}}
<main class="main_content">
<h1>OSU Open Source Lab Blog</h1>
{{ if .Content }}
<h1>Blog</h1>
<p>All <b>{{ .Pages.Len }}</b> posts</p>
<div class="blog-split">
<div>
{{ .Content }}
<div class="blog-summaries">
{{- range .Paginator.Pages }}
{{- .Render "summary" }}
{{- end }}
</div>
{{ partial "pagination.html" . }}
</div>
{{ end }}
{{ partial "pagination.html" . }}
<div class="blog-summaries">
{{- range .Paginator.Pages }}
{{- .Render "summary" }}
{{- end }}
<aside>
<div class="tag-cloud card">
<h2>Tags</h2>
<ul>
{{ range .Site.Taxonomies.tags.ByCount }}
<li><a href="{{ .Page.RelPermalink }}" class="tag">#{{ .Page.LinkTitle }}</a> ({{ .Count }})</li>
{{ end }}
</ul>
</div>
</aside>
</div>
{{ partial "pagination.html" . }}
</main>
{{ end }}
14 changes: 0 additions & 14 deletions themes/osuosl/layouts/tags/list.html

This file was deleted.

0 comments on commit 837b5c9

Please sign in to comment.