datasette.io/templates/dogsheep-beta.yml
blog.db:
entries:
sql: |-
select
id as key,
title,
body as search_1,
published as timestamp,
1 as is_public
from
entries
display_sql: |-
select
url,
highlight(
body, :q
) as snippet
from
entries
where
entries.id = :key
display: |-
<h3>Blog: <a href="{{ display.url }}">{{ title }}</a></h3>
<p>{{ display.snippet|safe }}</p>
<p><small>Published {{ timestamp }}</small></p>
tils.db:
til:
sql: |-
select
path as key,
title,
body as search_1,
created_utc as timestamp,
1 as is_public
from
til
where
"title" like '%datasette%'
or topic in ('datasette', 'sqlite')
order by
created_utc desc
display_sql: |-
select
topic,
slug,
highlight(
body, :q
) as snippet
from
til
where
til.path = :key
display: |-
<h3>TIL: <a href="https://til.simonwillison.net/{{ display.topic }}/{{ display.slug }}">{{ title }}</a></h3>
<p>{{ display.snippet|safe }}</p>
<p><small>Published {{ timestamp }}</small></p>
docs-index.db:
sections:
sql: |-
select
id as key,
title as title,
content as search_1,
null as timestamp,
1 as is_public
from
sections
display_sql: |-
select
page,
ref,
snippet(
sections_fts,
-1,
'b4de2a49c8',
'8c94a2ed4b',
'...',
60
) as snippet
from
sections
join sections_fts on sections.rowid = sections_fts.rowid
where
id = :key
and sections_fts match escape_fts(case when :q = '' then sections.title else :q end)
display: |-
<h3>Docs: <a href="https://docs.datasette.io/en/stable/{{ display.page }}.html#{{ display.ref }}">{{ title }}</a></h3>
<p>{{ display.snippet.replace('b4de2a49c8', '<strong style="background-color: yellow">').replace('8c94a2ed4b', '</strong>')|safe }}</p>
content.db:
uses:
sql: |-
select
_path as key,
title as title,
text as search_1,
null as timestamp,
1 as is_public
from
uses
display_sql: |-
select
highlight(uses.text, :q) as snippet
from
uses
where
uses._path = :key
display: |-
<h3><a href="/{{ key.replace(".md", "") }}">{{ title }}</a></h3>
<p>{{ display.snippet|safe }}</p>
tools:
sql: |-
select
tools.name as key,
tools.name as title,
tools.created_at as timestamp,
tools.description || ' ' || coalesce(repos.readme, '') as search_1,
1 as is_public
from tools join repos on tools.name = repos.name
display_sql: |-
select
highlight(
tools.description || ' ' || coalesce(repos.readme_html, ''), :q
) as snippet,
usesCustomOpenGraphImage,
openGraphImageUrl
from
tools join repos on tools.name = repos.name
where
tools.name = :key
display: |-
<h3>Tool: <a href="/tools/{{ title }}">{{ title }}</a></h3>
<p>{{ display.snippet|safe }}</p>
{% if display.usesCustomOpenGraphImage %}
<p><img src="{{ display.openGraphImageUrl }}" alt="" style="max-width: 100%"></p>
{% endif %}
<p><small>Created {{ timestamp }}</small></p>
plugins:
sql: |-
select
plugins.name as key,
plugins.name as title,
plugins.created_at as timestamp,
plugins.description || ' ' || coalesce(repos.readme, '') as search_1,
1 as is_public
from plugins join repos on plugins.name = repos.name
display_sql: |-
select
highlight(
plugins.description || ' ' || coalesce(repos.readme_html, ''), :q
) as snippet,
usesCustomOpenGraphImage,
openGraphImageUrl
from
plugins join repos on plugins.name = repos.name
where
plugins.name = :key
display: |-
<h3>Plugin: <a href="/plugins/{{ title }}">{{ title }}</a></h3>
<p>{{ display.snippet|safe }}</p>
{% if display.usesCustomOpenGraphImage %}
<p><img src="{{ display.openGraphImageUrl }}" alt="" style="max-width: 100%"></p>
{% endif %}
<p><small>Created {{ timestamp }}</small></p>
releases:
sql: |-
select
releases.id as key,
repos.name || ' ' || releases.tag_name as title,
releases.published_at as timestamp,
releases.body as search_1,
1 as is_public
from
releases
join repos on releases.repo = repos.id
display_sql: |-
select
highlight(render_markdown(releases.body), :q) as snippet,
html_url
from releases where id = :key
display: |-
<h3>Release: <a href="{{ display.html_url }}">{{ title }}</a></h3>
<p>{{ display.snippet|safe }}</p>
<p><small>Released {{ timestamp }}</small></p>
news:
sql: |-
select
date as key,
'Datasette News: ' || date as title,
date || 'T00:00:00-08:00' as timestamp,
group_concat(body, '
') as search_1,
1 as is_public
from
news
group by
date
order by
date desc
display_sql: |-
select
render_markdown(group_concat(body, '
')) as rendered_markdown
from news where date = :key
display: |-
<h3><a href="/news/{{ key }}">{{ title }}</a></h3>
<p>{{ display.rendered_markdown|safe }}</p>
tutorials:
sql: |-
select
path as key,
title,
body as search_1,
1 as is_public
from
tutorials
display_sql: |-
select
highlight(
body, :q
) as snippet
from
tutorials
where
tutorials.path = :key
display: |-
<h3>Tutorial: <a href="{{ key }}">{{ title }}</a></h3>
<p>{{ display.snippet|safe }}</p>