Skip to content

Commit

Permalink
refactor: more improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Mar 18, 2024
1 parent d4404fd commit ae4f0b2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion _data/origin/cors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cdns:

# fonts

webfonts: https://fonts.googleapis.com/css2?family=Lato&family=Source+Sans+Pro:wght@400;600;700;900&display=swap
webfonts: https://fonts.googleapis.com/css2?family=Lato:wght@300;400&family=Source+Sans+Pro:wght@400;600;700;900&display=swap

# Libraries

Expand Down
22 changes: 13 additions & 9 deletions _includes/post-description.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{% comment %}
{%- comment -%}
Get post description or generate it from the post content.
{% endcomment %}
{%- endcomment -%}

{% assign max_length = include.max_length | default: 200 %}
{%- assign max_length = include.max_length | default: 200 -%}

{% if post.description %}
{{ post.description | strip | truncate: max_length }}
{% else %}
{% include no-linenos.html content=post.content %}
{{ content | markdownify | strip_html | truncate: max_length | escape }}
{% endif %}
{%- capture description -%}
{%- if post.description -%}
{{- post.description -}}
{%- else -%}
{%- include no-linenos.html content=post.content -%}
{{- content | markdownify | strip_html -}}
{%- endif -%}
{%- endcapture -%}

{{- description | strip | truncate: max_length | escape -}}
2 changes: 1 addition & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<header>
<h1 data-toc-skip>{{ page.title }}</h1>
{% if page.description %}
<p class="mb-4">{{ page.description }}</p>
<p class="post-desc fw-light mb-4">{{ page.description }}</p>
{% endif %}

<div class="post-meta text-muted">
Expand Down
7 changes: 4 additions & 3 deletions _sass/layout/post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
}

header {
p {
font-family: $font-family-heading;
font-size: 1.1rem;
.post-desc {
@extend %heading;

font-size: 1.125rem;
line-height: 1.6;
}

Expand Down

0 comments on commit ae4f0b2

Please sign in to comment.