Skip to content

Commit

Permalink
Improve aeon [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ping committed Jun 18, 2023
1 parent 2580475 commit b35e79a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions recipes/aeon.recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ def preprocess_raw_html_(self, raw_html, url):
date_ele = soup.new_tag("div", attrs={"class": "custom-date-published"})
date_ele.append(f"{published_date:{get_date_format()}}")
header.insert_after(date_ele)

# re-position header image
essay_header = soup.find(
"div", class_=lambda c: c and c.startswith("article__EssayHeader-sc-")
)
if essay_header:
header_img = essay_header.find("img")
attribution = essay_header.find(
"div",
class_=lambda c: c
and c.startswith("styled__ThumbnailAttributionWrapper-sc-"),
)
if header_img and attribution:
attribution.insert_before(header_img.extract())
return str(soup)

def parse_feeds(self):
Expand Down

0 comments on commit b35e79a

Please sign in to comment.