home / content / repos

repos: 530399214

This data as json

id node_id name full_name private owner html_url description fork created_at updated_at pushed_at homepage size stargazers_count watchers_count language has_issues has_projects has_downloads has_wiki has_pages forks_count archived disabled open_issues_count license topics forks open_issues watchers default_branch permissions temp_clone_token organization network_count subscribers_count readme readme_html allow_forking visibility is_template template_repository web_commit_signoff_required has_discussions
530399214 R_kgDOH50_7g datasette-sitemap simonw/datasette-sitemap 0 9599 https://github.com/simonw/datasette-sitemap Generate sitemap.xml for Datasette sites 0 2022-08-29T21:22:46Z 2022-08-29T23:04:23Z 2022-08-30T17:59:53Z   25 0 0 Python 1 1 1 1 0 0 0 0 0 apache-2.0 [] 0 0 0 main {"admin": false, "maintain": false, "push": false, "triage": false, "pull": false}     0 1 # datasette-sitemap [![PyPI](https://img.shields.io/pypi/v/datasette-sitemap.svg)](https://pypi.org/project/datasette-sitemap/) [![Changelog](https://img.shields.io/github/v/release/simonw/datasette-sitemap?include_prereleases&label=changelog)](https://github.com/simonw/datasette-sitemap/releases) [![Tests](https://github.com/simonw/datasette-sitemap/workflows/Test/badge.svg)](https://github.com/simonw/datasette-sitemap/actions?query=workflow%3ATest) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-sitemap/blob/main/LICENSE) Generate sitemap.xml for Datasette sites ## Installation Install this plugin in the same environment as Datasette. datasette install datasette-sitemap ## Demo This plugin is used for the sitemap on [til.simonwillison.net](https://til.simonwillison.net/): - https://til.simonwillison.net/sitemap.xml Here's [the configuration](https://github.com/simonw/til/blob/d4f67743a90a67100b46145986b2dec6f8d96583/metadata.yaml#L14-L16) used for that sitemap. ## Usage Once configured, this plugin adds a sitemap at `/sitemap.xml` with a list of URLs. This list is defined using a SQL query in `metadata.json` (or `.yml`) that looks like this: ```json { "plugins": { "datasette-sitemap": { "query": "select '/' || id as path from my_table" } } } ``` Using `metadata.yml` allows for multi-line SQL queries which can be easier to maintain: ```yaml plugins: datasette-sitemap: query: | select '/' || id as path from my_table ``` The SQL query must return a column called `path`. The values in this column must begin with a `/`. They will be used to generate a sitemap that looks like this: ```xml <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url><loc>https://example.com/1</loc></url> <url><loc>https://example.com/2</loc></url> </urlset> ``` You can use ``UNION`` in your SQL query to combine results from multiple tables, or include literal paths that you want to include in the index: ```sql select '/data/table1/' || id as path from table1 union select '/data/table2/' || id as path from table2 union select '/about' as path ``` If your Datasette instance has multiple databases you can configure the database to query using the `database` configuration property. By default the domain name for the genearted URLs in the sitemap will be detected from the incoming request. You can set `base_url` instead to override this. This should not include a trailing slash. This example shows both of those settings, running the query against the `content` database and setting a custom base URL: ```yaml plugins: datasette-sitemap: query: | select '/plugins/' || name as path from plugins union select '/tools/' || name as path from tools union select '/news' as path database: content base_url: https://datasette.io ``` [Try that query](https://datasette.io/content?sql=select+%27%2Fplugins%2F%27+||+name+as+path+from+plugins%0D%0Aunion%0D%0Aselect+%27%2Ftools%2F%27+||+name+as+path+from+tools%0D%0Aunion%0D%0Aselect+%27%2Fnews%27+as+path%0D%0A). ## robots.txt This plugin adds a `robots.txt` file pointing to the sitemap: ``` Sitemap: http://example.com/sitemap.xml ``` You can take full control of the sitemap by installing and configuring the [datasette-block-robots](https://datasette.io/plugins/datasette-block-robots) plugin. This plugin will add the `Sitemap:` line even if you are using `datasette-block-robots` for the rest of your `robots.txt` file. ## Adding paths to the sitemap from other plugins This plugin adds a new [plugin hook](https://docs.datasette.io/en/stable/plugin_hooks.html) to Datasete called `sitemap_extra_paths()` which can be used by other plugins to add their own additional lines to the `sitemap.xml` file. The hook accepts these optional parameters: - `datasette`: The current [Datasette instance](https://docs.datasette.io/en/stable/internals.html#datasette-class). You can use this to execute SQL queries or read plugin configuration settings. - `request`: The [Request object](https://docs.datasette.io/en/stable/internals.html#request-object) representing the incoming request to `/sitemap.xml`. The hook should return a list of strings, each representing a path to be added to the sitemap. Each path must begin with a `/`. It can also return an `async def` function, which will be awaited and used to generate a list of lines. Use this option if you need to make `await` calls inside you hook implementation. This example uses the hook to add two extra paths, one of which came from a SQL query: ```python from datasette import hookimpl @hookimpl def sitemap_extra_paths(datasette): async def inner(): db = datasette.get_database() path_from_db = (await db.execute("select '/example'")).single_value() return ["/about", path_from_db] return inner ``` ## Development To set up this plugin locally, first checkout the code. Then create a new virtual environment: cd datasette-sitemap python3 -m venv venv source venv/bin/activate Now install the dependencies and test dependencies: pip install -e '.[test]' To run the tests: pytest <div id="readme" class="md" data-path="README.md"><article class="markdown-body entry-content container-lg" itemprop="text"><h1 dir="auto"><a id="user-content-datasette-sitemap" class="anchor" aria-hidden="true" href="#user-content-datasette-sitemap"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>datasette-sitemap</h1> <p dir="auto"><a href="https://pypi.org/project/datasette-sitemap/" rel="nofollow"><img src="https://camo.githubusercontent.com/6771365acdee2a47414d423ce45cba60d99dbc6a20fa98637c0617476f8053da/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f6461746173657474652d736974656d61702e737667" alt="PyPI" data-canonical-src="https://img.shields.io/pypi/v/datasette-sitemap.svg" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-sitemap/releases"><img src="https://camo.githubusercontent.com/4ceed1473baea92d47265f3ec83d36d6218a335777f158e5785a7033a2affba6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f73696d6f6e772f6461746173657474652d736974656d61703f696e636c7564655f70726572656c6561736573266c6162656c3d6368616e67656c6f67" alt="Changelog" data-canonical-src="https://img.shields.io/github/v/release/simonw/datasette-sitemap?include_prereleases&amp;label=changelog" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-sitemap/actions?query=workflow%3ATest"><img src="https://github.com/simonw/datasette-sitemap/workflows/Test/badge.svg" alt="Tests" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-sitemap/blob/main/LICENSE"><img src="https://camo.githubusercontent.com/1698104e976c681143eb0841f9675c6f802bb7aa832afc0c7a4e719b1f3cf955/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d626c75652e737667" alt="License" data-canonical-src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" style="max-width: 100%;"></a></p> <p dir="auto">Generate sitemap.xml for Datasette sites</p> <h2 dir="auto"><a id="user-content-installation" class="anchor" aria-hidden="true" href="#user-content-installation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Installation</h2> <p dir="auto">Install this plugin in the same environment as Datasette.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="datasette install datasette-sitemap"><pre class="notranslate"><code>datasette install datasette-sitemap </code></pre></div> <h2 dir="auto"><a id="user-content-demo" class="anchor" aria-hidden="true" href="#user-content-demo"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Demo</h2> <p dir="auto">This plugin is used for the sitemap on <a href="https://til.simonwillison.net/" rel="nofollow">til.simonwillison.net</a>:</p> <ul dir="auto"> <li><a href="https://til.simonwillison.net/sitemap.xml" rel="nofollow">https://til.simonwillison.net/sitemap.xml</a></li> </ul> <p dir="auto">Here's <a href="https://github.com/simonw/til/blob/d4f67743a90a67100b46145986b2dec6f8d96583/metadata.yaml#L14-L16">the configuration</a> used for that sitemap.</p> <h2 dir="auto"><a id="user-content-usage" class="anchor" aria-hidden="true" href="#user-content-usage"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Usage</h2> <p dir="auto">Once configured, this plugin adds a sitemap at <code>/sitemap.xml</code> with a list of URLs.</p> <p dir="auto">This list is defined using a SQL query in <code>metadata.json</code> (or <code>.yml</code>) that looks like this:</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{ &quot;plugins&quot;: { &quot;datasette-sitemap&quot;: { &quot;query&quot;: &quot;select '/' || id as path from my_table&quot; } } }"><pre>{ <span class="pl-ent">"plugins"</span>: { <span class="pl-ent">"datasette-sitemap"</span>: { <span class="pl-ent">"query"</span>: <span class="pl-s"><span class="pl-pds">"</span>select '/' || id as path from my_table<span class="pl-pds">"</span></span> } } }</pre></div> <p dir="auto">Using <code>metadata.yml</code> allows for multi-line SQL queries which can be easier to maintain:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="plugins: datasette-sitemap: query: | select '/' || id as path from my_table"><pre><span class="pl-ent">plugins</span>: <span class="pl-ent">datasette-sitemap</span>: <span class="pl-ent">query</span>: <span class="pl-s">|</span> <span class="pl-s"> select</span> <span class="pl-s"> '/' || id as path</span> <span class="pl-s"> from</span> <span class="pl-s"> my_table</span></pre></div> <p dir="auto">The SQL query must return a column called <code>path</code>. The values in this column must begin with a <code>/</code>. They will be used to generate a sitemap that looks like this:</p> <div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;&gt; &lt;url&gt;&lt;loc&gt;https://example.com/1&lt;/loc&gt;&lt;/url&gt; &lt;url&gt;&lt;loc&gt;https://example.com/2&lt;/loc&gt;&lt;/url&gt; &lt;/urlset&gt;"><pre>&lt;?<span class="pl-ent">xml</span><span class="pl-e"> version</span>=<span class="pl-s"><span class="pl-pds">"</span>1.0<span class="pl-pds">"</span></span><span class="pl-e"> encoding</span>=<span class="pl-s"><span class="pl-pds">"</span>UTF-8<span class="pl-pds">"</span></span>?&gt; &lt;<span class="pl-ent">urlset</span> <span class="pl-e">xmlns</span>=<span class="pl-s"><span class="pl-pds">"</span>http://www.sitemaps.org/schemas/sitemap/0.9<span class="pl-pds">"</span></span>&gt; &lt;<span class="pl-ent">url</span>&gt;&lt;<span class="pl-ent">loc</span>&gt;https://example.com/1&lt;/<span class="pl-ent">loc</span>&gt;&lt;/<span class="pl-ent">url</span>&gt; &lt;<span class="pl-ent">url</span>&gt;&lt;<span class="pl-ent">loc</span>&gt;https://example.com/2&lt;/<span class="pl-ent">loc</span>&gt;&lt;/<span class="pl-ent">url</span>&gt; &lt;/<span class="pl-ent">urlset</span>&gt;</pre></div> <p dir="auto">You can use <code>UNION</code> in your SQL query to combine results from multiple tables, or include literal paths that you want to include in the index:</p> <div class="highlight highlight-source-sql notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="select '/data/table1/' || id as path from table1 union select '/data/table2/' || id as path from table2 union select '/about' as path"><pre><span class="pl-k">select</span> <span class="pl-s"><span class="pl-pds">'</span>/data/table1/<span class="pl-pds">'</span></span> <span class="pl-k">||</span> id <span class="pl-k">as</span> <span class="pl-k">path</span> <span class="pl-k">from</span> table1 <span class="pl-k">union</span> <span class="pl-k">select</span> <span class="pl-s"><span class="pl-pds">'</span>/data/table2/<span class="pl-pds">'</span></span> <span class="pl-k">||</span> id <span class="pl-k">as</span> <span class="pl-k">path</span> <span class="pl-k">from</span> table2 <span class="pl-k">union</span> <span class="pl-k">select</span> <span class="pl-s"><span class="pl-pds">'</span>/about<span class="pl-pds">'</span></span> <span class="pl-k">as</span> <span class="pl-k">path</span></pre></div> <p dir="auto">If your Datasette instance has multiple databases you can configure the database to query using the <code>database</code> configuration property.</p> <p dir="auto">By default the domain name for the genearted URLs in the sitemap will be detected from the incoming request.</p> <p dir="auto">You can set <code>base_url</code> instead to override this. This should not include a trailing slash.</p> <p dir="auto">This example shows both of those settings, running the query against the <code>content</code> database and setting a custom base URL:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="plugins: datasette-sitemap: query: | select '/plugins/' || name as path from plugins union select '/tools/' || name as path from tools union select '/news' as path database: content base_url: https://datasette.io"><pre><span class="pl-ent">plugins</span>: <span class="pl-ent">datasette-sitemap</span>: <span class="pl-ent">query</span>: <span class="pl-s">|</span> <span class="pl-s"> select '/plugins/' || name as path from plugins</span> <span class="pl-s"> union</span> <span class="pl-s"> select '/tools/' || name as path from tools</span> <span class="pl-s"> union</span> <span class="pl-s"> select '/news' as path</span> <span class="pl-s"></span> <span class="pl-ent">database</span>: <span class="pl-s">content</span> <span class="pl-ent">base_url</span>: <span class="pl-s">https://datasette.io</span></pre></div> <p dir="auto"><a href="https://datasette.io/content?sql=select+%27%2Fplugins%2F%27+%7C%7C+name+as+path+from+plugins%0D%0Aunion%0D%0Aselect+%27%2Ftools%2F%27+%7C%7C+name+as+path+from+tools%0D%0Aunion%0D%0Aselect+%27%2Fnews%27+as+path%0D%0A" rel="nofollow">Try that query</a>.</p> <h2 dir="auto"><a id="user-content-robotstxt" class="anchor" aria-hidden="true" href="#user-content-robotstxt"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>robots.txt</h2> <p dir="auto">This plugin adds a <code>robots.txt</code> file pointing to the sitemap:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Sitemap: http://example.com/sitemap.xml"><pre class="notranslate"><code>Sitemap: http://example.com/sitemap.xml </code></pre></div> <p dir="auto">You can take full control of the sitemap by installing and configuring the <a href="https://datasette.io/plugins/datasette-block-robots" rel="nofollow">datasette-block-robots</a> plugin.</p> <p dir="auto">This plugin will add the <code>Sitemap:</code> line even if you are using <code>datasette-block-robots</code> for the rest of your <code>robots.txt</code> file.</p> <h2 dir="auto"><a id="user-content-adding-paths-to-the-sitemap-from-other-plugins" class="anchor" aria-hidden="true" href="#user-content-adding-paths-to-the-sitemap-from-other-plugins"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Adding paths to the sitemap from other plugins</h2> <p dir="auto">This plugin adds a new <a href="https://docs.datasette.io/en/stable/plugin_hooks.html" rel="nofollow">plugin hook</a> to Datasete called <code>sitemap_extra_paths()</code> which can be used by other plugins to add their own additional lines to the <code>sitemap.xml</code> file.</p> <p dir="auto">The hook accepts these optional parameters:</p> <ul dir="auto"> <li><code>datasette</code>: The current <a href="https://docs.datasette.io/en/stable/internals.html#datasette-class" rel="nofollow">Datasette instance</a>. You can use this to execute SQL queries or read plugin configuration settings.</li> <li><code>request</code>: The <a href="https://docs.datasette.io/en/stable/internals.html#request-object" rel="nofollow">Request object</a> representing the incoming request to <code>/sitemap.xml</code>.</li> </ul> <p dir="auto">The hook should return a list of strings, each representing a path to be added to the sitemap. Each path must begin with a <code>/</code>.</p> <p dir="auto">It can also return an <code>async def</code> function, which will be awaited and used to generate a list of lines. Use this option if you need to make <code>await</code> calls inside you hook implementation.</p> <p dir="auto">This example uses the hook to add two extra paths, one of which came from a SQL query:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from datasette import hookimpl @hookimpl def sitemap_extra_paths(datasette): async def inner(): db = datasette.get_database() path_from_db = (await db.execute(&quot;select '/example'&quot;)).single_value() return [&quot;/about&quot;, path_from_db] return inner"><pre><span class="pl-k">from</span> <span class="pl-s1">datasette</span> <span class="pl-k">import</span> <span class="pl-s1">hookimpl</span> <span class="pl-en">@<span class="pl-s1">hookimpl</span></span> <span class="pl-k">def</span> <span class="pl-en">sitemap_extra_paths</span>(<span class="pl-s1">datasette</span>): <span class="pl-k">async</span> <span class="pl-k">def</span> <span class="pl-en">inner</span>(): <span class="pl-s1">db</span> <span class="pl-c1">=</span> <span class="pl-s1">datasette</span>.<span class="pl-en">get_database</span>() <span class="pl-s1">path_from_db</span> <span class="pl-c1">=</span> (<span class="pl-k">await</span> <span class="pl-s1">db</span>.<span class="pl-en">execute</span>(<span class="pl-s">"select '/example'"</span>)).<span class="pl-en">single_value</span>() <span class="pl-k">return</span> [<span class="pl-s">"/about"</span>, <span class="pl-s1">path_from_db</span>] <span class="pl-k">return</span> <span class="pl-s1">inner</span></pre></div> <h2 dir="auto"><a id="user-content-development" class="anchor" aria-hidden="true" href="#user-content-development"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Development</h2> <p dir="auto">To set up this plugin locally, first checkout the code. Then create a new virtual environment:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cd datasette-sitemap python3 -m venv venv source venv/bin/activate"><pre class="notranslate"><code>cd datasette-sitemap python3 -m venv venv source venv/bin/activate </code></pre></div> <p dir="auto">Now install the dependencies and test dependencies:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pip install -e '.[test]'"><pre class="notranslate"><code>pip install -e '.[test]' </code></pre></div> <p dir="auto">To run the tests:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pytest"><pre class="notranslate"><code>pytest </code></pre></div> </article></div> 1 public 0 {"id": 400878073, "node_id": "MDEwOlJlcG9zaXRvcnk0MDA4NzgwNzM=", "name": "datasette-plugin-template-repository", "full_name": "simonw/datasette-plugin-template-repository", "private": false, "owner": {"login": "simonw", "id": 9599, "node_id": "MDQ6VXNlcjk1OTk=", "avatar_url": "https://avatars.githubusercontent.com/u/9599?v=4", "gravatar_id": "", "url": "https://api.github.com/users/simonw", "html_url": "https://github.com/simonw", "followers_url": "https://api.github.com/users/simonw/followers", "following_url": "https://api.github.com/users/simonw/following{/other_user}", "gists_url": "https://api.github.com/users/simonw/gists{/gist_id}", "starred_url": "https://api.github.com/users/simonw/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/simonw/subscriptions", "organizations_url": "https://api.github.com/users/simonw/orgs", "repos_url": "https://api.github.com/users/simonw/repos", "events_url": "https://api.github.com/users/simonw/events{/privacy}", "received_events_url": "https://api.github.com/users/simonw/received_events", "type": "User", "site_admin": false}, "html_url": "https://github.com/simonw/datasette-plugin-template-repository", "description": "GitHub template repository for creating new Datasette plugins, using the simonw/datasette-plugin cookiecutter template", "fork": false, "url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository", "forks_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/forks", "keys_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/keys{/key_id}", "collaborators_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/collaborators{/collaborator}", "teams_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/teams", "hooks_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/hooks", "issue_events_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/issues/events{/number}", "events_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/events", "assignees_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/assignees{/user}", "branches_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/branches{/branch}", "tags_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/tags", "blobs_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/git/blobs{/sha}", "git_tags_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/git/tags{/sha}", "git_refs_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/git/refs{/sha}", "trees_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/git/trees{/sha}", "statuses_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/statuses/{sha}", "languages_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/languages", "stargazers_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/stargazers", "contributors_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/contributors", "subscribers_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/subscribers", "subscription_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/subscription", "commits_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/commits{/sha}", "git_commits_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/git/commits{/sha}", "comments_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/comments{/number}", "issue_comment_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/issues/comments{/number}", "contents_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/contents/{+path}", "compare_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/compare/{base}...{head}", "merges_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/merges", "archive_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/{archive_format}{/ref}", "downloads_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/downloads", "issues_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/issues{/number}", "pulls_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/pulls{/number}", "milestones_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/milestones{/number}", "notifications_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/notifications{?since,all,participating}", "labels_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/labels{/name}", "releases_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/releases{/id}", "deployments_url": "https://api.github.com/repos/simonw/datasette-plugin-template-repository/deployments", "created_at": "2021-08-28T19:50:28Z", "updated_at": "2022-08-27T17:22:27Z", "pushed_at": "2022-03-16T23:42:16Z", "git_url": "git://github.com/simonw/datasette-plugin-template-repository.git", "ssh_url": "git@github.com:simonw/datasette-plugin-template-repository.git", "clone_url": "https://github.com/simonw/datasette-plugin-template-repository.git", "svn_url": "https://github.com/simonw/datasette-plugin-template-repository", "homepage": "", "size": 9, "stargazers_count": 16, "watchers_count": 16, "language": null, "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, "has_pages": false, "forks_count": 0, "mirror_url": null, "archived": false, "disabled": false, "open_issues_count": 0, "license": null, "allow_forking": true, "is_template": true, "web_commit_signoff_required": false, "topics": [], "visibility": "public", "forks": 0, "open_issues": 0, "watchers": 16, "default_branch": "main", "permissions": {"admin": false, "maintain": false, "push": false, "triage": false, "pull": false}, "temp_clone_token": ""} 0  

Links from other tables

  • 3 rows from repo in releases
Powered by Datasette · Queries took 2.6ms