forked from david-swift/duckling
Allow enabling KaTeX per page/section (fixes #89)
This commit is contained in:
parent
6b19540347
commit
b98775d61c
@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Allow enabling KaTeX per page/section.
|
||||
- Improve the logic of inclusion feeds in `<head>`.
|
||||
- Restly the heading anchors.
|
||||
|
||||
## Fixed
|
||||
|
||||
@ -127,7 +127,8 @@ show_read_time = true
|
||||
show_share_button = true
|
||||
# Whether to enable the KaTeX library for rendering LaTeX.
|
||||
# Note: This will make your page significantly heavier.
|
||||
katex = true
|
||||
# Instead, consider enabling it per page/section.
|
||||
# katex = true
|
||||
# Display outlines around all elements for debugging purposes
|
||||
# debug_layout = true
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
+++
|
||||
title = "Demo Page"
|
||||
[extra]
|
||||
katex = true
|
||||
archive = "This page is in fact not archived. It is only here to demonstrate the archival statement."
|
||||
trigger = "This page contains blackjack and hookers, and bad jokes such as this one."
|
||||
disclaimer = """
|
||||
|
||||
@ -10,15 +10,6 @@
|
||||
<title>{% include "partials/title.html" %}</title>
|
||||
<link rel="canonical" href="{{ current_url | default(value='/') | safe }}" />
|
||||
|
||||
{%- if config.markdown.highlight_code and config.markdown.highlight_theme == "css" %}
|
||||
{%- if config.markdown.highlight_themes_css | length > 0 %}
|
||||
<link type="text/css" rel="stylesheet" href="{{ get_url(path='syntax-theme-light.css') }}" media="(prefers-color-scheme: light)" />
|
||||
<link type="text/css" rel="stylesheet" href="{{ get_url(path='syntax-theme-dark.css') }}" media="(prefers-color-scheme: dark)" />
|
||||
{%- else %}
|
||||
<link type="text/css" rel="stylesheet" href="{{ get_url(path='syntax-theme.css') }}" />
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.comments %}
|
||||
<link rel="me" href="https://{{ config.extra.comments.host }}/@{{ config.extra.comments.user }}" />
|
||||
{%- endif %}
|
||||
@ -45,7 +36,7 @@
|
||||
{%- set styles = styles | concat(with=["fonts.css"]) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.katex %}
|
||||
{%- if page.extra.katex or section.extra.katex or config.extra.katex %}
|
||||
{%- set styles = styles | concat(with=["katex.css"]) %}
|
||||
{%- endif %}
|
||||
|
||||
@ -63,6 +54,15 @@
|
||||
<link type="text/css" rel="stylesheet" href="{{ get_url(path=style) | safe }}" />
|
||||
{%- endfor %}
|
||||
|
||||
{%- if config.markdown.highlight_code and config.markdown.highlight_theme == "css" %}
|
||||
{%- if config.markdown.highlight_themes_css | length > 0 %}
|
||||
<link type="text/css" rel="stylesheet" href="{{ get_url(path='syntax-theme-light.css') }}" media="(prefers-color-scheme: light)" />
|
||||
<link type="text/css" rel="stylesheet" href="{{ get_url(path='syntax-theme-dark.css') }}" media="(prefers-color-scheme: dark)" />
|
||||
{%- else %}
|
||||
<link type="text/css" rel="stylesheet" href="{{ get_url(path='syntax-theme.css') }}" />
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.show_copy_button %}
|
||||
{%- include "partials/copy_button.html" %}
|
||||
{%- endif %}
|
||||
@ -73,7 +73,7 @@
|
||||
{%- set scripts = scripts | concat(with=["count.js"]) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.katex %}
|
||||
{%- if page.extra.katex or section.extra.katex or config.extra.katex %}
|
||||
{%- set scripts = scripts | concat(with=["katex.min.js", "auto-render.min.js"]) %}
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user