Merge pull request #1 from phaziz/phaziz-patch-1

Updated code example for results page
This commit is contained in:
Christian Becher
2016-11-09 08:45:09 +01:00
committed by GitHub

View File

@@ -28,12 +28,14 @@ Your template file (`search.html` in the above example) should contain something
lists the pages matching the search (substitute `paged_pages` for `pages` if using Pico-Pagination): lists the pages matching the search (substitute `paged_pages` for `pages` if using Pico-Pagination):
```twig ```twig
{% for page in pages %} {% if pages %}
<div class="search_result"> {% for page in pages %}
<h2><a href="{{ page.url }}">{{ page.title }}</a></h2> <div class="search_result">
{% if page.description %}<p>{{ page.description }}</p>{% endif %} <h2><a href="{{ page.url }}">{{ page.title }}</a></h2>
</div> {% if page.description %}<p>{{ page.description }}</p>{% endif %}
{% endfor %} </div>
{% endfor %}
{% endif %}
``` ```
Now, you should be able to visit for example `yoursite.com/search/foobar` (adjust path accordingly if putting search.md Now, you should be able to visit for example `yoursite.com/search/foobar` (adjust path accordingly if putting search.md