diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/collect_files.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/collect_files.rs b/src/collect_files.rs index 3616c8a..d6d7cc2 100644 --- a/src/collect_files.rs +++ b/src/collect_files.rs @@ -453,8 +453,8 @@ impl Website { return None; } - /// Check if the external link `path` points to a valid static file. - /// Returns a resolved absolute link to the file. + /// Check if the external link `path` points to a valid static file or + /// generated feed. Returns a resolved absolute link to the file. pub fn has_static(&self, from: &impl LinkFrom, path: &str) -> Option<String> { // Attach parent if not an absolute path. // We don't want to canonicalise/sluggify the path. @@ -462,9 +462,14 @@ impl Website { true => collapse_path(&format!("{}{path}", from.parent_url())), false => collapse_path(path), }; + let root = from.root(); for file in &self.static_files { if file.url == path { - let root = from.root(); + return Some(format!("{root}{path}")); + } + } + for feed in &self.feeds { + if format!("{}.rss", feed.url) == path { return Some(format!("{root}{path}")); } } |
