Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/medium articles #159

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
154 changes: 85 additions & 69 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand All @@ -59,30 +76,30 @@ 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)
rb-fsevent (~> 0.9, >= 0.9.4)
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
Expand All @@ -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)
Expand All @@ -118,93 +137,90 @@ 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

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
Expand Down
3 changes: 1 addition & 2 deletions config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
activate :asset_hash
activate :directory_indexes
activate :pagination
activate :inline_svg

RETRY_CLASSES = [
Faraday::ClientError,
Expand Down Expand Up @@ -53,7 +52,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 =
Expand Down
38 changes: 6 additions & 32 deletions source/partials/_card-medium-elements.html.slim
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
.px-4
h4.text-primary.card-title
.card-body.d-flex.flex-column.justify-content-between.mt-n5
div
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|
Expand Down
Loading