Remove sidebar

This commit is contained in:
timvisee 2021-03-01 17:57:45 +01:00
parent 7fcf35bca0
commit bce3b5038d
No known key found for this signature in database
GPG Key ID: B8DB720BC383E172
3 changed files with 53 additions and 114 deletions

View File

@ -1,5 +1,6 @@
header#banner {
margin: 1em 0;
max-width: 750px;
margin: 1em auto;
padding: 0 2.5em 0 2.5em;
display: grid;
column-gap: 1em;
@ -67,8 +68,7 @@ header#banner {
}
main {
margin: 0 0 3em 0;
display: flex;
margin: 0 2.5em;
color: $color-text;
transition: color 0.2s ease;
}
@ -76,11 +76,15 @@ main {
content {
font-family: $font-read;
padding: 0.5em 2.5em 0 2.5em;
flex: 1;
overflow-x: auto;
overflow-y: visible;
transition: background-color 0.2s ease;
// TODO: update this
margin: 0 auto;
max-width: 750px;
display: block;
#{headings(1,6,"header >")} {
margin: 0;
padding-bottom: 0.3em;
@ -135,61 +139,27 @@ article.single {
padding: 0;
}
sidebar {
font-family: $font-main;
width: 20em;
padding: 0.5em 1.5em 1.5em 1.5em;
box-sizing: border-box;
transition: border 0.2s ease;
h1 {
font-size: 1.4em;
}
#{headings(1,6)} {
margin: 0;
padding-bottom: 0.3em;
}
}
sidebar > section {
padding: 0 0 1rem 0;
ul {
list-style-type: none;
list-style-position: inside;
li {
line-height: 2;
width: 100%;
a {
display: block;
padding: 0 0.5rem;
font-family: $font-main;
border-radius: 6px;
white-space: nowrap;
overflow: hidden !important;
text-overflow: ellipsis;
&.active {
background-color: rgba($color-link, 0.1);
}
&:active {
background-color: rgba($color-link-hover, 0.2);
}
}
}
li.sub > a {
padding-left: 1.5rem;
}
}
}
sidebar > section > ul {
margin: 0 -0.3rem;
padding-left: 0;
}
footer {
font-family: $font-main;
}
body > footer {
max-width: 750px;
padding: 0 2.5em;
margin: 0 auto 3em auto;
line-height: 1.5;
ul {
display: inline;
list-style: none;
margin-top: 0;
margin-left: 0.5em;
padding: 0;
li {
display: inline;
margin-right: 0.5em;
}
}
}

View File

@ -1,17 +1,8 @@
@media (max-width: $responsive-small) {
main {
flex-direction: column;
border-left: none;
border-right: none;
border-bottom: none;
margin: 0;
}
sidebar {
width: auto;
margin-top: 2em;
}
header#banner {
grid-template-columns: min-content auto;
grid-template-rows: min-content auto;
@ -56,9 +47,19 @@
@media (max-width: $responsive-mini) {
content,
sidebar {
body > footer {
padding-left: 1em;
padding-right: 1em;
ul {
display: block;
margin-left: 0;
}
}
body > footer ul {
display: block;
margin-left: 0;
}
header#banner,

View File

@ -169,52 +169,20 @@
{% block page_footer %}{% endblock page_footer %}
</content>
<sidebar>
{# Categories #}
{% set categories = get_taxonomy(kind="categories") %}
{% if categories.items | length > 0 -%}
<section>
<h1><a href="/categories">Categories</a></h1>
<ul>
<nav itemscope itemtype="http://schema.org/SiteNavigationElement">
{% for category in categories.items %}
<li>
<a itemprop="url"
class="{% if category.permalink | replace(from="$BASE_URL", to=config.base_url) == current_url %}active{% endif %}"
href="{{ category.permalink | safe }}">
<span itemprop="name">{{ category.name | title }}</span>
</a>
</li>
{% endfor %}
</nav>
</ul>
</section>
{%- endif %}
{# Tags #}
{% set tags = get_taxonomy(kind="tags") -%}
{% if tags.items | length > 0 -%}
<section>
<h1><a href="/tags">Tags</a></h1>
<div class="tags">
{% for tag in tags.items %}
<a href="{{ tag.permalink | safe }}"
class="tag {% if tag.permalink | replace(from="$BASE_URL", to=config.base_url) == current_url %}active{% endif %}">
{{ tag.name }}
</a>
{% endfor %}
</div>
</section>
{%- endif %}
<p class="muted">
Copyright &copy; {{ config.title }} 2011-{{ now() | date(format="%Y") }}
{% if config.extra.zenn_source %}
<br /><a href="{{ config.extra.zenn_source }}" target="_blank">Source</a>
{% endif %}
</p>
</sidebar>
</main>
<footer class="muted">
Copyright &copy; {{ config.title }} 2011-{{ now() | date(format="%Y") }}.
<ul>
<li><a href="/tags" title="Browse tags">Tags</a></li>
<li><a href="/categories" title="Browse categories">Categories</a></li>
{% if config.extra.zenn_source %}
<li><a href="{{ config.extra.zenn_source }}" target="_blank">Source</a></li>
{% endif %}
</ul>
</footer>
{% endblock main %}
</body>