一个 Publish 插件,它可以轻松地将 Transistor 播客嵌入到任何 Publish 网站的文章中。
通过在 Markdown 中使用块引用,您可以轻松地将 Transistor 播客播放器嵌入到您的网站中。
Apple 平台
Xcode 14.3 或更高版本
Swift 5.8 或更高版本
macOS 12 或更高版本的部署目标
Linux
要将其安装到您的 Publish 包中,请将其作为依赖项添加到您的 Package.swift
清单中
let package = Package(
...
dependencies: [
...
.package(
url: "https://github.com/johnsundell/publish.git",
from: "0.9.0"
),
.package(
url: "https://github.com/brightdigit/TransistorPublishPlugin.git",
from: "1.0.0"
)
],
targets: [
.target(
...
dependencies: [
...
.product(name: "Publish", package: "publish"),
.product(name: "TransistorPublishPlugin", package: "TransistorPublishPlugin"),
]
)
]
...
)
然后,在您想要使用它的任何地方导入 TransistorPublishPlugin
import TransistorPublishPlugin
使用该插件有两个步骤
首先,将插件添加到您的构建步骤中
try DeliciousRecipes().publish(using: [
.installPlugin(.transistor()),
.addMarkdownFiles(),
.copyResources(),
.addFavoriteItems(),
.addDefaultSectionTitles(),
.generateHTML(withTheme: .delicious),
.generateRSSFeed(including: [.recipes]),
.generateSiteMap(),
])
最后,从您的播客剧集中获取分享链接。 在 Transistor 上,这被称为播客剧集的简单分享链接或社交媒体落地页
在您的文章中添加一个包含播客剧集链接的块引用
A thing to know about iOS apps is, that in a lot of cases, people don’t need the cloud to store their data. It can just be stored on their phone.
> transistor https://share.transistor.fm/s/67771090
When you're building an app, you should consider whether you really need something stored in the cloud. **In the end, you could save a lot of time and money, if everything can be saved as a file, keep the data on the phone, and maybe only back that data up into cloud storage.**
现在您应该在渲染的页面上看到嵌入内容
此代码在 MIT 许可证下分发。 有关更多信息,请参见 LICENSE 文件。