Skip to content

Commit b843426

Browse files
authored
Merge pull request #333 from JohannesHoppe/custom-link
Override the default link
2 parents 78ba5ed + 44f4f35 commit b843426

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

config.toml.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ vimeo = [ # Multiple keys will be rotated.
9595
author = "Mrs. Smith ([email protected])"
9696
ownerName = "Mrs. Smith"
9797
ownerEmail = "[email protected]"
98+
# optional: this will override the default link (usually the URL address) in the generated RSS feed with another link
99+
link = "https://example.org"
98100

99101
# Podsync uses local database to store feeds and episodes metadata.
100102
# This section is optional and usually not needed to configure unless some very specific corner cases.

pkg/feed/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ type Custom struct {
6464
Description string `toml:"description"`
6565
OwnerName string `toml:"ownerName"`
6666
OwnerEmail string `toml:"ownerEmail"`
67+
Link string `toml:"link"`
6768
}
6869

6970
type Cleanup struct {

pkg/feed/xml.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func Build(_ctx context.Context, feed *model.Feed, cfg *Config, hostname string)
4141
author = feed.Title
4242
title = feed.Title
4343
description = feed.Description
44+
feedLink = feed.ItemURL
4445
)
4546

4647
if cfg.Custom.Author != "" {
@@ -55,7 +56,11 @@ func Build(_ctx context.Context, feed *model.Feed, cfg *Config, hostname string)
5556
description = cfg.Custom.Description
5657
}
5758

58-
p := itunes.New(title, feed.ItemURL, description, &feed.PubDate, &now)
59+
if cfg.Custom.Link != "" {
60+
feedLink = cfg.Custom.Link
61+
}
62+
63+
p := itunes.New(title, feedLink, description, &feed.PubDate, &now)
5964
p.Generator = podsyncGenerator
6065
p.AddSubTitle(title)
6166
p.IAuthor = author

0 commit comments

Comments
 (0)