PerFolderResourcesPublishPlugin - Per-folder resources plugin for the Publish package

Overview

Per-folder resources for Publish

A Publish plugin that copies per-folder resources to the same location in the static site output.

By default, Publish's copyResources() step copies a single file of resources from the unpublished content folder to the static site output folder. This extension traverses the content folder to find resources in any folder and copies them to an output folder with the same folder path.

This may be useful if, for example, your site contains blog posts or other individual pages where inline images or other resources are in the same directory as the post's Markdown file.

For purposes of this plugin, "resources" means anything that's not a Markdown or text file.

Note: Currently this plugin depends on a fork of Publish, which adds the .gitignore-ish shouldIgnore(name:) function to Website. If this seems useful to you, please comment on the pull request.

Installation

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

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

In the .package entry above it's currently necessary to use .branch("main") but with luck the PR mentioned earlier will be accepted and then this can be changed to a version requirement.

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

Usage

First import PerFolderResourcesPublishPlugin wherever you’d like to use it:

import PerFolderResourcesPublishPlugin

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

import PerFolderResourcesPublishPlugin

...
try DeliciousRecipes().publish(using: [
    ...
    .installPlugin(.copyPerDirectoryResources()),
    ...
])

This plugin can be installed at any point in the publishing process. It does not depend on or affect other steps.

If you're using a custom folder in the addMarkdownFiles publishing step, pass the same folder as the argument to this plugin:

import PerFolderResourcesPublishPlugin
...

try DeliciousRecipes().publish(using: [
    ...
    .addMarkdownFiles(at: myContentPath),
    ...
    .installPlugin(.copyPerDirectoryResources(at: myContentPath)),
    ...
])
You might also like...
Xcode plugin that moves the instruction pointer to the selected line
Xcode plugin that moves the instruction pointer to the selected line

SFJumpToLine Xcode plugin that moves the instruction pointer to the selected line. Install: Install via Alcatraz Or clone and build the project, then

Touch ID Plugin (Cordova) for iOS

cordova-plugin-gctouch-id Touch ID Plugin (Cordova) for iOS Author: Giulio Caruso aka rdn Index Description Technical Documentation Screenshots Adding

Xcode plugin that brings ⇧⌘T from AppCode over to Xcode

Aviator An Xcode Plugin that brings ⇧⌘T over to Xcode This minimal plugin allows you to use the key combo ⇧⌘T to toggle between source and test files.

An Xcode plugin for manually symbolicating crash logs
An Xcode plugin for manually symbolicating crash logs

CrashSymbal An Xcode plugin for manually symbolicating crash logs Install Build the project to install the plugin. The plugin gets installed in /Libra

XcodeColorSense - An Xcode plugin that makes working with color easier.
XcodeColorSense - An Xcode plugin that makes working with color easier.

XcodeColorSense An Xcode plugin that makes working with color easier. Inspired by ColorSense-for-Xcode with extra care for Hex color Features Show col

A Xcode plugin to add highlight to the instances of selected symbol.
A Xcode plugin to add highlight to the instances of selected symbol.

Auto Highlight Symbol About Xcode 8 Xcode 8 does't support plugins anymore, but there is a workaround, use at your own risk. Xcode can highlight insta

An Xcode 7 plugin to build and run an app across multiple iOS devices with one click.
An Xcode 7 plugin to build and run an app across multiple iOS devices with one click.

RunEverywhere Xcode Plugin Overview An Xcode 7 plugin to build and run an app across multiple iOS devices with one click. Gone are the days of manuall

Xcode plugin to open the GitHub page of the commit of the currently selected line in the editor window.
Xcode plugin to open the GitHub page of the commit of the currently selected line in the editor window.

Show in GitHub / BitBucket Xcode plugin to open a related Github or BitBucket page directly from the Xcode editor code window. Installs easily through

An Xcode plugin to improve dealing with colors in your project
An Xcode plugin to improve dealing with colors in your project

Crayons is an Xcode7 plugin with various features that improve working with colors in your projects ##Code palettes (iOS only) You can share palettes

Releases(0.1.0)
Owner
Tom Harrington
iOS Developer. Didgeridoo player. Occasional radio disk jockey.
Tom Harrington
Cordova-plugin-saveimage - This plugin helps you save images

cordova-plugin-saveimage This plugin helps you save images on iOS/Android Instal

Bernat 2 May 11, 2022
SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them type-safe to use.

SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them type-safe to use.

null 8.3k Jan 5, 2023
Swift Package Manager command plugin for Swift-DocC

Swift-DocC Plugin The Swift-DocC plugin is a Swift Package Manager command plugin that supports building documentation for SwiftPM libraries and execu

Apple 225 Dec 24, 2022
A VisionCamera Frame Processor plugin for fast buffer resizing

vision-camera-resize-plugin A VisionCamera Frame Processor Plugin for fast buffer resizing. By resizing buffers to a smaller resolution, you can achie

Marc Rousavy 16 Aug 10, 2022
This simple cordova plugin will download picture from an URL and save to IOS Photo Gallery.

Photo Viewer This plugin is intended to download a picture from an URL into IOS Photo library.. How to Install Cordova: cordova plugin add https://git

Alwin jose 1 Oct 23, 2021
Cordova plugin for detect screenshots and recordings

cordova-plugin-detect-screen-capture This plugin detects screen recording and screenshot events. The plugin will only work on devices with iOS >= 7 Su

Sasha 0 Nov 4, 2021
API surface for Swift plug-ins using the Swift Plugin Manager

SwiftPlugin The minimal API surface required for the Swift Plugin Manager to create instances from a loaded plugin. Additional documentation and refer

Joakim Hassila 2 Mar 25, 2022
Cordova plugin to display a native color-picker dialog

Color Picker Plugin for Cordova (cordova-plugin-color-picker) Description This plugin allows you to display a color-picker native dialog in iOS and An

Antonio Vargas 1 May 10, 2022
Metazoom - A virtual camera plugin to pixellatedly share your screen

MetaZoom A virtual camera plugin to pixellatedly share your screen. See LICENSE.

Sahil Lavingia 22 Jan 4, 2023
Flutter openvpn - A new Flutter plugin that uses OpenVpn

flutter_openvpn A new Flutter plugin that uses OpenVpn. Installation Depend on i

Ferdi Gökdemir 0 Jan 8, 2022