themes\icarus\layout\categories.ejs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| return categories.sort((a, b) => { return get_config('categort_weight.' + a.name, 99) - get_config('categort_weight.' + b.name, 99); }).map(category => { let result = `<li> <a class="level is-marginless" href="${category.url}"> <span class="level-start"> <span class="level-item">${category.name}</span> </span> <span class="level-end"> <span class="level-item tag">${category.count}</span> </span> </a>`; if (category.hasOwnProperty('children')) { result += '<ul>' + build_list(category.children) + '</ul>'; } return result + '</li>'; }).join('');
|
themes\icarus\_config.yml
1 2 3 4 5 6 7 8 9 10
| categort_weight: php: 1 laravel: 11 thinkphp: 12 go: 2 javascript: 3 vue: 31 python: 4 其他: 5
|
测试

