Skip to content

Commit

Permalink
feat: update code styles and more styling
Browse files Browse the repository at this point in the history
  • Loading branch information
shivan-s committed Oct 22, 2024
1 parent 5d52762 commit ceccea1
Show file tree
Hide file tree
Showing 16 changed files with 177 additions and 179 deletions.
3 changes: 3 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ cover:
relative: false
hidden: false
audio:
src: audio.mp3
caption: caption
hidden: true
---
157 changes: 102 additions & 55 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
--normal-size: 1rem;
--large-size: 1.5rem;
--very-large-size: 2.5rem;

/* Border */
--normal-border-radius: 0.25rem;
--large-border-radius: 4rem;
}

html {
Expand All @@ -58,7 +62,6 @@ h5,
h6 {
margin: 0;
padding: 0;
line-height: normal;
}

p {
Expand Down Expand Up @@ -118,39 +121,48 @@ body>header {
flex-direction: column;
align-items: center;

& span.site-title {
font-size: var(--large-size);
}

a {
display: flex;
align-items: center;
gap: var(--letter-gap);
}
}
}

& ul {
padding: 0;
margin: 0;
display: flex;
flex-wrap: wrap;
justify-content: center;
div.tags {
font-family:
Optician Sans,
sans-serif;

& a:hover {
outline: 2px ridge var(--text-color);
filter: none;
border-radius: 4rem;
box-shadow: 0 0 0 2pt var(--text-color);
}
& ul {
list-style: none;
display: flex;
flex-wrap: wrap;
gap: var(--small-gap);

& a:hover {
outline: 2px ridge var(--text-color);
filter: none;
border-radius: var(--large-border-radius);
box-shadow: 0 0 0 2pt var(--text-color);
}

& li {
padding: 0.5rem 1rem;
list-style: none;
& li {
padding: calc(var(--small-gap) / 2) var(--small-gap);
list-style: none;

& a {
padding: 0.5rem 1rem;
}
& a {
padding: calc(var(--small-gap) / 2) var(--small-gap);
}

& a.active {
outline: 2px ridge var(--text-color);
filter: none;
border-radius: 4rem;
}
& a.active {
outline: 2px ridge var(--text-color);
filter: none;
border-radius: var(--large-border-radius);
}
}
}
Expand All @@ -161,23 +173,6 @@ body>header {
}
}

nav.breadcrumbs {
font-family:
Optician Sans,
sans-serif;
font-size: var(--small-size);

ul {
list-style: none;
display: flex;

& li:not(:last-child)::after {
padding: 0 var(--letter-gap);
content: "/";
}
}
}

section {
display: flex;
flex-direction: column;
Expand All @@ -196,12 +191,23 @@ section {
}
}

section.posts {
& .page-groupby:hover {
transform: rotate(1deg);
}

& .page-groupby:hover a:not(:hover) {
opacity: 0.8;
filter: blur(1px);
}
}

section.about {
position: relative;
transform: rotate(-1deg);
transform: rotate(-2deg);
flex-direction: column;
border: 2px solid var(--text-color);
border-radius: 0.25rem;
border-radius: var(--normal-border-radius);
/* TODO: shadow */
box-shadow: 1px 1px 1px 1px var(--text-color);
}
Expand All @@ -223,20 +229,55 @@ article {
}
}

.post-metadata {
div.page-groupby {
display: flex;
flex-wrap: nowrap;
gap: var(--large-gap);
border-top: 1px dotted var(--text-color);
padding: var(--small-gap) 0;

& ul {
width: 100%;

& li {
padding: var(--small-gap) 0;
list-style: none;

& a {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--small-gap);

& span.post-title {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}

& span:not(:last-child)::after {
padding: 0 var(--letter-gap);
content: "·";
& li:not(:first-child) {
border-top: 1px dotted var(--text-color);
}
}

& h3 {
padding-top: var(--small-gap);
}
}

hr {
border: none;
border: 1px groove var(--text-color);
width: 4ch;
small.post-metadata {
display: flex;

& span {
white-space: nowrap;
overflow: hidden;
}

& span:not(:last-child)::after {
padding: 0 calc(var(--letter-gap) / 2);
content: "·";
}
}

body {
Expand Down Expand Up @@ -272,6 +313,7 @@ main {
/* footer */
body>footer {
padding: 1rem 0rem;
margin-top: 1rem;
border-top: 1px solid var(--text-color);
font-family:
Optician Sans,
Expand All @@ -285,19 +327,24 @@ body>footer {
}

& p:not(:last-child)::after {
padding: 0 var(--letter-gap);
padding: 0 calc(var(--letter-gap) / 2);
content: "·";
}
}

pre:has(code) {
border-radius: calc(var(--normal-border-radius) * 2);
padding: calc(var(--small-gap)) calc(var(--small-gap) / 2);
}

code {
font-family: "Monaspace Radon";
padding: calc(var(--small-gap)) calc(var(--small-gap) / 2);
}

div.content {
white-space: break-spaces;
work-break: break-word;
word-break: break-word;
line-height: 1.5;
}

@font-face {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ title: "My First Post"
date: 2020-09-03
author: Author Name
summary: Summary
categories: [""]
tags: [""]
tags: ["lorem", "epsum"]
draft: true
cover:
image: image.jpg
Expand All @@ -15,6 +14,7 @@ cover:
audio:
file: audio.mp3
caption: audio
hidden: true
---

Here's an example blog post.
Expand Down
8 changes: 7 additions & 1 deletion hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ params:
name: Author name
about:
image: image.webp
githubRepo: "http://github.com/shivan-s/hugo-optom-code"
githubRepo: "http://github.com/shivan-s/shivan.xyz"

menus:
main:
Expand All @@ -36,3 +36,9 @@ pagination:
markup:
highlight:
style: catppuccin-mocha

enableGitInfo: true

taxonomies:
category: categories
tag: tags
23 changes: 19 additions & 4 deletions layouts/_default/home.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{ define "main" }} {{ with .GetPage "About" }}
<h1 hidden>{{ .Page.Title }}</h1>
<section class="about">
<header>
<a href="{{ .RelPermalink }}">
Expand All @@ -15,10 +16,24 @@ <h2>About</h2>
<header>
<h2>Posts</h2>
</header>
{{ $pages := where site.RegularPages "Type" "posts" }} {{ $paginator :=
.Paginate $pages }} {{ range $paginator.Pages }} {{ partial
"article-item.html" . }}
<hr />
{{ $pages := where site.RegularPages "Type" "posts" }} {{ range
$pages.GroupByPublishDate "2006" }}
<div class="page-groupby">
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .RelPermalink }}"><span class="post-title">{{ .LinkTitle }}</span>
<small class="post-metadata">
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00"
}} {{ $dateHuman := .Date | time.Format "2 Jan" }}
<span><time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time></span>
<span title="{{ .WordCount }} words">
{{ .ReadingTime }} min</span></small></a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
<footer />
</section>
Expand Down
24 changes: 22 additions & 2 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,25 @@
{{ partial "breadcrumbs.html" . }}
<h2>{{ .Title }}</h2>
</header>
{{ range .Pages }} {{ partial "article-item.html" . }} {{ .Summary }} {{ end }}
{{ end }}

{{ range .Pages.GroupByPublishDate "2006" }}
<div class="page-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 }}
1 change: 0 additions & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{{ define "main" }}
<article>
<header>
{{ partial "breadcrumbs.html" . }}
<h2>{{ .Title }}</h2>
</header>
<div class="content">{{ .Content }}</div>
Expand Down
13 changes: 0 additions & 13 deletions layouts/partials/article-item.html

This file was deleted.

7 changes: 0 additions & 7 deletions layouts/partials/audio.html

This file was deleted.

10 changes: 0 additions & 10 deletions layouts/partials/breadcrumbs.html

This file was deleted.

3 changes: 1 addition & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<span id="top" />
<a title="{{ site.Title }}" href="/">
<img src="/favicon.ico" height="35" />
<h1>{{ site.Title }}</h1>
<span class="site-title">{{ site.Title }}</span>
</a>
{{ partial "menu.html" (dict "menuID" "main" "page" .) }}
</nav>
Loading

0 comments on commit ceccea1

Please sign in to comment.