Skip to content

Instantly share code, notes, and snippets.

@patrykkalinowski
Created December 13, 2016 23:54
Show Gist options
  • Save patrykkalinowski/8556bcb9f8f6d6ff9d33ea2346304a33 to your computer and use it in GitHub Desktop.
Save patrykkalinowski/8556bcb9f8f6d6ff9d33ea2346304a33 to your computer and use it in GitHub Desktop.
{# you can replace 'default' with your blog id #}
{% set contents = blog_popular_posts('default', 200) %}
{# search query #}
{% set query = request.query_dict['q'] %}
<h1>Search results for: {{ query }}</h1>
{% for content in contents %}
{% if query|lower in content.name|lower %}
{# your blogpost listing, ex. <h2>{{ content.name }}</h2> #}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment