Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/webls/atom.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ pub fn with_entry_updated(entry: AtomEntry, updated: Time) -> AtomEntry {
}

pub fn with_entry_authors(entry: AtomEntry, authors: List(Person)) -> AtomEntry {
AtomEntry(..entry, authors: list.concat([entry.authors, authors]))
AtomEntry(..entry, authors: list.flatten([entry.authors, authors]))
}

pub fn with_entry_content(entry: AtomEntry, content: Text) -> AtomEntry {
Expand All @@ -338,7 +338,7 @@ pub fn with_entry_categories(
entry: AtomEntry,
categories: List(Category),
) -> AtomEntry {
AtomEntry(..entry, categories: list.concat([entry.categories, categories]))
AtomEntry(..entry, categories: list.flatten([entry.categories, categories]))
}

pub fn with_entry_contributors(
Expand All @@ -347,7 +347,7 @@ pub fn with_entry_contributors(
) -> AtomEntry {
AtomEntry(
..entry,
contributors: list.concat([entry.contributors, contributors]),
contributors: list.flatten([entry.contributors, contributors]),
)
}

Expand All @@ -368,7 +368,7 @@ pub fn with_feed_author(feed: AtomFeed, author: Person) -> AtomFeed {
}

pub fn with_feed_authors(feed: AtomFeed, authors: List(Person)) -> AtomFeed {
AtomFeed(..feed, authors: list.concat([feed.authors, authors]))
AtomFeed(..feed, authors: list.flatten([feed.authors, authors]))
}

pub fn with_feed_link(feed: AtomFeed, link: Link) -> AtomFeed {
Expand All @@ -383,7 +383,7 @@ pub fn with_feed_categories(
feed: AtomFeed,
categories: List(Category),
) -> AtomFeed {
AtomFeed(..feed, categories: list.concat([feed.categories, categories]))
AtomFeed(..feed, categories: list.flatten([feed.categories, categories]))
}

pub fn with_feed_contributor(feed: AtomFeed, contributor: Person) -> AtomFeed {
Expand All @@ -394,7 +394,10 @@ pub fn with_feed_contributors(
feed: AtomFeed,
contributors: List(Person),
) -> AtomFeed {
AtomFeed(..feed, contributors: list.concat([feed.contributors, contributors]))
AtomFeed(
..feed,
contributors: list.flatten([feed.contributors, contributors]),
)
}

pub fn with_feed_generator(feed: AtomFeed, generator: Generator) -> AtomFeed {
Expand Down Expand Up @@ -422,7 +425,7 @@ pub fn with_feed_entry(feed: AtomFeed, entry: AtomEntry) -> AtomFeed {
}

pub fn with_feed_entries(feed: AtomFeed, entries: List(AtomEntry)) -> AtomFeed {
AtomFeed(..feed, entries: list.concat([feed.entries, entries]))
AtomFeed(..feed, entries: list.flatten([feed.entries, entries]))
}

// Types ----------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/webls/robots.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn with_config_robots(
config: RobotsConfig,
robots: List(Robot),
) -> RobotsConfig {
RobotsConfig(..config, robots: list.concat([config.robots, robots]))
RobotsConfig(..config, robots: list.flatten([config.robots, robots]))
}

/// Adds a robot to the robots config
Expand All @@ -55,7 +55,7 @@ pub fn robot(user_agent: String) -> Robot {

/// Adds a list of allowed routes to the robot policy
pub fn with_robot_allowed_routes(robot: Robot, routes: List(String)) -> Robot {
Robot(..robot, allowed_routes: list.concat([robot.allowed_routes, routes]))
Robot(..robot, allowed_routes: list.flatten([robot.allowed_routes, routes]))
}

/// Adds a allowed route to the robot policy
Expand All @@ -67,7 +67,7 @@ pub fn with_robot_allowed_route(robot: Robot, route: String) -> Robot {
pub fn with_robot_disallowed_routes(robot: Robot, routes: List(String)) -> Robot {
Robot(
..robot,
disallowed_routes: list.concat([robot.disallowed_routes, routes]),
disallowed_routes: list.flatten([robot.disallowed_routes, routes]),
)
}

Expand Down
4 changes: 2 additions & 2 deletions src/webls/rss.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ pub fn with_channel_categories(
) -> RssChannel {
RssChannel(
..channel,
categories: list.concat([channel.categories, categories]),
categories: list.flatten([channel.categories, categories]),
)
}

Expand Down Expand Up @@ -388,7 +388,7 @@ pub fn with_channel_items(
channel: RssChannel,
items: List(RssItem),
) -> RssChannel {
RssChannel(..channel, items: list.concat([channel.items, items]))
RssChannel(..channel, items: list.flatten([channel.items, items]))
}

/// Adds a RSS item to the RSS channel
Expand Down
2 changes: 1 addition & 1 deletion src/webls/sitemap.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn sitemap(url: String) -> Sitemap {

/// Adds a list of sitemap items to the sitemap
pub fn with_sitemap_items(sitemap: Sitemap, items: List(SitemapItem)) -> Sitemap {
Sitemap(..sitemap, items: list.concat([sitemap.items, items]))
Sitemap(..sitemap, items: list.flatten([sitemap.items, items]))
}

/// Adds a sitemap item to the sitemap
Expand Down