Skip to content

Commit

Permalink
fix: prose & post page min height
Browse files Browse the repository at this point in the history
  • Loading branch information
isunjn committed Sep 13, 2023
1 parent d6adec5 commit bac845e
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 70 deletions.
13 changes: 8 additions & 5 deletions sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ a:focus-visible {
body.prose-page {
main {
font-size: var(--paragraph-font-size);
margin-top: 45px;
min-height: 100vh;
padding-top: 45px;
margin: 0 auto;
max-width: var(--main-max-width);
display: flex;
Expand All @@ -412,7 +412,7 @@ body.prose-page {
}

article {
padding: 90px 15px 30px;
padding: 45px 15px 30px;
font-size: var(--paragraph-font-size);
line-height: var(--paragraph-line-height);
}
Expand Down Expand Up @@ -756,9 +756,7 @@ body.post {
#wrapper {
display: flex;
justify-content: space-between;
margin-top: 45px;
font-size: 18px;
min-height: 100vh;
}

#blank {
Expand All @@ -771,7 +769,12 @@ body.post {
order: 2;
width: 100%;
margin: 0 auto;
padding-top: 45px;
max-width: var(--main-max-width);
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: space-between;
}

article {
Expand Down Expand Up @@ -826,7 +829,7 @@ body.post {
order: 3;
width: calc((100% - var(--main-max-width)) / 2);
position: sticky;
margin-top: 150px;
margin-top: 195px;
top: 60px;
height: min-content;
font-size: var(--aside-font-size);
Expand Down
102 changes: 52 additions & 50 deletions templates/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,64 +77,66 @@
{% endif %}
</aside>
<main>
{% if page.extra.copy is defined %}{% set allow_copy = page.extra.copy %}{% else %}{% set allow_copy = config.extra.copy %}{% endif %}
{% if allow_copy %}
{% set copy_icon = load_data(path="static/icon/copy.svg") %}
{% set check_icon = load_data(path="static/icon/check.svg") %}
<div id="copy-cfg" style="display: none;" data-copy-icon="{{ copy_icon }}" data-check-icon="{{ check_icon }}"></div>
{% endif %}
{% set backlink_icon = load_data(path="static/icon/backlink.svg") %}
<article class="prose" data-backlink-icon="{{ backlink_icon }}">
<h1>{{ page.title }}</h1>
<div id="post-info">
<div id="date">
<span id="publish">{{ page.date | date }}</span>
{% if page.updated and page.updated != page.date -%}
<span>Updated on <span id="updated">{{ page.updated | date }}</span></span>
{% endif -%}
</div>
<div>
{% if page.extra.copy is defined %}{% set allow_copy = page.extra.copy %}{% else %}{% set allow_copy = config.extra.copy %}{% endif %}
{% if allow_copy %}
{% set copy_icon = load_data(path="static/icon/copy.svg") %}
{% set check_icon = load_data(path="static/icon/check.svg") %}
<div id="copy-cfg" style="display: none;" data-copy-icon="{{ copy_icon }}" data-check-icon="{{ check_icon }}"></div>
{% endif %}
{% set backlink_icon = load_data(path="static/icon/backlink.svg") %}
<article class="prose" data-backlink-icon="{{ backlink_icon }}">
<h1>{{ page.title }}</h1>
<div id="post-info">
<div id="date">
<span id="publish">{{ page.date | date }}</span>
{% if page.updated and page.updated != page.date -%}
<span>Updated on <span id="updated">{{ page.updated | date }}</span></span>
{% endif -%}
</div>

{% if page.extra.display_tags is defined %}{% set display_tags = page.extra.display_tags %}{% elif config.extra.display_tags is defined %}{% set display_tags = config.extra.display_tags %}{% else %}{% set display_tags = true %}{% endif %}
{% if page.extra.display_tags is defined %}{% set display_tags = page.extra.display_tags %}{% elif config.extra.display_tags is defined %}{% set display_tags = config.extra.display_tags %}{% else %}{% set display_tags = true %}{% endif %}

{% if page.taxonomies.tags is defined and display_tags == true %}
<div id="tags">
{% for tag in page.taxonomies.tags -%}
{% set tag_slugify = tag | slugify -%}
<a href="{{ config.base_url ~ '/tags/' ~ tag_slugify }}"><span>#</span>{{ tag }}</a>
{%- endfor %}
{% if page.taxonomies.tags is defined and display_tags == true %}
<div id="tags">
{% for tag in page.taxonomies.tags -%}
{% set tag_slugify = tag | slugify -%}
<a href="{{ config.base_url ~ '/tags/' ~ tag_slugify }}"><span>#</span>{{ tag }}</a>
{%- endfor %}
</div>
{% endif %}
</div>
{% endif %}
</div>

{% if page.extra.outdate_alert is defined %}{% set show_outdate_alert = page.extra.outdate_alert %}{% else %}{% set show_outdate_alert = config.extra.outdate_alert %}{% endif %}
{% if page.extra.outdate_alert_days is defined %}{% set outdate_alert_days = page.extra.outdate_alert_days %}{% else %}{% set outdate_alert_days = config.extra.outdate_alert_days %}{% endif %}
{% if page.extra.outdate_alert is defined %}{% set show_outdate_alert = page.extra.outdate_alert %}{% else %}{% set show_outdate_alert = config.extra.outdate_alert %}{% endif %}
{% if page.extra.outdate_alert_days is defined %}{% set outdate_alert_days = page.extra.outdate_alert_days %}{% else %}{% set outdate_alert_days = config.extra.outdate_alert_days %}{% endif %}

{% if show_outdate_alert -%}
<blockquote id="outdate_alert" class="callout alert hidden" data-days="{{ outdate_alert_days }}"
data-alert-text-before="{{ config.extra.outdate_alert_text_before }}"
data-alert-text-after="{{ config.extra.outdate_alert_text_after }}">
{% set icon = load_data(path="static/icon/alert.svg") %}
<div class="icon">
{{ icon | safe }}
</div>
<div class="content"></div>
</blockquote>
{% endif %}
{% if show_outdate_alert -%}
<blockquote id="outdate_alert" class="callout alert hidden" data-days="{{ outdate_alert_days }}"
data-alert-text-before="{{ config.extra.outdate_alert_text_before }}"
data-alert-text-after="{{ config.extra.outdate_alert_text_after }}">
{% set icon = load_data(path="static/icon/alert.svg") %}
<div class="icon">
{{ icon | safe }}
</div>
<div class="content"></div>
</blockquote>
{% endif %}

{% if page.extra.truncate_summary is defined %}{% set truncate_summary = page.extra.truncate_summary %}{% elif config.extra.truncate_summary is defined %}{% set truncate_summary = config.extra.truncate_summary %}{% else %}{% set truncate_summary = false %}{% endif %}
{% if page.extra.truncate_summary is defined %}{% set truncate_summary = page.extra.truncate_summary %}{% elif config.extra.truncate_summary is defined %}{% set truncate_summary = config.extra.truncate_summary %}{% else %}{% set truncate_summary = false %}{% endif %}

{% if truncate_summary == true and page.summary %}
{{ page.content | trim_start_matches(pat=page.summary) | safe }}
{% else %}
{{ page.content | safe }}
{% endif %}
</article>
{% if truncate_summary == true and page.summary %}
{{ page.content | trim_start_matches(pat=page.summary) | safe }}
{% else %}
{{ page.content | safe }}
{% endif %}
</article>

{% if page.extra.comment is defined %}{% set show_comment = page.extra.comment %}{% else %}{% set show_comment = config.extra.comment %}{% endif %}
{% if show_comment %}
<div class="giscus"></div>
{% include "_giscus_script.html" %}
{% endif %}
{% if page.extra.comment is defined %}{% set show_comment = page.extra.comment %}{% else %}{% set show_comment = config.extra.comment %}{% endif %}
{% if show_comment %}
<div class="giscus"></div>
{% include "_giscus_script.html" %}
{% endif %}
</div>

{% include "_footer.html" %}
</main>
Expand Down
32 changes: 17 additions & 15 deletions templates/prose.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,24 @@
{% include "_header.html" %}
<div id="wrapper">
<main>
{% if section.extra.copy is defined %}{% set allow_copy = section.extra.copy %}{% else %}{% set allow_copy = config.extra.copy %}{% endif %}
{% if allow_copy %}
{% set copy_icon = load_data(path="static/icon/copy.svg") %}
{% set check_icon = load_data(path="static/icon/check.svg") %}
<div id="copy-cfg" style="display: none;" data-copy-icon="{{ copy_icon }}" data-check-icon="{{ check_icon }}"></div>
{% endif %}
{% set backlink_icon = load_data(path="static/icon/backlink.svg") %}
<article class="prose" data-backlink-icon="{{ backlink_icon }}">
{{ section.content | safe }}
</article>
<div>
{% if section.extra.copy is defined %}{% set allow_copy = section.extra.copy %}{% else %}{% set allow_copy = config.extra.copy %}{% endif %}
{% if allow_copy %}
{% set copy_icon = load_data(path="static/icon/copy.svg") %}
{% set check_icon = load_data(path="static/icon/check.svg") %}
<div id="copy-cfg" style="display: none;" data-copy-icon="{{ copy_icon }}" data-check-icon="{{ check_icon }}"></div>
{% endif %}
{% set backlink_icon = load_data(path="static/icon/backlink.svg") %}
<article class="prose" data-backlink-icon="{{ backlink_icon }}">
{{ section.content | safe }}
</article>

{% if section.extra.comment is defined %}{% set show_comment = section.extra.comment %}{% else %}{% set show_comment = config.extra.comment %}{% endif %}
{% if show_comment %}
<div class="giscus"></div>
{% include "_giscus_script.html" %}
{% endif %}
{% if section.extra.comment is defined %}{% set show_comment = section.extra.comment %}{% else %}{% set show_comment = config.extra.comment %}{% endif %}
{% if show_comment %}
<div class="giscus"></div>
{% include "_giscus_script.html" %}
{% endif %}
</div>

{% include "_footer.html" %}
</main>
Expand Down

0 comments on commit bac845e

Please sign in to comment.