mirror of
https://github.com/DMOJ/online-judge.git
synced 2024-11-25 16:32:37 +08:00
eda67c54e2
There should never be that much stuff in MiscConfig, so let's just read it all and deal with it in python instead of trying to run one query for each item of interest and poorly cache it. This PR also moved MiscConfigDict into a middleware so it can be used outside of templates.
24 lines
973 B
HTML
24 lines
973 B
HTML
{% extends "blog/list.html" %}
|
|
{% block before_posts %}
|
|
{% if misc_config.home_page_top %}
|
|
{{ render_django(misc_config.home_page_top, request=request, user_count=user_count, problem_count=problem_count, submission_count=submission_count, language_count=language_count, perms=perms) }}
|
|
{% endif %}
|
|
{% endblock %}
|
|
{% block meta %}
|
|
{% if misc_config.meta_description %}
|
|
<meta name="description" content="{{ misc_config['meta_description'] }}">
|
|
{% endif %}
|
|
<script type="application/ld+json">
|
|
{
|
|
"@context": "https://schema.org",
|
|
"@type": "WebSite",
|
|
"url": "{{ DMOJ_SCHEME }}://{{ site.domain }}/",
|
|
"potentialAction": {
|
|
"@type": "SearchAction",
|
|
"target": "{{ DMOJ_SCHEME }}://{{ site.domain }}/problems/?search={search_term_string}",
|
|
"query-input": "required name=search_term_string"
|
|
}
|
|
}
|
|
</script>
|
|
{% endblock %}
|