From 473177a150502ddadd49aff8d5e361e8cb9e6856 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 13 Jun 2023 10:05:05 -0400 Subject: [PATCH] [BSv5] Fix blog posts list flex layout (#1566) --- CHANGELOG.md | 14 +++++++++++--- assets/scss/_blog.scss | 18 +++++++++++++++++- layouts/blog/list.html | 42 +++++++++++++++++++++--------------------- 3 files changed, 49 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d414ab5da5..f614821aa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,16 +8,24 @@ Useful links: Docsy [releases][] & [tags][]. Jump to the [latest][] release. For a list of issues targeted for the next release, see the [23Q1][] milestone. -## [0.8.0][releases] - next planned release (unpublished yet) +## [0.8.0][releases] - next major release (unpublished yet) **New**: - - **Breaking changes**: +**Other changes**: +## [0.7.1][releases] - next planned release (unpublished yet) + +**Breaking changes**: none yet. **Other changes**: +- Followup changes to **Bootstrap (BS) 5.2 upgrade** ([#470]): + - `td-blog-posts-list__item` and `td-blog-posts-list__body` replace + the `.media` and `.media-body` classes, dropped by BS 5 [#1560]. + +[#1560]: https://github.com/google/docsy/issues/1560 + ## [0.7.0][] **New**: diff --git a/assets/scss/_blog.scss b/assets/scss/_blog.scss index c2ade693c7..6cc7d5dd60 100644 --- a/assets/scss/_blog.scss +++ b/assets/scss/_blog.scss @@ -9,4 +9,20 @@ display: none; @extend .d-lg-block; } -} + + &-posts-list { + @extend .list-unstyled; + margin-top: map-get($spacers, 4) !important; + + &__item { + display: flex; + align-items: flex-start; + margin-bottom: map-get($spacers, 4) !important; + + &__body { + flex: 1; + } + } + + } +} \ No newline at end of file diff --git a/layouts/blog/list.html b/layouts/blog/list.html index b3f54aa11d..2bdf7ef5a5 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -1,44 +1,44 @@ {{ define "main" }} -{{ if (and .Parent .Parent.IsHome) }} -{{ $.Scratch.Set "blog-pages" (where .Site.RegularPages "Section" .Section) }} -{{ else }} -{{$.Scratch.Set "blog-pages" .Pages }} -{{ end }} +{{ if (and .Parent .Parent.IsHome) -}} + {{ $.Scratch.Set "blog-pages" (where .Site.RegularPages "Section" .Section) -}} +{{ else -}} + {{$.Scratch.Set "blog-pages" .Pages -}} +{{ end -}}
- {{- if .Pages -}} - {{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006" )}} + {{ if .Pages -}} + {{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006" ) -}} {{ range $pag.PageGroups }}

{{ T "post_posts_in" }} {{ .Key }}

-
    +
      {{ range .Pages }} -
    • -
      +
    • +
      {{ .Title }}

      {{ .Date.Format ($.Param "time_format_blog") }} {{ T "ui_in"}} {{ .CurrentSection.LinkTitle }}

      - {{ partial "featured-image.html" (dict "p" . "w" 250 "h" 125 "class" "float-start me-3 pt-1 d-none d-md-block") }} + {{ partial "featured-image.html" (dict "p" . "w" 250 "h" 125 "class" "float-start me-3 pt-1 d-none d-md-block") -}}

      {{ .Plain | safeHTML | truncate 250 }}

      {{ T "ui_read_more"}}

    • - {{ end }} + {{ end -}}
    - {{ end }} + {{ end -}} {{ end }}
- {{ if .Pages }} - {{ template "_internal/pagination.html" . }} - {{ end }} + {{ if .Pages -}} + {{ template "_internal/pagination.html" . -}} + {{ end -}}
-{{ end }} \ No newline at end of file +{{ end -}}