mirror of
https://github.com/matrix-org/matrix.org.git
synced 2026-01-11 20:07:22 +00:00
Improve display logic for banner (#3036)
* Restructure the banner options in config.toml Signed-off-by: Jack S. <181536874+awtj8o81ryywg793@users.noreply.github.com> * Remove reference to the false setting in the config.extra.banner comment Signed-off-by: Jack S. <181536874+awtj8o81ryywg793@users.noreply.github.com> * Set the default value of config.extra.banner to an empty string Signed-off-by: Jack S. <181536874+awtj8o81ryywg793@users.noreply.github.com> * Refactor banner macro to use markdown for content Signed-off-by: Jack S. <181536874+awtj8o81ryywg793@users.noreply.github.com> --------- Signed-off-by: Jack S. <181536874+awtj8o81ryywg793@users.noreply.github.com>
This commit is contained in:
parent
dbe9b79ed9
commit
e2ae35a706
2 changed files with 31 additions and 52 deletions
42
config.toml
42
config.toml
|
|
@ -38,16 +38,32 @@ skip_anchor_prefixes = [
|
|||
]
|
||||
|
||||
[extra]
|
||||
banner = false
|
||||
|
||||
# Possible states: "cfp", "awaiting_schedule", "scheduled", "no_tickets", "live", "watch-recordings", "none"
|
||||
# None is used when elections instead are used
|
||||
conference_state = "none"
|
||||
|
||||
conference_website = "https://conference.matrix.org"
|
||||
conference_cfp = "https://cfp.2025.matrix.org/matrix-conf-2025/cfp"
|
||||
conference_dates = "Oct 15-18"
|
||||
conference_location = "Strasbourg, France"
|
||||
|
||||
governing_board_elections = false
|
||||
governing_board_elections_page = "/foundation/governing-board-elections/2025/"
|
||||
# To enable the banner, either copy a pre-made template from below, paste it, and modify it if need be,
|
||||
# or write custom Markdown. To disable the banner, simply set the value to an empty string ("").
|
||||
#
|
||||
# cfp: "We are happy to launch [The Matrix Conference](https://conference.matrix.org)
|
||||
# on <dates> in <location>. [Learn more](https://conference.matrix.org) about it,
|
||||
# or [submit a proposal](https://cfp.<year>.matrix.org/matrix-conf-<year>/cfp)!"
|
||||
#
|
||||
# awaiting_schedule: "We are happy to launch [The Matrix Conference](https://conference.matrix.org)
|
||||
# on <dates> in <location>. [Learn more](https://conference.matrix.org) about it,
|
||||
# [buy a ticket](https://conference.matrix.org/register/)!"
|
||||
#
|
||||
# scheduled: "We are happy to launch [The Matrix Conference](https://conference.matrix.org)
|
||||
# on <dates> in <location>. [Learn more](https://conference.matrix.org) about it,
|
||||
# [buy a ticket](https://conference.matrix.org/register/), or
|
||||
# [check the schedule](https://conference.matrix.org/schedule/)!"
|
||||
#
|
||||
# no_tickets: "We are happy to launch [The Matrix Conference](https://conference.matrix.org)
|
||||
# on <dates> in <location>. [Learn more](https://conference.matrix.org) about it,
|
||||
# or [check the schedule](https://conference.matrix.org/schedule/)!"
|
||||
#
|
||||
# live: "[The Matrix Conference](https://conference.matrix.org) is live.
|
||||
# [Check the livestreams](https://conference.matrix.org/watch/)!"
|
||||
#
|
||||
# watch-recordings: "[The Matrix Conference](https://conference.matrix.org) is over,
|
||||
# and the [recordings](https://conference.matrix.org/watch/) are here!"
|
||||
#
|
||||
# governing_board_elections: "We are holding our Governing Board elections. Find
|
||||
# all the information [on the elections page](https:/matrix.org/foundation/governing-board-elections/<year>/)."
|
||||
banner = ""
|
||||
|
|
|
|||
|
|
@ -1,44 +1,7 @@
|
|||
{% macro banner() %}
|
||||
{% if config.extra.banner %}
|
||||
{% if config.extra.banner | trim != "" %}
|
||||
<div id="information-banner">
|
||||
{% if config.extra.conference_state == "cfp" %}
|
||||
<p>We are happy to launch <a href="{{ config.extra.conference_website }}">The Matrix Conference</a> on {{
|
||||
config.extra.conference_dates }} in
|
||||
{{ config.extra.conference_location }}. <a href="{{ config.extra.conference_website }}">Learn more</a> about it,
|
||||
or <a href="{{ config.extra.conference_cfp }}">submit a
|
||||
proposal</a>!</p>
|
||||
{% elif config.extra.conference_state == "awaiting_schedule" %}
|
||||
<p>We are happy to launch <a href="{{ config.extra.conference_website }}">The Matrix Conference</a> on {{
|
||||
config.extra.conference_dates }} in
|
||||
{{ config.extra.conference_location }}. <a href="{{ config.extra.conference_website }}">Learn more</a> about it,
|
||||
<a href="{{ config.extra.conference_website }}/register/">buy a
|
||||
ticket</a>!
|
||||
</p>
|
||||
{% elif config.extra.conference_state == "scheduled" %}
|
||||
<p>We are happy to launch <a href="{{ config.extra.conference_website }}">The Matrix Conference</a> on {{
|
||||
config.extra.conference_dates }} in
|
||||
{{ config.extra.conference_location }}. <a href="{{ config.extra.conference_website }}">Learn more</a> about it,
|
||||
<a href="{{ config.extra.conference_website }}/register/">buy a
|
||||
ticket</a>, or <a href="{{ config.extra.conference_website }}/schedule/">check the schedule</a>!
|
||||
</p>
|
||||
{% elif config.extra.conference_state == "no_tickets" %}
|
||||
<p>We are happy to launch <a href="{{ config.extra.conference_website }}">The Matrix Conference</a> on {{
|
||||
config.extra.conference_dates }} in
|
||||
{{ config.extra.conference_location }}. <a href="{{ config.extra.conference_website }}">Learn more</a> about it,
|
||||
or <a href="{{ config.extra.conference_website }}/schedule/">check the schedule</a>!</p>
|
||||
{% elif config.extra.conference_state == "live" %}
|
||||
<p><a href="{{ config.extra.conference_website }}">The Matrix Conference</a> is Live.
|
||||
<a href="{{ config.extra.conference_website }}/watch/">Check the livestreams</a>!
|
||||
</p>
|
||||
{% elif config.extra.conference_state == "watch-recordings" %}
|
||||
<p><a href="{{ config.extra.conference_website }}">The Matrix Conference</a> is over and the
|
||||
<a href="{{ config.extra.conference_website }}/watch/">recordings</a> are here!
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if config.extra.governing_board_elections %}
|
||||
<p>We are holding our Governing Board elections. Find all the information <a
|
||||
href="{{ config.extra.governing_board_elections_page }}">on the elections page.</a></p>
|
||||
{% endif %}
|
||||
{{ config.extra.banner | markdown | safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue