diff --git a/lib/DB/Post.rakumod b/lib/DB/Post.rakumod index c95eab6..983088d 100644 --- a/lib/DB/Post.rakumod +++ b/lib/DB/Post.rakumod @@ -62,9 +62,9 @@ method updated(--> DateTime:D) { #| Get the list of slugs for this post, including ones auto generated from #| the title, as well as any additional slugs method all-slugs(--> Array[Str:D]) { - my $title-words = self.title.lc.trim.words; - my $long-title-slug = $title-words.join('-'); - my $six-word-slug = self.title.lc.words.head(6).join('-'); + my @title-words = self.title.lc.trim.words.map(*.subst(/<-alnum>/, :g)); + my $long-title-slug = @title-words.join('-'); + my $six-word-slug = @title-words.head(6).join('-'); my Str:D @slugs = @!slugs.clone; @slugs.push($long-title-slug); @slugs.push($six-word-slug);