Front page configuration
Spinta’s HTML pages (all pages that extend the base.html template) display
a notice at the top — for example, a message telling users that the platform
is under active development, or any other piece of information that should be
visible everywhere. This notice is configurable.
Configuration option
The notice text is stored in the texts.front_page_warning option. The value
is read from your config.yml; if it is not set there, Spinta falls back to
the default defined in spinta/config.py.
texts:
front_page_warning: |
**Heads up!** The platform is currently under active development.
Markdown syntax
The notice is written in Markdown. It is
converted to HTML and then sanitized for safety, so values coming from
external or untrusted sources are safe to use — any dangerous HTML
(<script>, onclick attributes, etc.) is stripped before the page is
rendered.
Common Markdown elements that work:
Markdown |
Renders as |
|---|---|
|
bold text |
|
italic text |
|
a link |
|
H1–H6 headings |
Example
In config.yml:
texts:
front_page_warning: |
**Heads up!** The [data storage](https://data.gov.lt/page/saugykla) is
currently under active development. Please report any issues to
[atviriduomenys@vssa.lt](mailto:atviriduomenys@vssa.lt).
Rendered HTML:
<div class="warning">
<p>
<strong>Heads up!</strong> The
<a href="https://data.gov.lt/page/saugykla" target="_blank"
rel="noopener noreferrer">data storage</a> is
currently under active development. Please report any issues to
<a href="mailto:atviriduomenys@vssa.lt" target="_blank"
rel="noopener noreferrer">atviriduomenys@vssa.lt</a>.
</p>
</div>
Default value
If texts.front_page_warning is not set in your configuration, the default
from spinta/config.py is used — a message about active development with a
link to the project documentation. To remove the notice entirely, set the
option to an empty string in config.yml:
texts:
front_page_warning: ""
Implementation notes
The notice text reaches the template via the
get_front_page_warning()helper (spinta/formats/html/helpers.py).Markdown → HTML conversion and sanitization are performed by the
markdownJinja2 filter (also defined inhelpers.py). In templates it is used as:{{ front_page_warning | markdown }}.The filter returns a
markupsafe.Markupobject, so Jinja2 does not re-escape the result — no extra| safeis needed.The filter is general-purpose — it can be reused in any other template that needs Markdown rendering.