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.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

lektor_twitter_embed-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file lektor-twitter-embed-0.1.0.tar.gz.

File metadata

  • Download URL: lektor-twitter-embed-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.5 Linux/5.4.0-66-generic

File hashes

Hashes for lektor-twitter-embed-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fc052fc5267c321adbdf49218e44c07ba488085ab39ec4c88588d2806325e17b
MD5 220d01ce103101de0cc37a0a0b8661f3
BLAKE2b-256 23949e62c4af62552c79153a94a5db6743156bf6d6200e56e7c82c7dc7217744

See more details on using hashes here.

File details

Details for the file lektor_twitter_embed-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lektor_twitter_embed-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.5 Linux/5.4.0-66-generic

File hashes

Hashes for lektor_twitter_embed-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3bfd11ce16abb126ef85acf94d879d1b561ac8581dd029967da75956489c30f
MD5 4a0ee1d6886dccf083b9d200b7e1f56d
BLAKE2b-256 a6d2f7de759e5dedef512f30c4ee869edb914cf63a418b60aa4d5cc14e262d55

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