extract stork search in include

This commit is contained in:
Elias Kirchgässner 2022-03-10 10:40:22 +01:00
parent 4e99152aff
commit 0308fe1056
3 changed files with 14 additions and 16 deletions

View file

@ -44,7 +44,7 @@ The minimalist [Pelican](http://blog.getpelican.com/) theme.
- [Representative image](https://github.com/getpelican/pelican-plugins/tree/master/representative_image) - [Representative image](https://github.com/getpelican/pelican-plugins/tree/master/representative_image)
- [Neighbors](https://github.com/getpelican/pelican-plugins/tree/master/neighbors) - [Neighbors](https://github.com/getpelican/pelican-plugins/tree/master/neighbors)
- [Pelican Search](https://github.com/pelican-plugins/search) - [Pelican Search](https://github.com/pelican-plugins/search)
- [Tipue Search](https://github.com/getpelican/pelican-plugins/blob/master/tipue_search/) - [Tipue Search](https://github.com/getpelican/pelican-plugins/blob/master/tipue_search/) (deprecated)
- [SEO](https://github.com/pelican-plugins/seo) - [SEO](https://github.com/pelican-plugins/seo)
## Install ## Install

View file

@ -78,10 +78,7 @@
{% endif %} {% endif %}
{% if PLUGINS and 'pelican.plugins.search' in PLUGINS %} {% if PLUGINS and 'pelican.plugins.search' in PLUGINS %}
{% if THEME_COLOR_AUTO_DETECT_BROWSER_PREFERENCE or not THEME_COLOR or THEME_COLOR == "light" %}
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/stork/stork-dark.css" /> <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/stork/stork-dark.css" />
{% endif %}
{% endif %} {% endif %}
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/font-awesome/css/fontawesome.css"> <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/font-awesome/css/fontawesome.css">
@ -316,17 +313,6 @@
{% block additional_js %}{% endblock %} {% block additional_js %}{% endblock %}
{% if PLUGINS and 'pelican.plugins.search' in PLUGINS %} {% include 'partial/stork_search.html' %}
{% if STORK_VERSION %}
<script src="https://files.stork-search.net/releases/v{{ STORK_VERSION }}/stork.js"></script>
<script>
{% else %}
<script src="{{ SITEURL }}/static/stork.js"></script>
<script>
stork.initialize("{{ SITEURL }}/static/stork.wasm")
{% endif %}
stork.register("sitesearch", "{{ SITEURL }}/search-index.st", {showProgress: false})
</script>
{% endif %}
</body> </body>
</html> </html>

View file

@ -0,0 +1,12 @@
{% if PLUGINS and 'pelican.plugins.search' in PLUGINS %}
{% if STORK_VERSION %}
<script src="https://files.stork-search.net/releases/v{{ STORK_VERSION }}/stork.js"></script>
<script>
{% else %}
<script src="{{ SITEURL }}/static/stork.js"></script>
<script>
stork.initialize("{{ SITEURL }}/static/stork.wasm")
{% endif %}
stork.register("sitesearch", "{{ SITEURL }}/search-index.st", {showProgress: false})
</script>
{% endif %}