Skip to content

Commit

Permalink
additional tags for draft and future on list pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Level8Broccoli committed Sep 11, 2021
1 parent d7a67dd commit ad1b4a1
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 9 deletions.
1 change: 1 addition & 0 deletions themes/gilde-der-nacht/assets/sass/_generic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
@import "imports/5_components/apollon";
@import "imports/5_components/hermes";
@import "imports/5_components/caerus";
@import "imports/5_components/tag-list";

/**
* Patterns.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.c-tag-list {
list-style: none;
padding: 0;
margin: 0;
width: max-content;
display: flex;
flex-wrap: wrap;
gap: 0.5rem;

li {
font-size: 0.85em;
border-radius: 0.5em;
flex-grow: 0;
flex-shrink: 0;
height: 1.5rem;
padding: 0 1em;
display: inline-flex;
align-items: center;
border: 2px solid transparent;
background-color: var(--primary-brand-color);
color: white;
}

&-container {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0 2rem;

p {
margin: 0;
}

* + & {
margin-top: 1rem;
}
}
}

li.c-tag-info {
background-color: transparent;
color: #cc0029;
border-color: currentColor;
}
26 changes: 17 additions & 9 deletions themes/gilde-der-nacht/layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
{{ define "main" }}
<div>
{{ .Content }}
</div>
<div>
{{ range .Pages.ByDate.Reverse }}
<p>
<a href="{{ .RelPermalink }}">{{ .Title }} {{ .Date.Format "02.01.2006" }}<!-- TODO .Date.Format should depend on language, unfortunately months (e.g. January) are hardcoded into Hugo --></a>
</p>
{{ end }}
<div>{{ .Content }}</div>
<div>
{{ range .Pages.ByDate.Reverse }}
<div class="c-tag-list-container">
<p>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</p>
<ul class="c-tag-list">
<li {{ if gt .Date now }} class="c-tag-info" {{ end }}>
{{ .Date | time.Format "02.01.2006" }}
</li>
{{ if .Draft }}
<li class="c-tag-info">Status: Entwurf</li>
{{ end }}
</ul>
</div>
{{ end }}
</div>
{{ end }}

0 comments on commit ad1b4a1

Please sign in to comment.