Swiftpack.co - tanabe1478/YoutubePublishPlugin as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by tanabe1478.
tanabe1478/YoutubePublishPlugin 1.0.1
A plugin for Publish that let's you easily embed Youtube in your posts. This plugin is inspired by TwitterPublishPlugin
⭐️ 7
🕓 1 year ago
macOS
.package(url: "https://github.com/tanabe1478/YoutubePublishPlugin.git", from: "1.0.1")

YoutubePublishPlugin

This plugin for Publish will let you embed YouTube videos and TedTalks in your posts easily.

Installation

To install this plugin into your Publish package, add it as a dependency within your Package.swift manifest:

let package = Package(
    ...
    dependencies: [
        ...
        .package(url: "https://github.com/tanabe1478/YoutubePublishPlugin.git", from: "1.0.5")
    ],
    targets: [
        .target(
            ...
            dependencies: [
                ...
                "YoutubePublishPlugin"
            ]
        )
    ]
    ...
)

And import to use it:

import YoutubePublishPlugin

For more information on how to use the Swift Package Manager, check out its official documentation.

Usage

You can use Youtube and Ted Talks separately or together.

Youtube

To embed a youtube in your post, use a blockquote in markdown, but add the "youtube" prefix, like this:

> youtube https://www.youtube.com/watch?v=Z-VfaG9ZN_U

This plugin is compatible with https://youtu.be/ZyJwfxqpUXA and https://www.youtube.com/watch?v=Z-VfaG9ZN_U only.

To install the plugin, add it to your site's publishing steps:

try mysite().publish(using: [
    .installPlugin(.youtube()),
    // ...
])

Ted Talks

To embed a Ted Talk in your post, use a blockquote in markdown, but add the "tedtalk" prefix, like this:

> tedtalk https://www.ted.com/talks/simon_sinek_how_great_leaders_inspire_action

To install the plugin, add it to your site's publishing steps:

try mysite().publish(using: [
    .installPlugin(.tedTalks()),
    // ...
])

Acknowledgement

Thanks to John Sundell (@johnsundell) for creating Publish and SplashPublishPlugin.

Thanks to Guilherme Rambo (@insidegui) for creating the TwitterPublishPlugin that has been a inspiration for this plugin.

License

MIT License

GitHub

link
Stars: 7
Last commit: 32 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

Release Notes

Update swift tool version
1 year ago

I updated the swift tool version of this library. The reason for this is to keep up with Publish updates.

This will solve the problem of not being able to increase the version of the platform when updating Publish due to this library.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics