Skip to content

Commit

Permalink
Add ability to change theme and primary color
Browse files Browse the repository at this point in the history
  • Loading branch information
thevahidal committed Dec 28, 2023
1 parent 2dff3c5 commit d32149d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name = "Vahid Al"
description = "Software Developer, Currently working on nothing"
keywords = "developer, python"
image = "me.jpeg"
theme = "dark"
primary_color = "#00897b"

[[sections]]
title = "Projects"
Expand Down
9 changes: 8 additions & 1 deletion script.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
h("meta", charset="utf-8"),
h("link", rel="stylesheet", href="css/pico.min.css"),
h("link", rel="stylesheet", href="css/style.css"),
h("style", rel="stylesheet")(
f"""
:root {{
--primary: {data.get("primary_color", "#546e7a")};
}}
"""
),
),
)

Expand Down Expand Up @@ -68,7 +75,7 @@
),
)

output = html(lang="en")(
output = html(lang="en", data_theme=data.get("theme", "dark"))(
head,
h("body")(
header,
Expand Down

0 comments on commit d32149d

Please sign in to comment.