Skip to main content

Pelican plugin to add TailwindCSS to your website.

Project description

TailwindCSS Plugin for Pelican 🌬

Build Status PyPI Version License

This plugin helps you use TailwindCSS in your Pelican website.

Author GitHub Twitter
Luca Fedrizzi https://github.com/lcfd https://twitter.com/lc_fd

Why Use This Plugin?

Because you want use TailwindCSS in seconds. Not hours.

Requirements

In order to run this plugin, you need to install NodeJS. (I'm looking to replace this dependency by using a Python package. – Luca)

Installation

This plugin can be installed via:

python -m pip install pelican-tailwindcss

or

poetry add pelican-tailwindcss

Basic Usage

  1. Create a tailwind.config.js file in your Pelican project root folder containing:

    /** @type {import('tailwindcss').Config} */
    module.exports = {
    content: ["./themes/**/*.html", "./themes/**/*.js"],
    theme: {
        extend: {},
    },
    plugins: [],
    };
    

    The content property values are just suggestions. Feel free to modify them according to your needs.

  2. Create a input.css file in your Pelican project root folder containing:

    @tailwind base;
    @tailwind components;
    @tailwind utilities;
    
  3. Add the build file (output.css) in your base.html.

    <link rel="stylesheet" href="/output.css" />
    
  4. Done! You should be ready to use TailwindCSS in your website template.

Advanced Usage

In your settings you can configure the plugin's behavior using the TAILWIND setting.

An example of a complete TAILWIND setting:

TAILWIND = {
    "version": "3.0.0",
    "plugins": [
        "@tailwindcss/typography",
        "@tailwindcss/forms",
        "@tailwindcss/line-clamp",
        "@tailwindcss/aspect-ratio",
    ],
}

Tailwind plugins install

As you can see from the example above it is possible to add the plugins property to the configuration. Just add the name of a Tailwind plugin in this property and the plugin will be installed.

Useful informations

Plugins

Your tailwind.config.js file will only be copied when Pelican starts. This means that any changes after starting Pelican will not be considered. For example if you want to install a new plugin for Tailwind you will have to restart Pelican.

Contributing

Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on existing issues.

To start contributing to this plugin, review the Contributing to Pelican documentation, beginning with the Contributing Code section.

License

This project is licensed under the AGPL-3.0 license.

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-tailwindcss-0.2.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

pelican_tailwindcss-0.2.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file pelican-tailwindcss-0.2.0.tar.gz.

File metadata

  • Download URL: pelican-tailwindcss-0.2.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.9.13 Linux/5.13.0-1031-azure

File hashes

Hashes for pelican-tailwindcss-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f5943b7b0abdab9c49e2ed39ff4b808ff20ab04b7a35f49fb8b6d176cac17393
MD5 228c510145a2f728bf31ea2d946fd05d
BLAKE2b-256 0f1a21c6440dac4c22a7de7d8e33425a2b23a4fd1da92d673ef50532d6dda621

See more details on using hashes here.

File details

Details for the file pelican_tailwindcss-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pelican_tailwindcss-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15b57401b3ade2df036ee89f0acd5b3b20f987773ed40811305855bd8d761169
MD5 ccfb8fda56485b8dcd6d7cd3ce9421c5
BLAKE2b-256 b3b88624e6354d6530526ca9a12a32f1602f83d12f344de7c96b438437902efb

See more details on using hashes here.

Supported by

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