From 8b4655a17f724cb624e15adaa737c64bd1087ac1 Mon Sep 17 00:00:00 2001 From: Natalia Date: Thu, 4 Nov 2021 16:00:28 +0100 Subject: [PATCH 1/4] Style medium articles section in news page --- config.rb | 2 +- .../partials/_card-medium-elements.html.slim | 36 +++---------------- source/partials/_medium-elements.html.slim | 2 +- 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/config.rb b/config.rb index b23f6432ad..ce4885d621 100644 --- a/config.rb +++ b/config.rb @@ -53,7 +53,7 @@ def retry_on_error(limit: 5) token: ENV.fetch("DATO_API_TOKEN"), live_reload: true, preview: ENV.fetch("BUILD_ENV") != "production", - environment: DATO_ENV + environment: ENV.fetch("DATO_ENV") end webpack_command = diff --git a/source/partials/_card-medium-elements.html.slim b/source/partials/_card-medium-elements.html.slim index f9b3871b05..38018d22b2 100644 --- a/source/partials/_card-medium-elements.html.slim +++ b/source/partials/_card-medium-elements.html.slim @@ -1,32 +1,6 @@ - article ||= nil - if article.present? - ruby: - owners = [] - article.owners.each do |owner| - if owner.respond_to?(:title) && owner.title.present? - owners << owner.title - end - end - authors = case owners.length - when 0 - "" - when 1 - if owners[0].downcase.start_with?("la") - "della #{owners[0].slice(3..-1)}" - else - "di #{owners[0]}" - end - when 2 - if owners[0].downcase.start_with?("la") - "della #{owners[0].slice(3..-1)} e #{owners[-1]}" - else - "di #{owners[0..-2]} e #{owners[-1]}" - end - else - "di #{owners[0..-2].join(', ')} e #{owners[-1]}" - end - .card-wrapper .card.card-img.no-after.rounded.shadow-lg .img-responsive-wrapper @@ -67,15 +41,15 @@ class: "lazyload d-block w-100", alt: article.image_thumbnail.alt - .card-body.mb-4.d-flex.flex-column.justify-content-between.mt-n5 + .card-body.d-flex.flex-column.justify-content-between.mt-n5 .px-4 - h4.text-primary.card-title + h4.h5.font-weight-bold.text-primary.card-title = proxy_link_to article.link_medium.link, class: "text-decoration-none" = article.title - .h6.text-black.mt-2 - = authors - .my-5 + .mid-caption--large.font-weight-semibold.mt-2 + = article.author + .my-2 .d-flex.flex-wrap-reverse.flex-row-reverse.align-items-end - if article.tags.present? - article.tags.each do |tag| diff --git a/source/partials/_medium-elements.html.slim b/source/partials/_medium-elements.html.slim index 0925471ee4..e99f359c6a 100644 --- a/source/partials/_medium-elements.html.slim +++ b/source/partials/_medium-elements.html.slim @@ -18,7 +18,7 @@ .row.pb-5 .col-12.my-3.mt-lg-5.text-center - button.btn.btn-sm.btn-outline-primary.btn-icon.text-uppercase + button.btn.btn-sm.btn-outline-primary.mid-button-medium.btn-icon.text-uppercase = proxy_link_to dato.company.medium_url, class: "text-decoration-none align-middle" .d-inline-block.pr-3 From 320b0cd028502ab3f46107a49241621dcd963665 Mon Sep 17 00:00:00 2001 From: Natalia Date: Fri, 5 Nov 2021 12:12:20 +0100 Subject: [PATCH 2/4] Update yarn, node, ruby and gems --- .tool-versions | 6 +- Gemfile | 3 +- Gemfile.lock | 154 +++++++++++++++++++++++++++---------------------- config.rb | 1 - 4 files changed, 89 insertions(+), 75 deletions(-) diff --git a/.tool-versions b/.tool-versions index 35e31bf9f9..51bb175f71 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -nodejs 10.21.0 -yarn 1.22.10 -ruby 2.7.1 +nodejs 16.13.0 +yarn 1.22.15 +ruby 2.7.3 diff --git a/Gemfile b/Gemfile index 641f282877..6175485907 100644 --- a/Gemfile +++ b/Gemfile @@ -4,13 +4,12 @@ source "https://rubygems.org" gem "activesupport" gem "html_truncator" -gem "middleman", "~> 4.2" +gem "middleman", "~> 4.4" gem "middleman-dato" gem "middleman-livereload" gem "middleman-minify-html" gem "middleman-paginate" gem "middleman-search_engine_sitemap" -gem "middleman-svg" gem "pry" gem "redcarpet" gem "slim" diff --git a/Gemfile.lock b/Gemfile.lock index ec7383a170..a9cd76705e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,25 +1,26 @@ GEM remote: https://rubygems.org/ specs: - activesupport (5.1.7) + activesupport (6.1.4.1) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - addressable (2.7.0) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) - ast (2.4.1) - backports (3.18.2) + ast (2.4.2) + backports (3.21.0) builder (3.2.4) - cacert (0.5.0) + cacert (0.6.0) coderay (1.1.3) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.7) + concurrent-ruby (1.1.9) contracts (0.13.0) - dato (0.7.18) + dato (0.8.1) activesupport (>= 4.2.7) addressable cacert @@ -40,16 +41,32 @@ GEM http_parser.rb (~> 0.6.0) erubis (2.7.0) eventmachine (1.2.7) - execjs (2.7.0) - faraday (1.1.0) + execjs (2.8.1) + faraday (1.8.0) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0.1) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.1) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) multipart-post (>= 1.2, < 3) - ruby2_keywords - faraday_middleware (1.0.0) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday_middleware (1.2.0) faraday (~> 1.0) - fast_blank (1.0.0) - fastimage (2.2.0) - ffi (1.13.1) - haml (5.2.1) + fast_blank (1.0.1) + fastimage (2.2.5) + ffi (1.15.4) + haml (5.2.2) temple (>= 0.8.0) tilt hamster (3.0.0) @@ -59,10 +76,10 @@ GEM nokogiri (~> 1.5) htmlcompressor (0.2.0) http_parser.rb (0.6.0) - i18n (0.9.5) + i18n (1.6.0) concurrent-ruby (~> 1.0) - imgix (4.0.0) - json (2.3.1) + imgix (4.0.3) + json (2.6.1) kramdown (2.3.1) rexml listen (3.0.8) @@ -70,19 +87,19 @@ GEM rb-inotify (~> 0.9, >= 0.9.7) memoist (0.16.2) method_source (1.0.0) - middleman (4.3.11) + middleman (4.4.2) coffee-script (~> 2.2) haml (>= 4.0.5) kramdown (>= 2.3.0) - middleman-cli (= 4.3.11) - middleman-core (= 4.3.11) - middleman-cli (4.3.11) + middleman-cli (= 4.4.2) + middleman-core (= 4.4.2) + middleman-cli (4.4.2) thor (>= 0.17.0, < 2.0) - middleman-core (4.3.11) - activesupport (>= 4.2, < 6.0) - addressable (~> 2.3) + middleman-core (4.4.2) + activesupport (>= 6.1, < 7.0) + addressable (~> 2.4) backports (~> 3.6) - bundler + bundler (~> 2.0) contracts (~> 0.13.0) dotenv erubis @@ -91,22 +108,24 @@ GEM fastimage (~> 2.0) hamster (~> 3.0) hashie (~> 3.4) - i18n (~> 0.9.0) + i18n (~> 1.6.0) listen (~> 3.0.0) memoist (~> 0.14) - padrino-helpers (~> 0.13.0) + padrino-helpers (~> 0.15.0) parallel rack (>= 1.4.5, < 3) sassc (~> 2.0) servolux tilt (~> 2.0.9) + toml uglifier (~> 3.0) + webrick middleman-dato (0.10.0) activesupport dato (>= 0.7.16) dotenv (<= 2.1) middleman-core (>= 4.1.10) - middleman-livereload (3.4.6) + middleman-livereload (3.4.7) em-websocket (~> 0.5.1) middleman-core (>= 3.3) rack-livereload (~> 0.3.15) @@ -118,79 +137,77 @@ GEM middleman-search_engine_sitemap (1.4.0) builder middleman-core (~> 4.0) - middleman-svg (0.2.1) - activesupport (>= 4.2, < 5.2) - middleman-core (~> 4.0, >= 4.0.0) - nokogiri (~> 1.6, >= 1.6) mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2020.1104) - mini_portile2 (2.4.0) - minitest (5.14.2) + mime-types-data (3.2021.0901) + mini_portile2 (2.6.1) + minitest (5.14.4) multipart-post (2.1.1) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) - padrino-helpers (0.13.3.4) - i18n (~> 0.6, >= 0.6.7) - padrino-support (= 0.13.3.4) + nokogiri (1.12.5) + mini_portile2 (~> 2.6.1) + racc (~> 1.4) + padrino-helpers (0.15.1) + i18n (>= 0.6.7, < 2) + padrino-support (= 0.15.1) tilt (>= 1.4.1, < 3) - padrino-support (0.13.3.4) - activesupport (>= 3.1) - parallel (1.20.1) - parser (3.0.0.0) + padrino-support (0.15.1) + parallel (1.21.0) + parser (3.0.2.0) ast (~> 2.4.1) - parslet (1.8.2) - pry (0.13.1) + parslet (2.0.0) + pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) public_suffix (4.0.6) pusher-client (0.6.2) json websocket (~> 1.0) + racc (1.6.0) rack (2.2.3) rack-livereload (0.3.17) rack rainbow (3.0.0) - rb-fsevent (0.10.4) + rb-fsevent (0.11.0) rb-inotify (0.10.1) ffi (~> 1.0) redcarpet (3.5.1) - regexp_parser (2.0.3) - rexml (3.2.4) - rubocop (1.8.1) + regexp_parser (2.1.1) + rexml (3.2.5) + rubocop (1.22.3) parallel (~> 1.10) parser (>= 3.0.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml - rubocop-ast (>= 1.2.0, < 2.0) + rubocop-ast (>= 1.12.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.4.0) - parser (>= 2.7.1.5) + rubocop-ast (1.12.0) + parser (>= 3.0.1.1) ruby-progressbar (1.11.0) - ruby2_keywords (0.0.2) + ruby2_keywords (0.0.5) sassc (2.4.0) ffi (~> 1.9) servolux (0.13.0) slim (4.1.0) temple (>= 0.7.6, < 0.9) tilt (>= 2.0.6, < 2.1) - slim_lint (0.20.2) + slim_lint (0.22.1) rubocop (>= 0.78.0) slim (>= 3.0, < 5.0) temple (0.8.2) - thor (1.0.1) - thread_safe (0.3.6) + thor (1.1.0) tilt (2.0.10) - toml (0.2.0) - parslet (~> 1.8.0) - tzinfo (1.2.8) - thread_safe (~> 0.1) + toml (0.3.0) + parslet (>= 1.8.0, < 3.0.0) + tzinfo (2.0.4) + concurrent-ruby (~> 1.0) uglifier (3.2.0) execjs (>= 0.3.0, < 3) - unicode-display_width (2.0.0) - websocket (1.2.8) + unicode-display_width (2.1.0) + webrick (1.7.0) + websocket (1.2.9) + zeitwerk (2.5.1) PLATFORMS ruby @@ -198,13 +215,12 @@ PLATFORMS DEPENDENCIES activesupport html_truncator - middleman (~> 4.2) + middleman (~> 4.4) middleman-dato middleman-livereload middleman-minify-html middleman-paginate middleman-search_engine_sitemap - middleman-svg pry redcarpet slim diff --git a/config.rb b/config.rb index ce4885d621..bcc68b74be 100644 --- a/config.rb +++ b/config.rb @@ -24,7 +24,6 @@ activate :asset_hash activate :directory_indexes activate :pagination -activate :inline_svg RETRY_CLASSES = [ Faraday::ClientError, From 47f90ce9160ed70f6260d5312567f00949622708 Mon Sep 17 00:00:00 2001 From: Natalia Date: Fri, 5 Nov 2021 12:13:25 +0100 Subject: [PATCH 3/4] Style medium articles section in news page --- .../partials/_card-medium-elements.html.slim | 2 +- source/partials/_medium-elements.html.slim | 19 +++++++++++-------- source/stylesheets/custom/_mid-button.scss | 4 ++++ source/templates/news.html.slim | 4 ++-- 4 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 source/stylesheets/custom/_mid-button.scss diff --git a/source/partials/_card-medium-elements.html.slim b/source/partials/_card-medium-elements.html.slim index 38018d22b2..cabc344fc6 100644 --- a/source/partials/_card-medium-elements.html.slim +++ b/source/partials/_card-medium-elements.html.slim @@ -42,7 +42,7 @@ alt: article.image_thumbnail.alt .card-body.d-flex.flex-column.justify-content-between.mt-n5 - .px-4 + div h4.h5.font-weight-bold.text-primary.card-title = proxy_link_to article.link_medium.link, class: "text-decoration-none" diff --git a/source/partials/_medium-elements.html.slim b/source/partials/_medium-elements.html.slim index e99f359c6a..3f5a9c7006 100644 --- a/source/partials/_medium-elements.html.slim +++ b/source/partials/_medium-elements.html.slim @@ -1,28 +1,31 @@ - if dato.news_page.medium_articles.present? - .d-lg-flex - .mr-lg-auto.p-2 + .d-lg-flex.mb-lg-0.pb-lg-0 + .mr-lg-auto = partial "partials/section-title", locals: {title: t("medium_articles")} - .p-2 + .p-1 svg.icon use xlink:href="/images/sprite.svg#it-external-link" span.d-lg-none.px-2 = "Link esterni" - .p-2.px-2.d-none.d-lg-block + .pt-2.pl-2.d-none.d-lg-block = "Link esterni" - .row.mt-4.mt-lg-5.mx-n4 + .row.mt-4.mx-n4 - dato.news_page.medium_articles[0..2].map do |article| .col-lg-4.px-4 = partial "partials/card-medium-elements", locals: {article: article} .row.pb-5 .col-12.my-3.mt-lg-5.text-center - button.btn.btn-sm.btn-outline-primary.mid-button-medium.btn-icon.text-uppercase + button.btn.btn-sm.py-2.btn-outline-primary.mid-button-medium.btn-icon.text-uppercase = proxy_link_to dato.company.medium_url, class: "text-decoration-none align-middle" .d-inline-block.pr-3 - h6.font-weight-bold = t("medium") - span + p.mb-0.mid-caption--large.font-weight-bold = t("medium") + span.d-none.d-lg-inline svg.icon.icon-lg.icon-primary use xlink:href="/images/sprite.svg#it-medium" + span.d-lg-none + svg.icon.icon-sm.icon-primary.align-top + use xlink:href="/images/sprite.svg#it-medium" diff --git a/source/stylesheets/custom/_mid-button.scss b/source/stylesheets/custom/_mid-button.scss new file mode 100644 index 0000000000..7c43902c11 --- /dev/null +++ b/source/stylesheets/custom/_mid-button.scss @@ -0,0 +1,4 @@ +.mid-button-medium { + box-shadow: inset 0 0 0 2px #0066cc; + padding: 5px 20px; +} diff --git a/source/templates/news.html.slim b/source/templates/news.html.slim index 1773e86a08..69d3939c55 100644 --- a/source/templates/news.html.slim +++ b/source/templates/news.html.slim @@ -22,7 +22,7 @@ large_title: true, btn_url: dato.articles_index} - .col-lg-4.offset-lg-1.pl-lg-4.mb-3.my-lg-0.mid-border-lg-left.pt-lg-5 + .col-lg-4.offset-lg-1.pl-lg-4.mb-lg-3.mid-border-lg-left.pt-lg-5 = partial "partials/cards-vertical-list", locals: {title: t("press_releases_section_title"), items: page.press_releases, @@ -37,5 +37,5 @@ btn_url: dato.interviews_index} - if dato.news_page.medium_articles.any? - .py-5 + .py-lg-5 = partial "partials/medium-elements" From 8c62ed497815eba18ed771d28a17cdc05367c566 Mon Sep 17 00:00:00 2001 From: Natalia Date: Fri, 5 Nov 2021 18:29:48 +0100 Subject: [PATCH 4/4] Show title, subtitle and image in tag detail page if present --- source/templates/tag.html.slim | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/source/templates/tag.html.slim b/source/templates/tag.html.slim index beb91a34cc..bd780be8b5 100644 --- a/source/templates/tag.html.slim +++ b/source/templates/tag.html.slim @@ -3,13 +3,13 @@ - content_for(:head) == proxy_dato_meta_tags(page) -.mb-5 - .container.pb-5.text-center.text-sm-left +.mb-3 + .container.pb-md-5.text-center.text-sm-left .row .col-12 = partial "partials/breadcrumb", locals: {page: page} - .col-md-7 + .col-md-7.offset-lg-1 h1.font-weight-bold = page.name .offset-lg-1.col-md-4.mt-5.m-md-0 @@ -33,6 +33,14 @@ span.font-weight-semibold.mr-0 = dato.explore_page.title + = if page.title.present? + .row + .offset-lg-1.col-lg-6.col-md-8.mb-0 + = partial "partials/headers/main-titles", locals: {page: page} + += partial "partials/page-cover", + locals: {page: page} + .container .border-bottom