Skip to content

Commit

Permalink
feat: improvements to style
Browse files Browse the repository at this point in the history
  • Loading branch information
shivan-s committed Oct 25, 2024
1 parent 831f0d4 commit 5d35cce
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 67 deletions.
40 changes: 21 additions & 19 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ a:hover {

h1 {
font-size: var(--very-large-size);
width: fit-content;
}

h2 {
Expand Down Expand Up @@ -179,6 +180,10 @@ section {
gap: var(--small-gap);
padding: calc(var(--small-gap) / 2) var(--small-gap);

& h2 {
text-align: center;
}

& header {
display: flex;
flex-direction: column;
Expand All @@ -197,20 +202,13 @@ section.about {
flex-direction: column;
border: 2px solid var(--text-color);
border-radius: var(--normal-border-radius);
/* TODO: shadow */
box-shadow: 1px 1px 1px 1px var(--text-color);
box-shadow: 0px 0px 0px 2pt var(--text-color);

&:hover {
transform: rotate(0deg);
}
}

section {
& h2 {
text-align: center;
}
}

article {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -359,24 +357,28 @@ body>footer {
}
}

pre:has(code) {
border-radius: calc(var(--normal-border-radius) * 2);
padding: calc(var(--small-gap)) calc(var(--small-gap) / 2);
box-shadow: 0px 0px 2pt var(--text-color);
overflow-x: scroll;
}

code {
font-family: "Monaspace Radon";
}

div.content {
white-space: break-spaces;
word-break: break-word;

& * {
margin: var(--small-gap) 0rem;
}

& ul ol {
list-style-position: inline;
}

& pre:has(code) {
border-radius: calc(var(--normal-border-radius) * 2);
padding: calc(var(--small-gap)) calc(var(--small-gap) / 2);
box-shadow: 0px 0px 2pt var(--text-color);
overflow-x: scroll;
}

& code {
font-family: "Monaspace Radon";
}
}

@font-face {
Expand Down
24 changes: 1 addition & 23 deletions layouts/_default/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,7 @@ <h2>About</h2>
<header>
<h2>Posts</h2>
</header>
{{ $pages := where site.RegularPages "Type" "posts" }} {{ range
$pages.GroupByPublishDate "2006" }}
<div class="posts-groupby">
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .RelPermalink }}"><span title={{ .LinkTitle }} class="post-title">{{ if .Draft }}<em
title="Draft post">[D]&nbsp;</em>{{
end }}{{
.LinkTitle | truncate 128 }}</span>
<small class="post-metadata">
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00"
}} {{ $dateHuman := .Date | time.Format "2 Jan" }}
<span title={{ .Date | time.Format "January 2, 2006" }}><time datetime="{{ $dateMachine }}">{{ $dateHuman
}}</time></span>
<span title="{{ .WordCount }} words">
{{ .ReadingTime }} min</span></small></a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ partial "posts-list.html" . }}
<footer />
</section>
{{ end }}
22 changes: 1 addition & 21 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,4 @@
<h2>{{ .Title }}</h2>
</header>

{{ range .Pages.GroupByPublishDate "2006" }}
<div class="posts-groupby">
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }} {{ with .GetTerms "tags" }}
<p>Tags</p>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{ end }}
</ul>
{{ end }}
<li>
<a href="{{ .RelPermalink }}"><span>{{ .LinkTitle }}<span>{{ . }}</span></span>
<small class="post-metadata">{{ partial "time.html" . }}<span title="{{ .WordCount }} words">
{{ .ReadingTime }} min</span></small></a>
</li>
{{ end }}
</ul>
</div>
{{ end }} {{ end }}
{{ partial "posts-list.html" . }} {{ end }}
23 changes: 23 additions & 0 deletions layouts/partials/posts-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{ $pages := where site.RegularPages "Type" "posts" }}
{{ range $pages.GroupByPublishDate "2006" }}
<div class="posts-groupby">
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .RelPermalink }}"><span title={{ .LinkTitle }} class="post-title">{{ if .Draft }}<em
title="Draft post">[D]&nbsp;</em>{{
end }}{{
.LinkTitle | truncate 128 }}</span>
<small class="post-metadata">
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00"
}} {{ $dateHuman := .Date | time.Format "2 Jan" }}
<span title={{ .Date | time.Format "January 2, 2006" }}><time datetime="{{ $dateMachine }}">{{ $dateHuman
}}</time></span>
<span title="{{ .WordCount }} words">
{{ .ReadingTime }} min</span></small></a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
5 changes: 1 addition & 4 deletions layouts/partials/tags.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{{- /* For a given taxonomy, renders a list of terms assigned to the page.
@context {page} page The current page. @context {string} taxonomy The taxonomy.
@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} */}} {{-
$page := .page }} {{- $taxonomy := .taxonomy }} {{- with $page.GetTerms
{{- $page := .page }} {{- $taxonomy := .taxonomy }} {{- with $page.GetTerms
$taxonomy }} {{- $label := (index . 0).Parent.LinkTitle }}
<div class="tags">
<ul>
Expand Down
Empty file removed layouts/partials/time.html
Empty file.

0 comments on commit 5d35cce

Please sign in to comment.