Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ show_tags = true
# ["orange", "blue", "red", "green", "pink"]
theme_color = "orange"

# Whether or not to inline CSS in the generated HTML. Can provide
# a performance improvement for some sites.
# This is useful for sites where often only one page is visited by a user.
# In such a case, separately loading/caching the CSS provides no extra
# benefit, and slows down content rendering while waiting the CSS network
# request to start and finish.
inline_css = false

# Custom css to style over the defaults. This is useful when you only have a
# few small tweaks to make rather than a major rehaul to the theme.
# It would be best to make this a proper .sass or .scss file in sass/ rather
Expand Down
19 changes: 13 additions & 6 deletions templates/macros/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@
-#}

{% macro styling() %}
<link rel="stylesheet" href="{{ get_url(path="style.css") }}">
{% if config.extra.theme_color != "orange" -%}
{% set color = "color/" ~ config.extra.theme_color ~ ".css" -%}
<link rel="stylesheet" href="{{ get_url(path=color) }}">
{%- else -%}
<link rel="stylesheet" href=" {{ get_url(path="color/orange.css") }}">
{% if config.extra.inline_css -%}
{% set styleCSS = load_data(path="public/style.css", format="plain") -%}
<style>{{ styleCSS | trim | safe }}</style>
{% else %}
<link rel="stylesheet" href="{{ get_url(path="style.css") }}">
{% endif %}
{% set color = config.extra.theme_color | default(value="orange") -%}
{% set colorCSS = "color/" ~ color ~ ".css" -%}
{% if config.extra.inline_css -%}
{% set colorCSS = load_data(path="public/" ~ colorCSS, format="plain") -%}
<style>{{ colorCSS | trim | safe }}</style>
{% else -%}
<link rel="stylesheet" href="{{ get_url(path=colorCSS) }}">
{% endif %}
{%- if config.extra.custom_css is defined -%}
<link rel="stylesheet" href="{{ get_url(path="custom.css") }}">
Expand Down