{% extends "til_base.html" %} {% block title %}TIL{% endblock %} {% block extra_head %} {% endblock %} {% block body %} {% set snippet_path = '_snippets_index.md' %} {% include 'snippet_display.html' %} {% set til_count = sql("select count(*) from TIL", database="tils")[0][0] %}

Search

{% if search_type == "static" %} {% else %}

{% endif %}

Browse by topic

{%- set unique_topics = {} %} {%- for topic_row in sql("SELECT DISTINCT topics FROM til", database="tils") %} {%- if topic_row.topics %} {%- for topic in topic_row.topics.split(',') %} {%- if topic.strip() and not unique_topics.get(topic.strip()) %} {%- set count = sql("SELECT COUNT(*) as count FROM til WHERE topics LIKE '%" + topic.strip() + "%'", database="tils")[0].count %} {%- if unique_topics.update({topic.strip(): count}) -%}{%- endif %} {%- endif %} {%- endfor %} {%- endif %} {%- endfor %} {%- for topic in unique_topics.keys()|sort %} {{ topic }} {{ unique_topics[topic] }}{% if not loop.last %} · {% endif %} {%- endfor %}

Recent TILs

{% for til in sql("select * from til order by created_utc desc limit 30", database="tils") %}

{{ til.title }} - {{ til.created[:10] }}

{{ first_paragraph(til["html"]).replace("

", " …

")|safe }} {% for topic in til.topics.split(',') %} {{ topic }} {% endfor %} {% endfor %}

Browse all {{ til_count }} TILs

{% endblock %}