Skip to main content

Lektor template filter to convert twitter links to embeds

Project description

lektor-twitter-embed

Run tests codecov PyPI Version License Python Compatibility Code style: black

Lektor template filter to convert twitter links to embeds

Installation

pip install lektor-twitter-embed

Usage

{{ "https://twitter.com/MaiaFranklyn/status/1277100235928621058" | tweet }}

It is possible to pass an optional 'params' object to configure the embed. Any of the params documented at https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-oembed may be supplied

{{
  "https://twitter.com/MaiaFranklyn/status/1277100235928621058" | tweet(
    params={'align': 'center', 'hide_thread': 'true'}
  )
}}

By default if the request to publish.twitter.com fails, your page will not build. This behaviour can be changed so that a failed request to publish.twitter.com will fall back to rendering a link to the tweet.

{{ "https://twitter.com/lucaviftw/status/1347311486012686336" | tweet(fallback=True) }}

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

lektor-twitter-embed-0.2.0.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

lektor_twitter_embed-0.2.0-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

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