From 90a957081ccc9d7b0d035975472f30e258a2ef53 Mon Sep 17 00:00:00 2001 From: SMT <83726258+scottmakestech@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:10:28 -0600 Subject: [PATCH 1/3] Work on the ability to embed the newsletter form at the end of a blog post. --- content/en/post/2025-01-17-blog-embed-example.md | 11 +++++++++++ layouts/_default/baseof.html | 3 --- layouts/_default/single.html | 6 +++--- layouts/partials/footer.html | 13 ++++++++++++- layouts/partials/newsletter-embed.html | 8 ++++++++ layouts/partials/newsletter-form.html | 15 ++++++++++++--- src/css/main.scss | 6 ++++++ 7 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 content/en/post/2025-01-17-blog-embed-example.md create mode 100644 layouts/partials/newsletter-embed.html diff --git a/content/en/post/2025-01-17-blog-embed-example.md b/content/en/post/2025-01-17-blog-embed-example.md new file mode 100644 index 0000000000..b2c0dfd0e8 --- /dev/null +++ b/content/en/post/2025-01-17-blog-embed-example.md @@ -0,0 +1,11 @@ +--- +author: Let's Encrypt +date: 2025-01-16T00:00:00Z +slug: blog-embed-example +title: "Embed example" +excerpt: "Example" +display_default_footer: true +display_newsletter_embed: true +--- + +This blog post is an example of how the newsletter embed can be added after the main text. \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index c72ff59bf4..7d00250dab 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -16,9 +16,6 @@ {{ partial "header" . }} {{ block "main" . }}{{ end }} - {{ if .Page.Params.should_display_prominent_newsletter_form }} - {{ partial "newsletter-form" . }} - {{ end }} {{ partial "footer" . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 30cc9fd41c..e481700bef 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -29,7 +29,7 @@ {{- range .Page.Translations -}} {{- if eq "en" .Language.Lang -}} {{- $currentpage_en := .Page -}} - + {{- if.Page.Params.show_lastmod -}} {{- partial "lastmod" . -}} {{- end -}} @@ -81,11 +81,11 @@ {{- i18n "english_is_canonical" | safeHTML -}} {{- end -}} - + {{- if.Page.Params.show_lastmod -}} {{- partial "lastmod" . -}} {{- end -}} - + {{- partial "outdated_translation" . -}} {{- $scratch := newScratch -}} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 4ba4ab73a1..1c3901a028 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,3 +1,12 @@ +{{ if and (ne .Section "documents") (.Page.Params.display_newsletter_embed) }} +
+
+ {{ partial "newsletter-form" . }} +
+
+{{ end }} + + {{ if and (ne .Section "docs") (ne .Section "documents") (not .Params.no_donate_footer) }} - - diff --git a/src/css/_layout.scss b/src/css/_layout.scss index 7dcc8c5eee..099117d480 100644 --- a/src/css/_layout.scss +++ b/src/css/_layout.scss @@ -299,50 +299,17 @@ html[dir="rtl"] .social-media-list { .footer-col-wrapper { font-size: 15px; color: $text-color; - margin-left: -$spacing-unit / 2; - @extend %clearfix; -} + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: $spacing-unit; -.footer-col { - float: left; - margin-bottom: $spacing-unit / 2; - padding-left: $spacing-unit / 2; -} - -/* 2 Column Version -.footer-col-1 { - width: -webkit-calc(35% - (#{$spacing-unit} / 2)); - width: calc(35% - (#{$spacing-unit} / 2)); -} - -.footer-col-2 { - width: -webkit-calc(65% - (#{$spacing-unit} / 2)); - width: calc(65% - (#{$spacing-unit} / 2)); -} - -@include media-query($on-laptop) { - .footer-col-1, - .footer-col-2 { - width: -webkit-calc(50% - (#{$spacing-unit} / 2)); - width: calc(50% - (#{$spacing-unit} / 2)); + @include media-query($on-palm) { + grid-template-columns: 1fr; } } -*/ - -// 3 column version - -.footer-col-1 { - width: -webkit-calc(25% - (#{$footer-spacing-unit} / 3)); - width: calc(25% - (#{$footer-spacing-unit} / 3)); -} -.footer-col-2 { - width: -webkit-calc(40% - (#{$footer-spacing-unit} / 3)); - width: calc(40% - (#{$footer-spacing-unit} / 3)); -} -.footer-col-3 { - width: -webkit-calc(33.3% - (#{$footer-spacing-unit} / 3)); - width: calc(33.3% - (#{$footer-spacing-unit} / 3)); +.footer-col { + margin-bottom: $spacing-unit / 2; } .footer-newsletter-col { @@ -360,25 +327,6 @@ html[dir="rtl"] .social-media-list { } } -@include media-query($on-laptop) { - .footer-col-1, - .footer-col-2, - .footer-col-3 { - width: -webkit-calc(33.3% - (#{$footer-spacing-unit} / 3)); - width: calc(33.3% - (#{$footer-spacing-unit} / 3)); - } -} - -@include media-query($on-palm) { - .footer-col { - float: none; - width: -webkit-calc(100% - (#{$footer-spacing-unit} / 3)); - width: calc(100% - (#{$footer-spacing-unit} / 3)); - } -} - - - /** * Page content */ From 0aa4dd0a813a19236878901c71211203bb000031 Mon Sep 17 00:00:00 2001 From: SMT <83726258+scottmakestech@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:30:16 -0600 Subject: [PATCH 3/3] Remove example --- content/en/post/2025-01-17-blog-embed-example.md | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 content/en/post/2025-01-17-blog-embed-example.md diff --git a/content/en/post/2025-01-17-blog-embed-example.md b/content/en/post/2025-01-17-blog-embed-example.md deleted file mode 100644 index b2c0dfd0e8..0000000000 --- a/content/en/post/2025-01-17-blog-embed-example.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -author: Let's Encrypt -date: 2025-01-16T00:00:00Z -slug: blog-embed-example -title: "Embed example" -excerpt: "Example" -display_default_footer: true -display_newsletter_embed: true ---- - -This blog post is an example of how the newsletter embed can be added after the main text. \ No newline at end of file