Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve content layout #38

Merged
merged 5 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 1 addition & 34 deletions sass/_search.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
.search-container {
position: absolute;
font-size: 12px;
top: 20px;
left: 26px;
width: 20vw;
width: 42%;
max-width: 300px;
z-index: 2;
input {
Expand Down Expand Up @@ -59,38 +58,6 @@
}
}

@media screen and (max-width: 960px) {
.search-container {
width: 30vw;
}

.search-results {
width: 65vw;
right: unset;
margin-right: -50%;
}
}

@media screen and (max-width: 640px) {
.search-container {
width: 65vw;
max-width: 325px;
top: 70px;
left: 50%;
right: unset;
margin-right: -50%;
transform: translate(-50%, 0);
}

.search-results {
width: 75vw;
left: 25%;
right: unset;
margin-right: -25%;
transform: translate(-30%, 0);
}
}

@media (prefers-color-scheme: dark) {
.search-container {
input {
Expand Down
161 changes: 87 additions & 74 deletions sass/_site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@
width: 65%;
float: right;
overflow-y: auto;
text-align: justify;
.content {
padding: 120px 10% 60px;
max-width: 100%;
display: flex;
flex-direction: column;
margin-bottom: auto;
padding: 0px 10% 52px;
}
}

Expand All @@ -38,15 +43,14 @@
}
.block-right {
width: 50%;
display: block;
> div {
display: flex;
flex-direction: column;
.content {
display: flex;
flex: 1;
padding: 0px 10% 52px;
align-items: center;
}
.content {
padding: 120px 60px 60px;
max-width: 600px;
min-height: 94%;
justify-content: center;
}
}
}
Expand All @@ -57,17 +61,28 @@
}

.content {
margin: 0 auto;
margin: 0 20px;
overflow-wrap: break-word;
}

nav.nav-bar {
position: absolute;
display: flex;
gap: 20px;
flex-direction: row-reverse;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
flex: 1 1 22px;
top: 20px;
right: 26px;
z-index: 2;
}

#nav-container {
margin: 20px;
display: flex;
flex-direction: row-reverse;
}

nav.nav-bar ul {
font-size: 12px;
text-transform: uppercase;
Expand Down Expand Up @@ -372,14 +387,21 @@ a.zola-anchor {
}
}

.post-info {
text-align: start;
display: flex;
align-items: flex-start;
}

