Fixing ordering random.
This commit is contained in:
parent
4bdfb5bcb6
commit
666097e012
@ -2,7 +2,11 @@
|
|||||||
% my $current_category_slug = stash 'current_category_slug';
|
% my $current_category_slug = stash 'current_category_slug';
|
||||||
<nav class="desktop"><%
|
<nav class="desktop"><%
|
||||||
my @sorted_categories = sort {
|
my @sorted_categories = sort {
|
||||||
$categories->{$a}{priority} <=> $categories->{$b}{priority}
|
my $result = $categories->{$a}{priority} <=> $categories->{$b}{priority};
|
||||||
|
if ($result == 0) {
|
||||||
|
$result = $categories->{$a}{slug} cmp $categories->{$b}{slug};
|
||||||
|
}
|
||||||
|
$result;
|
||||||
} keys %$categories;
|
} keys %$categories;
|
||||||
my $target_category_slug = $current_category_slug;
|
my $target_category_slug = $current_category_slug;
|
||||||
my $current_category = $categories->{$current_category_slug};
|
my $current_category = $categories->{$current_category_slug};
|
||||||
|
Loading…
Reference in New Issue
Block a user