Skip to content

Commit

Permalink
Fix image meta tag issue
Browse files Browse the repository at this point in the history
  • Loading branch information
thevahidal committed Jan 11, 2024
1 parent 715b7e8 commit ed4540b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ To customize your website, follow these steps:
- `primary_color`: Specify your website's primary color using a hexadecimal color code (e.g., "#00897b")
- `text_align`: Specify the text alignment for your website: "right", "left" or "center" (e.g., "center")
- `gtag_id`: Your Google Analytics tracking ID (e.g., "G-33WB8LVHR6")
- `base_url`: The base URL for your website, mentioned in **1. Create a Repository** step (e.g., https://thevahidal.github.io/jake)

#### Sections

Expand Down
1 change: 1 addition & 0 deletions data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ theme = "dark"
primary_color = "#d81b60"
text_align = "center"
gtag_id = "G-33WB8LVHR6"
base_url = "https://thevahidal.github.io/jake"

[[sections]]
title = "Movies"
Expand Down
18 changes: 13 additions & 5 deletions script.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,20 @@
# OG
h("meta", property="og:title", content=data.get("name")),
h("meta", property="og:description", content=data.get("description")),
h("meta", property="og:image", content=f"img/{data.get('image')}"),
h(
"meta",
property="og:image",
content=f"{data.get('base_url')}/img/{data.get('image')}",
),
# Twitter / X
h("meta", property="twitter:title", content=data.get("name")),
h("meta", property="twitter:description", content=data.get("description")),
h("meta", property="twitter:image", content=f"img/{data.get('image')}"),
h("meta", property="twitter:card", content="summary_large_image"),
h("meta", name="twitter:title", content=data.get("name")),
h("meta", name="twitter:description", content=data.get("description")),
h(
"meta",
name="twitter:image",
content=f"{data.get('base_url')}/img/{data.get('image')}",
),
h("meta", name="twitter:card", content="summary_large_image"),
)

head = frag(
Expand Down

0 comments on commit ed4540b

Please sign in to comment.