Skip to content

Commit

Permalink
allow newlines in titles
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-ni committed Nov 20, 2023
1 parent 1c944c6 commit 95f6973
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion content/news/2023-11-16_bmmt-2024-date-set.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "BmMT 2024 will be on April 6, 2024 • BMT 2024 will be on November 2, 2024"
title = "BmMT 2024 will be held on April 6, 2024\nBMT 2024 will be held on November 2, 2024"
+++

We are excited to announce that this year’s Berkeley mini Math Tournament (BmMT)
Expand Down
4 changes: 3 additions & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<i class="bi bi-megaphone-fill"></i>
<span>News</span>
</p>
<p class="text-base font-medium">{{ title }}</p>
<p class="text-base font-medium">
{{ title | split(pat="\n") | join(sep=" • ") }}
</p>
</div>

<i class="bi bi-chevron-right"></i>
Expand Down
7 changes: 7 additions & 0 deletions templates/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@
{% macro index_math() %}
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>F</mi><mo stretchy="false">(</mo><mi>z</mi><mo stretchy="false">)</mo><mo>=</mo><munderover><mo></mo><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal"></mi></munderover><msub><mi>f</mi><mi>n</mi></msub><mfrac><msup><mi>z</mi><mi>n</mi></msup><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow></mfrac></mrow><annotation encoding="application/x-tex">F(z) = \sum_{n=0}^\infty f_n \frac{z^n}{n!}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height: 1em; vertical-align: -0.25em;"></span><span class="mord mathnormal" style="margin-right: 0.1389em;">F</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right: 0.044em;">z</span><span class="mclose">)</span><span class="mspace" style="margin-right: 0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right: 0.2778em;"></span></span><span class="base"><span class="strut" style="height: 2.9185em; vertical-align: -1.2671em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.6514em;"><span class="" style="top: -1.8829em; margin-left: 0em;"><span class="pstrut" style="height: 3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">n</span><span class="mrel mtight">=</span><span class="mord mtight">0</span></span></span></span><span class="" style="top: -3.05em;"><span class="pstrut" style="height: 3.05em;"></span><span class=""><span class="mop op-symbol large-op"></span></span></span><span class="" style="top: -4.3em; margin-left: 0em;"><span class="pstrut" style="height: 3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"></span></span></span></span><span class="vlist-s">&ZeroWidthSpace;</span></span><span class="vlist-r"><span class="vlist" style="height: 1.2671em;"><span class=""></span></span></span></span></span><span class="mspace" style="margin-right: 0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right: 0.1076em;">f</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 0.1514em;"><span class="" style="top: -2.55em; margin-left: -0.1076em; margin-right: 0.05em;"><span class="pstrut" style="height: 2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s">&ZeroWidthSpace;</span></span><span class="vlist-r"><span class="vlist" style="height: 0.15em;"><span class=""></span></span></span></span></span></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.3414em;"><span class="" style="top: -2.314em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="mclose">!</span></span></span><span class="" style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span class="" style="top: -3.677em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right: 0.044em;">z</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height: 0.6644em;"><span class="" style="top: -3.063em; margin-right: 0.05em;"><span class="pstrut" style="height: 2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s">&ZeroWidthSpace;</span></span><span class="vlist-r"><span class="vlist" style="height: 0.686em;"><span class=""></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span>
{% endmacro index_math%}

{% macro newline_break(str) %}
{% for line in str | split(pat="\n") %}
{{ line }}
{% if not loop.last %}<br>{% endif %}
{% endfor %}
{% endmacro newline_break %}
4 changes: 3 additions & 1 deletion templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
{% block content %}

<div class="flex flex-col gap-3">
<h1 class="text-3xl font-semibold">{{ page.title }}</h1>
<h1 class="text-3xl font-semibold">
{{ macros::newline_break(str=page.title) }}
</h1>

{% if page.date %}
<h2 class="text-xl">
Expand Down
8 changes: 6 additions & 2 deletions templates/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
{# =================== #}

<div class="flex flex-col gap-3">
<h1 class="text-4xl font-semibold">{{ section.title }}</h1>
<h1 class="text-4xl font-semibold">
{{ macros::newline_break(str=section.title) }}
</h1>
</div>

{# ==================== #}
Expand Down Expand Up @@ -45,7 +47,9 @@ <h2 class="mt-4 col-span-2 text-sm text-gray-400">{{ year }}</h2>
</p>

<p class="text-xl">
<a href="{{ page.permalink | safe }}">{{ page.title }}</a>
<a href="{{ page.permalink | safe }}">
{{ macros::newline_break(str=page.title) }}
</a>
</p>
{% endfor %}

Expand Down

0 comments on commit 95f6973

Please sign in to comment.