diff --git a/documentation/content/Advanced Features/clean-url.md b/documentation/content/Advanced Features/clean-url.md index 60d944b0..a419eb41 100644 --- a/documentation/content/Advanced Features/clean-url.md +++ b/documentation/content/Advanced Features/clean-url.md @@ -51,3 +51,11 @@ For pages, set PAGE_URL = "{slug}" PAGE_SAVE_AS = "{slug}.html" ``` + +## Search + +For search page, set + +```python +SEARCH_URL = "search" +``` diff --git a/documentation/pelicanconf.py b/documentation/pelicanconf.py index cdefeea1..41b5ec70 100644 --- a/documentation/pelicanconf.py +++ b/documentation/pelicanconf.py @@ -58,6 +58,7 @@ TAGS_URL = "tags" CATEGORIES_URL = "categories" ARCHIVES_URL = "archives" +SEARCH_URL = "search" # Feeds AUTHOR_FEED_ATOM = None diff --git a/templates/404.html b/templates/404.html index 97bc0dfb..a556d6c6 100644 --- a/templates/404.html +++ b/templates/404.html @@ -20,7 +20,8 @@

That page doesn't exist!

Sorry, but the page you are looking for cannot be found. It seems that the page you were trying to reach doesn't exist, or may be it has just moved, or it no longer exists.

The best thing to do is to use the search form or start again from the home page.

-
+ {% from '_includes/_defaults.html' import SEARCH_URL with context %} +
diff --git a/templates/_includes/_defaults.html b/templates/_includes/_defaults.html index f6dedcc9..42d10c42 100644 --- a/templates/_includes/_defaults.html +++ b/templates/_includes/_defaults.html @@ -194,3 +194,9 @@ {% else %} {% set ARCHIVES_URL = ARCHIVES_URL %} {% endif %} + +{%if not SEARCH_URL %} +{% set SEARCH_URL = 'search.html' %} +{% else %} +{% set SEARCH_URL = SEARCH_URL %} +{% endif %} diff --git a/templates/base.html b/templates/base.html index a7b3250c..e146dae1 100644 --- a/templates/base.html +++ b/templates/base.html @@ -78,11 +78,11 @@
  • {{ p.title }}
  • {% endfor %} {% endif %} - {% from '_includes/_defaults.html' import TAGS_URL, CATEGORIES_URL, ARCHIVES_URL with context %} + {% from '_includes/_defaults.html' import TAGS_URL, CATEGORIES_URL, ARCHIVES_URL, SEARCH_URL with context %}
  • Categories
  • Tags
  • Archives
  • -
  • +
  • diff --git a/templates/search.html b/templates/search.html index 83e3da9d..3d50a382 100644 --- a/templates/search.html +++ b/templates/search.html @@ -10,14 +10,14 @@ {% block meta_tags_in_head %} {{ super() }} +{% from '_includes/_defaults.html' import FEATURED_IMAGE, SEARCH_URL with context %} - + -{% from '_includes/_defaults.html' import FEATURED_IMAGE with context %} {% if FEATURED_IMAGE %}