Skip to main content

A Pelican Plugin for outputting your Pelican posts into a SQLite Database

Project description

pelican-to-sqlite

PyPI GitHub changelog Tests License pre-commit.ci status

Create a SQLite database containing data posts from your local pelican files.

How to install

Using uv (recommended)

uv add pelican-to-sqlite

Using pip

pip install pelican-to-sqlite

Usage

Once the plugin has been installed you only need to run make html to create a SQLite database called pelican.db which will be created in the root of your pelican site.

You will need to add a form to your base.html template (or similar template depending on your theme). The form that needs to be added looks like this (assuming you use Tailwind):

<section class="relative h-8">
<section class="absolute inset-y-0 right-10 w-128">
<form
class = "pl-4"
<
action="your-action-link-here"
method="get">
        <label for="site-search">Search the site:</label>
        <input type="search" id="site-search" name="text"
                aria-label="Search through site content">
        <button class="rounded-full w-16 hover:bg-blue-300">Search</button>
</form>
</section>

In the above, your-action-link-here should be substituted for the link that you get from your Vercel hosted instance of datasette.

Deploy using Vercel

There are many options to deploy your SQLite database with datasette. Below describes using Vercel.

Note: The datasette-publish-vercel plugin may have limited maintenance. Consider alternative deployment methods like Datasette Cloud or manual Vercel deployment if you encounter issues.

First, install datasette using uv (or pip)

uv add datasette
# or: pip install datasette

Next, install the datasette plugin datasette-publish-vercel using uv (or pip)

uv add datasette-publish-vercel
# or: pip install datasette-publish-vercel

and the Vercel CLI

Once that's done, run vercel login to login to (or create) an account.

To publish your pelican.db to Vercel just run:

datasette publish vercel my-database.db

There are several options for outputting to Vercel. See the documentation for more details

Using with Datasette

The SQLite database produced by this tool is designed to be browsed using Datasette. See my post Adding Search to My Pelican Blog with Datasette for more details on how I implemented it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pelican_to_sqlite-0.7.0.tar.gz (72.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pelican_to_sqlite-0.7.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file pelican_to_sqlite-0.7.0.tar.gz.

File metadata

  • Download URL: pelican_to_sqlite-0.7.0.tar.gz
  • Upload date:
  • Size: 72.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for pelican_to_sqlite-0.7.0.tar.gz
Algorithm Hash digest
SHA256 a21faba8072916d4669260928e07797422593b091fb6657f75264bd4d9f3d1e0
MD5 8b2f2848376d2130370236b129432837
BLAKE2b-256 733501b3e1d4dc2177e46d1bce607bdd77db847ea6846dcec510d7253ec963c9

See more details on using hashes here.

File details

Details for the file pelican_to_sqlite-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pelican_to_sqlite-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 889f0b2ae566e583291e764f0f4f80ac3ff72be0ef0b55c08fcd4139b048d891
MD5 2f934866ddee6fb7331358c4d4fc1dc5
BLAKE2b-256 4da63755e33d80f7738bdb824d85d1a3f1d3b5c1c01dea1f130fc5ec9217ef4b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page