Skip to content

Commit

Permalink
feat: improvement to the code block (#23)
Browse files Browse the repository at this point in the history
Closes #22
  • Loading branch information
shivan-s authored Oct 24, 2024
1 parent 8cba21b commit eb342e5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
13 changes: 4 additions & 9 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ article {
}
}

div.page-groupby {
div.posts-groupby {
display: flex;
width: 100%;
gap: var(--large-gap);
Expand All @@ -275,7 +275,6 @@ div.page-groupby {
gap: var(--small-gap);

& span.post-title {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Expand Down Expand Up @@ -364,11 +363,7 @@ 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);
transform: rotate(-1deg);

&:hover {
transform: rotate(0deg);
}
overflow-x: scroll;
}

code {
Expand Down Expand Up @@ -415,12 +410,12 @@ div.content {
font-family: "Monaspace Xenon";
font-weight: 400;
font-style: italic;
src: url("/fonts/MonaspaceXenon-Itallic.woff") format("woff");
src: url("/fonts/MonaspaceXenon-Italic.woff") format("woff");
}

@font-face {
font-family: "Monaspace Xenon";
font-weight: 700;
font-style: italic;
src: url("/fonts/MonaspaceXenon-BoldItallic.woff") format("woff");
src: url("/fonts/MonaspaceXenon-BoldItalic.woff") format("woff");
}
1 change: 1 addition & 0 deletions content/posts/my-first-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Lorem **ipsum** **_dolor_** sit amet, officia excepteur ex fugiat reprehenderit
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
# long commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg comment
def main():
print("Hello World")
```
10 changes: 6 additions & 4 deletions layouts/_default/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@ <h2>Posts</h2>
</header>
{{ $pages := where site.RegularPages "Type" "posts" }} {{ range
$pages.GroupByPublishDate "2006" }}
<div class="page-groupby">
<div class="posts-groupby">
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .RelPermalink }}"><span class="post-title">{{ if .Draft }}<em title="Draft post">[D]&nbsp;</em>{{
<a href="{{ .RelPermalink }}"><span title={{ .LinkTitle }} class="post-title">{{ if .Draft }}<em
title="Draft post">[D]&nbsp;</em>{{
end }}{{
.LinkTitle }}</span>
.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><time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time></span>
<span title={{ .Date | time.Format "January 2, 2006" }}><time datetime="{{ $dateMachine }}">{{ $dateHuman
}}</time></span>
<span title="{{ .WordCount }} words">
{{ .ReadingTime }} min</span></small></a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h2>{{ .Title }}</h2>
</header>

{{ range .Pages.GroupByPublishDate "2006" }}
<div class="page-groupby">
<div class="posts-groupby">
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }} {{ with .GetTerms "tags" }}
Expand Down

0 comments on commit eb342e5

Please sign in to comment.