Swiftpack.co - Cordt/ResponsivePublishPlugin as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Cordt.
Cordt/ResponsivePublishPlugin v0.1.1
A Publish Plugin for image-optimisation using SwiftGD
⭐️ 2
🕓 2 years ago
macOS
.package(url: "https://github.com/Cordt/ResponsivePublishPlugin.git", from: "v0.1.1")

Responsive plugin for Publish

A Publish plugin that uses SwiftGD Image Processing Library to generate next-gen images and rewrites the css and html files in a Publish website.

Installation

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

let package = Package(
    ...
    dependencies: [
        ...
        .package(name: "ResponsivePublishPlugin", url: "https://github.com/Cordt/ResponsivePublishPlugin", .branch("main"))
    ],
    targets: [
        .target(
            ...
            dependencies: [
                ...
                "ResponsivePublishPlugin"
            ]
        )
    ]
    ...
)

Then import ResponsivePublishPlugin wherever you’d like to use it:

import ResponsivePublishPlugin

For more information on how to use the Swift Package Manager, check out this article by John Sundell, or its official documentation.

Usage

The plugin can then be used within any publishing pipeline like this:

import ResponsivePublishPlugin
...
try DeliciousRecipes().publish(using: [
    ...
        .generateHTML(),
        .installPlugin(.generateOptimizedImages()),
    ...
])

It is important that the HTML files are generated prior to installing the plugin, otherwise they cannot be rewritten.

GitHub

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

Release Notes

Responsive Publish Plugin 0.1.1
2 years ago

First running version. Not battle tested yet

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