Skip to content

Commit

Permalink
Update rules to show full content image
Browse files Browse the repository at this point in the history
  • Loading branch information
jocmp committed Jan 21, 2025
1 parent ca96075 commit 1178273
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
12 changes: 9 additions & 3 deletions article_forge/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@
article_url = params["article_url"]
article_content = JSON.parse(`cd ../../mercury-parser && npx mercury-parser #{article_url}`)

published = Time.parse(article_content["date_published"]).strftime("%B %-d, %Y at %I:%M %p")

liquid :template, locals: {
title: article_content["title"],
byline: "#{article_content["author"]} on #{published}",
byline: "#{article_content["author"]}#{published(article_content["date_published"])}",
external_link: article_url,
feed_name: article_content["domain"],
body: article_content["content"],
Expand Down Expand Up @@ -59,3 +57,11 @@
unvisited_link: "https://example.com/#{SecureRandom.uuid}"
}.merge(colors)
end

def published(timestamp)
return "" if !timestamp

published = Time.parse(article_content["date_published"]).strftime("%B %-d, %Y at %I:%M %p")

"on #{published}"
end
5 changes: 2 additions & 3 deletions article_forge/public/assets/full-content.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions capy/src/main/assets/full-content.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1178273

Please sign in to comment.