Skip to content

Commit

Permalink
Tidy up some css
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoverbear committed Dec 13, 2024
1 parent 3eab5d3 commit 747c656
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 35 deletions.
30 changes: 14 additions & 16 deletions sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -148,23 +148,21 @@ main {
display: flex;
flex-direction: column;
align-content: center;
padding: 2vh 0;
background-color: var(--color-background);
& article, & {
& > div, & > section, & > p, & > h1,
& > h2, & > h3, & > h4, & > h5, & > h6, & > blockquote,
& > table,
& > ul,
& > ol,
& > nav {
padding-left: var(--margins);
padding-right: var(--margins);
}
& > ul > li > pre,
& > ol > li > pre {
margin-left: calc(var(--margins) * -1 - 1rem) !important;
margin-right: calc(var(--margins) * -1) !important;
}
}

*:is(article, section, nav, div.excerpt) {
&::before {
padding-left: var(--margins);
padding-right: var(--margins);
}
& > *:is(p, h1, h2, h3, h4, h5, h6, blockquote, table, ul, ol, div.section-meta, div.post-meta) {
padding-left: var(--margins);
padding-right: var(--margins);
}
& > *:is(ul, ol) > li > pre {
margin-left: calc(var(--margins) * -1 - 1rem) !important;
margin-right: calc(var(--margins) * -1) !important;
}
}

Expand Down
32 changes: 17 additions & 15 deletions templates/blog/list.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{% extends "page.html" %}

{% block main %}
{{ section.content | safe }}
<hr>
{% for post in section.pages | default(value=[]) %}
{{ post::metadata(post=post) }}
{% if loop.last != true %}
<hr>
{% endif %}
{% endfor %}
{% for subsection_path in section.subsections | default(value=[]) %}
{{ section::metadata(path=subsection_path) }}
{% if loop.last != true %}
<hr>
{% endif %}
{% endfor %}
{% endblock main %}
<article>
{{ section.content | safe }}
</article>
<hr>
{% for post in section.pages | default(value=[]) %}
{{ post::metadata(post=post) }}
{% if loop.last != true %}
<hr>
{% endif %}
{% endfor %}
{% for subsection_path in section.subsections | default(value=[]) %}
{{ section::metadata(path=subsection_path) }}
{% if loop.last != true %}
<hr>
{% endif %}
{% endfor %}
{% endblock main %}
4 changes: 3 additions & 1 deletion templates/blog/single.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{%- extends "page.html" -%}

{%- block main -%}
{{ page.content | safe }}
<article>
{{ page.content | safe }}
</article>
{%- endblock main -%}
4 changes: 2 additions & 2 deletions templates/macros/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ <h2 class="post-title"><a href="{{ post.permalink }}">{{ post.title | markdown(i
<h5 class="description">{{ post.description | default(value="") | markdown(inline=true) | safe }}</h5>
<div class="excerpt">
{{ post.summary | safe }}
<a class="continue-reading" href="{{ post.permalink }}#continue-reading">Continue reading...</a>
</div>

<div class="post-meta">
<a class="continue-reading" href="{{ post.permalink }}#continue-reading">Continue reading...</a>
{%- if post.date -%}
<div class="posted-on">
<time datetime="{{ post.date | date(format=" %Y-%m-%d %H:%M") }}">{{ post.date | date(format="%Y-%m-%d")
Expand Down
2 changes: 1 addition & 1 deletion templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<main>
{% include "partials/toc.html" %}
{% block main %}
{{ page.content | safe }}
{{ page.content | safe }}
{% endblock main %}
</main>
{% include "partials/footer.html" %}
Expand Down

0 comments on commit 747c656

Please sign in to comment.