Skip to content

Commit

Permalink
Move news share image headline truncation to CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
jerodsanto committed Jun 24, 2024
1 parent 29e5e59 commit b81cd93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 5 additions & 4 deletions assets/app/img.css
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ body {
var(--color-dark) 40%,
var(--primary) 100%
);
height: 630px;
margin: 0 auto 1rem;
width: 1200px;
height: 630px;
}

.inner {
Expand Down Expand Up @@ -279,10 +279,10 @@ Changelog News

.news-container {
background: var(--color-dark);
height: 630px;
margin: 0 auto 1rem;
position: relative;
width: 1200px;
height: 630px;
}

.news-fade {
Expand Down Expand Up @@ -321,6 +321,7 @@ Changelog News
}

.news-articles li {
display: flex;
gap: 1rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
3 changes: 1 addition & 2 deletions lib/changelog_web/views/news_view.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule ChangelogWeb.NewsView do
import ChangelogWeb.Helpers.SharedHelpers, only: [word_count: 1, md_to_text: 1, truncate: 2]
import ChangelogWeb.Helpers.SharedHelpers, only: [word_count: 1, md_to_text: 1]

alias Changelog.Regexp

Expand All @@ -13,7 +13,6 @@ defmodule ChangelogWeb.NewsView do
|> Enum.filter(&String.match?(&1, Regexp.top_story()))
|> Enum.map(&md_to_text(&1))
|> Enum.reject(fn s -> String.contains?(s, first) end)
|> Enum.map(&truncate(&1, 40))
end

def title(%{email_subject: subject, title: title}) do
Expand Down

0 comments on commit b81cd93

Please sign in to comment.