From cc2273f7af3a56e2b7198290d4c337e146a4213a Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 28 Oct 2022 08:37:22 +0200 Subject: posts: narrower feed on mobile --- _includes/jekyll-theme/flex-header.html | 4 ++-- _includes/jekyll-theme/posts/date.html | 4 ++-- _includes/jekyll-theme/posts/header.html | 8 ++++++-- _layouts/post.html | 2 +- assets/css/jekyll-theme/posts.css | 8 ++++++++ 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/_includes/jekyll-theme/flex-header.html b/_includes/jekyll-theme/flex-header.html index 6048991..418fa2b 100644 --- a/_includes/jekyll-theme/flex-header.html +++ b/_includes/jekyll-theme/flex-header.html @@ -1,11 +1,11 @@
{% if include.left %} -

{{ include.left }}

+
{{ include.left }}
{% endif %}
{{ include.title }}
{% if include.right %} -

{{ include.right }}

+
{{ include.right }}
{% endif %}
diff --git a/_includes/jekyll-theme/posts/date.html b/_includes/jekyll-theme/posts/date.html index 4d36bd3..de7c4de 100644 --- a/_includes/jekyll-theme/posts/date.html +++ b/_includes/jekyll-theme/posts/date.html @@ -1,5 +1,5 @@ {% assign fmt = include.fmt %} {% unless fmt %} - {% assign fmt = "%F" %} + {% assign fmt = '%Y-%m-%d' %} {% endunless %} - {{ include.date | date: fmt }} + {{ include.date | date: fmt }} diff --git a/_includes/jekyll-theme/posts/header.html b/_includes/jekyll-theme/posts/header.html index d170ae9..4d648e7 100644 --- a/_includes/jekyll-theme/posts/header.html +++ b/_includes/jekyll-theme/posts/header.html @@ -1,11 +1,15 @@ {% assign header_date = null %} {% if include.date %} - {% capture header_date %}{%- include jekyll-theme/posts/date.html date=include.date monospace=true -%}{% endcapture %} + {% capture header_date %}

{%- include jekyll-theme/posts/date.html date=include.date monospace=true -%}

{% endcapture %} {% endif %} {% assign header_category = null %} {% if include.category %} - {% capture header_category %}{%- include jekyll-theme/categories/label.html category=include.category monospace=true -%}{% endcapture %} + {% capture header_category %} +

+ {%- include jekyll-theme/categories/label.html category=include.category monospace=true -%} +

+ {% endcapture %} {% endif %} {% capture header_title %}
{{ include.title }}
{% endcapture %} diff --git a/_layouts/post.html b/_layouts/post.html index dcf667a..e5d6197 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -8,7 +8,7 @@ layout: default {% capture category %}{%- include jekyll-theme/categories/label.html link=true category=page.category monospace=true -%} {% endcapture %} {% endif %} -{% capture date %}{{ category }}{{ date }}{% endcapture %} +{% capture date %}

{{ category }}{{ date }}

{% endcapture %} {% capture title %}

{{ page.title }}

{% endcapture %} diff --git a/assets/css/jekyll-theme/posts.css b/assets/css/jekyll-theme/posts.css index 1e0fc47..25d75ba 100644 --- a/assets/css/jekyll-theme/posts.css +++ b/assets/css/jekyll-theme/posts.css @@ -4,6 +4,14 @@ align-items: baseline; column-gap: 1.5em; } +@media(max-width: 480px) { + .flex-header { + column-gap: 1em; + } + .feed-entry .hide-on-mobile { + display: none; + } +} .flex-header-left, .flex-header-right { flex: none; -- cgit v1.2.3