Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agriyakhetarpal/hugo-twitter-timeline
A simple Hugo shortcode for embedding a Twitter timeline
https://github.com/agriyakhetarpal/hugo-twitter-timeline
hugo hugo-boilerplate hugo-shortcode hugo-shortcodes hugo-theme hugo-theme-component shortcode
Last synced: 7 days ago
JSON representation
A simple Hugo shortcode for embedding a Twitter timeline
- Host: GitHub
- URL: https://github.com/agriyakhetarpal/hugo-twitter-timeline
- Owner: agriyakhetarpal
- License: mit
- Created: 2023-06-05T00:33:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-25T08:58:51.000Z (11 months ago)
- Last Synced: 2024-10-31T06:51:38.093Z (14 days ago)
- Topics: hugo, hugo-boilerplate, hugo-shortcode, hugo-shortcodes, hugo-theme, hugo-theme-component, shortcode
- Language: HTML
- Homepage:
- Size: 4.88 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> [!TIP]
> The Twitter timeline may fail to display in certain scenarios, however, this error comes not from Twitter and not from Hugo or this shortcode. A common cause of error is if Twitter fails to retrieve sufficient login credentials in the browser client when serving requests on a webpage. As of 25th December 2023, this has not been fixed on Twitter's end.# hugo-twitter-timeline
A simple Hugo shortcode for embedding a Twitter timeline, based on the Twitter
widgets code, which can be accessed via https://publish.twitter.com/ and https://platform.twitter.com/widgets.js## Parameters
The supported parameters are
- `username`: The username of the Twitter account to embed the timeline for (required)
- `language`: The ISO 639-1 language code for the language in which to render the timeline (see [Supported languages and browsers – Twitter for Developers](https://developer.twitter.com/en/docs/twitter-for-websites/supported-languages) for more information), set automatically by Twitter if not specified
- `width`: The width of the timeline in pixels
- `height`: The height of the timeline in pixels
- `donottrack`: Whether to enable the [Do Not Track](https://developer.twitter.com/en/docs/twitter-for-websites/privacy) feature, either `true` or `false` – defaults to `true` to preserve your privacy
- `theme`: The theme to use for the timeline, either `light` or `dark` – defaults to `light`## Usage
To use the shortcode, simply add the following to your Hugo content file(s) and/or customise as needed:
```
{{< twitter-timeline username=twitter language=en width=500 height=800 donnottrack=true theme=dark >}}
```assuming that the shortcode is saved as `twitter-timeline.html` in your Hugo theme's `layouts/shortcodes` directory.
## License
This project is licensed under the [MIT License](LICENSE).
## Footnotes
Please feel free to use it across your projects and star this repository. If you have any questions or suggestions, please feel free to open an issue or a pull request.