Merge pull request #3 from phaziz/master

Updated code block for search results.
This commit is contained in:
Pontus Horn af Rantzien
2016-11-09 09:05:28 +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):
```twig
{% for page in pages %}
<div class="search_result">
<h2><a href="{{ page.url }}">{{ page.title }}</a></h2>
{% if page.description %}<p>{{ page.description }}</p>{% endif %}
</div>
{% endfor %}
{% if pages %}
{% for page in pages %}
<div class="search_result">
<h2><a href="{{ page.url }}">{{ page.title }}</a></h2>
{% if page.description %}<p>{{ page.description }}</p>{% endif %}
</div>
{% endfor %}
{% endif %}
```
Now, you should be able to visit for example `yoursite.com/search/foobar` (adjust path accordingly if putting search.md