{%- macro icon_link_button(icon, fb_text, link, args="") -%} {{- fb_text -}} {%- endmacro -%} {%- macro copy_button(name, link) -%}
Copy
{%- endmacro -%} {%- macro settings_option(option_name) -%}
{{ switch(option_name) }}{{ caller() }} {%- endmacro -%} {%- macro icon(name, fallback) -%} {{ fallback }} {%- endmacro -%} {%- macro invert_theme_button() -%} {%- set mode = THEME_MODES[not g.dark_mode] -%} {%- set class = ("button", "theme-apply", "icon", g.theme, mode) | join(" ") -%} {%- macro args() -%} id="invert-theme-button" class="{{ class }}" title="Invert theme" {%- endmacro -%} {%- if g.use_js -%}
Aa
{%- else -%}
{%- endif -%} {%- endmacro -%} {%- macro set_theme_button(theme, mode) -%} {%- set class = ("button", "theme-apply", theme, mode) | join(" ") -%} {%- set dark_mode = to_bool_str(THEME_MODES.index(mode)) -%} {%- if g.use_js -%}
Aa
{%- else -%}
{%- endif -%} {%- endmacro -%} {%- macro switch(option) -%} {%- set checked = "checked" if g[option] else "" -%} {%- if g.use_js -%} {%- else -%}
{%- endif -%} {%- endmacro -%} {%- macro breadcrumbs() -%} {%- endmacro -%} {%- macro folder_file_list() -%}
{{- icon("drive_file_move_rtl", FOLDER_EMOJI) -}} .. {%- for file in g.rpath.files -%} {%- if file.is_dir() -%} {{ icon("folder", FOLDER_EMOJI) }} {%- else -%} {{ icon("description", FILE_EMOJI) }} {%- endif -%} {{- file.name -}} {%- endfor -%}
{%- endmacro -%} {%- macro article_preview_block(articles_path="articles") -%}
{%- for article in get_articles(articles_path) -%} {{ article.include() }} {%- endfor -%}
{%- endmacro -%} {%- macro raw_link_buttons() -%} {{ icon_link_button("file_download", "Download", g.rpath.raw_path, "download") }} {{ icon_link_button("link", "Direct link", g.rpath.raw_path) }} {%- endmacro -%}