#posts {
.block-right {
display: block;
display: flex;
flex-direction: column;
height: 100%;
.content {
height: auto;
min-height: 94%;
display: block;
display: flex;
flex-direction: column;
}
}
.logo {
Expand Down Expand Up @@ -413,7 +435,6 @@ a.zola-anchor {
}

.posts-list {
margin: 50px 0;
> li {
margin-bottom: 23px;
padding-bottom: 20px;
Expand Down Expand Up @@ -552,7 +573,6 @@ a.zola-anchor {
.post-music {
justify-content: center;
align-items: center;
height: 100%;
position: relative;
padding: 6px 10px;
display: inline-flex;
Expand Down Expand Up @@ -634,7 +654,7 @@ a.zola-anchor {
.date-highlight {
text-align: center;
font-size: 16px;
margin: 0 0 50px;
margin: 50px 0 50px;
color: $overlay-color;
display: -webkit-box;
display: -moz-box;
Expand Down Expand Up @@ -662,56 +682,57 @@ a.zola-anchor {
}

.projects {
padding-right: 20px;
display: block;
> h2 {
font-size: 22px;
padding-top: 20px;
padding-left: 20px;
#project-archived {
text-decoration: line-through;
}
}
.project-lang {
font-size: 16px;
}
.project-license {
font-size: 10px;
}
.project-description {
font-size: 15px;
width: 100%;
padding-right: 20px;
display: block;
> h2 {
font-size: 22px;
padding-top: 20px;
padding-left: 20px;
#project-archived {
text-decoration: line-through;
}
> ul {
padding: 0;
}
.project-lang {
font-size: 16px;
}
.project-license {
font-size: 10px;
}
.project-description {
font-size: 15px;
}
> ul {
padding: 0;
list-style-type: none;
> li {
margin-bottom: 14px;
padding-left: 20px;
list-style-type: none;
> li {
margin-bottom: 14px;
padding-left: 20px;
list-style-type: none;
}
}
.tags {
margin-top: 0;
padding-bottom: 10px;
padding-left: 0;
> li {
text-transform: lowercase;
list-style-type: none;
}
}
.tags:is(.project-tags) > ul {
padding: 0;
}
.tags {
margin-top: 0;
padding-bottom: 10px;
padding-left: 0;
> li {
text-transform: lowercase;
list-style-type: none;
}
.tags:is(.project-tags) > li {
margin: 0;
font-size: 8px;
padding: 4px;
margin-right: 10px;
margin-bottom: 10px;
&:last-child {
margin-right: 0;
}
}
.tags:is(.project-tags) > ul {
padding: 0;
}
.tags:is(.project-tags) > li {
margin: 0;
font-size: 8px;
padding: 4px;
margin-right: 10px;
margin-bottom: 10px;
&:last-child {
margin-right: 0;
}
}
}

.entry-meta {
Expand Down Expand Up @@ -798,22 +819,19 @@ a.zola-anchor {
}
}

.toc-block {
margin-bottom: 26px;
}

.toc-anchor {
font-size: 15px;
}

.footer-content {
vertical-align: bottom;
margin-top: auto;
position: relative;
display: flex;
justify-content: center;
align-items: center;
height: auto;
line-height: 0.6rem;
bottom: 0;
}

.footer-links {
Expand Down Expand Up @@ -868,12 +886,6 @@ a.zola-anchor {
grid-template-rows: repeat(4, auto);
}
}
nav.nav-bar {
left: 50%;
right: unset;
margin-right: -50%;
transform: translate(-50%, 0);
}
.inner-post {
h1 {
line-height: 36px;
Expand Down Expand Up @@ -907,7 +919,8 @@ a.zola-anchor {
}
.block-right {
.content {
padding: 145px 20px 40px;
height: 100%;
padding: 0px 20px 0px;
}
}
.projects {
Expand Down
26 changes: 14 additions & 12 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,10 @@ <h1 class="section-title">{%- block page_title %}{% if page.title %}{{ page.titl
</div>
</div>
<div class="block-right">
{% if config.build_search_index == true %}
<script defer src="{{ '/elasticlunr.min.js?v=' ~ get_hash(path='/elasticlunr.min.js', sha_type=512, base64=false) | safe }}"></script>
<script defer src="/search.js", integrity="sha512-{{ get_hash(path='/search.js', sha_type=512, base64=true) | safe }}"></script>
<nav class="search-container" id="search-nav">
<input id="search" type="search" placeholder="Search" aria-label="Search">
<div class="search-results">
<div class="search-results__items"></div>
</div>
</nav>
{% endif %}
{% block nav %}
<div id="nav-container">
<nav class="nav-bar" role="navigation">
<ul class="nav-menu">
{% block nav %}
<li{% if active_path == "/" %} class="nav-active"{% endif %}><a href="{{ "/" | safe }}">Home</a></li>
{% if config.extra.menu.posts == true %}
<li{% if active_path is starting_with("/posts/") or active_path is starting_with("/tags/") or active_path is starting_with("/categories/")%} class="nav-active"{% endif %}><a href="{{ "/posts/" | safe }}" aria-haspopup="true">{{ config.extra.menu.posts_label }}</a>
Expand All @@ -65,9 +56,20 @@ <h1 class="section-title">{%- block page_title %}{% if page.title %}{{ page.titl
{% for link in config.extra.menu.links %}
<li{% if page %}{% if active_path is starting_with(link.url) %} class="nav-active"{% endif %}{% endif %}><a href="{% if link.url is starting_with("@") %}{{ get_url(path=link.url, trailing_slash=true) | safe }}{% else %}{{ link.url | safe }}{% endif %}">{{ link.name }}</a></li>
{% endfor %}
{% endblock nav %}
</ul>
</nav>
{% if config.build_search_index == true %}
<script defer src="{{ '/elasticlunr.min.js?v=' ~ get_hash(path='/elasticlunr.min.js', sha_type=512, base64=false) | safe }}"></script>
<script defer src="/search.js", integrity="sha512-{{ get_hash(path='/search.js', sha_type=512, base64=true) | safe }}"></script>
<nav class="search-container" id="search-nav">
<input id="search" type="search" placeholder="Search" aria-label="Search">
<div class="search-results">
<div class="search-results__items"></div>
</div>
</nav>
{% endif %}
</div>
{% endblock nav %}
{% block right %}
<div class="content">
{% block date %}<div class="date-highlight">{% if page.date %}{{ page.date | date(format="%d %b %Y") }}{% else %}x{% endif %}</div>{% endblock date %}
Expand Down
3 changes: 2 additions & 1 deletion templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1 class="section-title">{{ page.title | safe }}</h1>
{% if page.extra.subtitle %}<h1>{{ page.extra.subtitle | safe}}</h1>{% endif %}
{% if current_path is starting_with("/posts/") %}
{% if config.extra.read_time == true or page.updated %}
<div class="post-ext-info">
<div class="post-info"><div class="post-ext-info">
{% if config.extra.read_time == true %}
<p>{{ page.reading_time }} minute{{ page.reading_time | pluralize }} reading time</p>
{% endif %}
Expand All @@ -34,6 +34,7 @@ <h1 class="section-title">{{ page.title | safe }}</h1>
{{ macros::music(artist=page.extra.music[0], track=page.extra.music[1]) }}
{% endif %}
{% endblock music %}
</div>
{% if config.extra.toc == true and not page.extra.disable_toc %}{% if page.toc %}{% if page.toc | length >= 2 %}
<div class="toc-block">
<ul>
Expand Down
Loading