Filter out articles in titles when sorting
This commit is contained in:
parent
0e6d22ef6f
commit
f75ff8525f
|
@ -124,7 +124,16 @@ function processGame(game) {
|
||||||
model.testcase_date = recent.date;
|
model.testcase_date = recent.date;
|
||||||
}
|
}
|
||||||
|
|
||||||
let section_id = `${model.title[0]}`.toLowerCase();
|
const toTrim = ["the", "a", "an"];
|
||||||
|
|
||||||
|
let trimmedTitle = model.title.toLowerCase();
|
||||||
|
toTrim.forEach(trim => {
|
||||||
|
if (trimmedTitle.startsWith(trim)) {
|
||||||
|
trimmedTitle = trimmedTitle.substr(trim.length + 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let section_id = `${trimmedTitle[0]}`;
|
||||||
if (!section_id.match(/[a-z]+/)) {
|
if (!section_id.match(/[a-z]+/)) {
|
||||||
section_id = "#";
|
section_id = "#";
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue