A Publish plugin to detect broken urls in html files in the output folder.
To install it into your Publish package, add it as a dependency within your Package.swift
manifest:
let package = Package(
...
dependencies: [
...
.package(name: "DetectBrokenUrlsPublishPlugin", url: "https://github.com/[user_name]/detectbrokenurlspublishplugin", from: "0.1.0")
],
targets: [
.target(
...
dependencies: [
...
"DetectBrokenUrlsPublishPlugin"
]
)
]
...
)
Then import DetectBrokenUrlsPublishPlugin wherever you’d like to use it:
import DetectBrokenUrlsPublishPlugin
For more information on how to use the Swift Package Manager, check out this article, or its official documentation.
The plugin can then be used within any publishing pipeline like this:
import DetectBrokenUrlsPublishPlugin
...
try Website().publish(using: [
...
.installPlugin(.detectBrokenUrls),
...
])
Note, that the html files must already be present in the output folder at the corresponding step in the publishing pipeline. It is therefore best to add this step after .generateHTML(...)
.
Lincensed under the MIT license.