Skip to content

Commit

Permalink
feat: improves the styling even more
Browse files Browse the repository at this point in the history
  • Loading branch information
shivan-s committed Oct 21, 2024
1 parent 5aa1020 commit 5d52762
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 28 deletions.
49 changes: 38 additions & 11 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,28 @@

:root {
/* Colors */
--primary-color: #196680;
--alternative-color: #ff9b33;
--support-color: #222222;
--text-color: #222222;
--background-color: #fefefe;
/* #196680 */
--primary-color: hsla(195, 67.3%, 30%, 1);
/* #ff9b33 */
--alternative-color: hsla(31, 100%, 60%, 1);
/* #222222 */
--text-color: hsla(0, 0%, 13.3%, 1);
/* #bababa */
--support-color: hsla(0, 0%, 73%, 1);
/* #fefefe */
--background-color: hsla(0, 0%, 99.6%, 1);

@media (prefers-color-scheme: dark) {
--primary-color: #80dfff;
--alternative-color: #ff9b33;
--support-color: #fefefe;
--text-color: #fefefe;
--background-color: #222222;
/* #80dfff; */
--primary-color: hsla(195, 100%, 75.1%, 1);
/* #ff9b33; */
--alternative-color: hsla(31, 100%, 60%, 1);
/* #e3e3e3 */
--text-color: hsla(0, 0%, 89%, 1);
/* #bababa */
--support-color: hsla(0, 0%, 73%, 1);
/* #222222 */
--background-color: hsla(0, 0%, 13.3%, 1);
}

/* Spacing */
Expand Down Expand Up @@ -84,7 +94,8 @@ h2 {
}

h1,
h2 {
h2,
h3 {
font-family:
Optician Sans,
sans-serif;
Expand Down Expand Up @@ -195,6 +206,12 @@ section.about {
box-shadow: 1px 1px 1px 1px var(--text-color);
}

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

article {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -273,6 +290,16 @@ body>footer {
}
}

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;
}

@font-face {
font-family: "Optician Sans";
font-style: normal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ cover:
caption: caption
relative: false
hidden: false
audio: audio.mp3
audio:
file: audio.mp3
caption: audio
---

Here's an example blog post.

Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis.

Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis.

```py
def main():
print("Hello World")
```
4 changes: 4 additions & 0 deletions hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ pagination:
disableAliases: false
pagerSize: 10
path: page

markup:
highlight:
style: catppuccin-mocha
7 changes: 4 additions & 3 deletions layouts/_default/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ <h2>About</h2>
</footer>
</section>
{{ end }}
<section>
<section class="posts">
<header>
<h2>Posts</h2>
</header>
{{ $pages := where site.Pages "Section" "posts" }} {{ range $pages }} {{
partial "article.html" . }}
{{ $pages := where site.RegularPages "Type" "posts" }} {{ $paginator :=
.Paginate $pages }} {{ range $paginator.Pages }} {{ partial
"article-item.html" . }}
<hr />
{{ end }}
<footer />
Expand Down
4 changes: 2 additions & 2 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
{{ partial "breadcrumbs.html" . }}
<h2>{{ .Title }}</h2>
</header>
{{ .Content }} {{ range .Pages }} {{ partial "article.html" . }} {{ .Summary }}
{{ end }} {{ end }}
{{ range .Pages }} {{ partial "article-item.html" . }} {{ .Summary }} {{ end }}
{{ end }}
10 changes: 1 addition & 9 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
{{ define "main" }}
</header>
<article>
<header>
{{ partial "breadcrumbs.html" . }}
<h2>{{ .Title }}</h2>
<small class="post-metadata">
{{ partial "time.html" . }}
<span title="{{ .WordCount }} words">{{ .ReadingTime }} min</span>
<span>{{ .Params.author }}</span>
<span><a href="">Suggest Changes</a></span>
</small>
</header>

{{ .Content }} {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
<div class="content">{{ .Content }}</div>
</article>
{{ end }}
5 changes: 5 additions & 0 deletions layouts/_default/taxonomy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }} {{ range .Pages }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }} {{ end }}
File renamed without changes.
7 changes: 7 additions & 0 deletions layouts/partials/audio.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<figure {{ with .Get "class" }}class="{{ . }}" {{ end }}>
<audio controls preload="{{ .Get " preload" | default "metadata" }}">
{{ with .Get "src" }}
<source src="{{ . | relURL }}" type="audio/mpeg">{{ end }}
</audio>
{{ with .Get "caption" }}<figcaption>{{ . }}</figcaption>{{ end }}
</figure>
22 changes: 22 additions & 0 deletions layouts/posts/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{ define "main" }}
</header>
<article>
<header>
{{ partial "breadcrumbs.html" . }}
<h2>{{ .Title }}</h2>
<small class="post-metadata">
{{ partial "time.html" . }}
<span title="{{ .WordCount }} words">{{ .ReadingTime }} min</span>
<span>{{ .Params.author }}</span>
<span><a href="">Suggest Changes</a></span>
</small>
</header>
{{ with .Params.audio }}
{{ partials "audio.html" . }}
{{ end }} <div class="content">{{ .Content }}
</div>
<footer>
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
</footer>
</article>
{{ end }}
1 change: 1 addition & 0 deletions layouts/shortcodes/audio.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ partials "audio.html" . }}
3 changes: 1 addition & 2 deletions theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ description: "A theme for optometrists who code"
homepage: "https://github.com/shivan-s/hugo-optom-code"

# If you have a running demo of the theme
# TODO!
demosite: "https://owner.github.io/repo"
demosite: "https://shivan.xyz"

# Taxonomy terms
tags:
Expand Down

0 comments on commit 5d52762

Please sign in to comment.