resolve method

  1. @override
Future<List<RouteMeta>> resolve()
override

Implementation

@override
Future<List<RouteMeta>> resolve() async {
  return [
    _index(),
    if (taxonomy.categories.isNotEmpty)
      _taxonomyIndex(
        '/blog/categoria',
        'Categorias',
        'Todas as categorias do blog.',
      ),
    if (taxonomy.tags.isNotEmpty)
      _taxonomyIndex('/blog/tag', 'Tags', 'Todas as tags do blog.'),
    ...posts.where((p) => !p.draft).map(_post),
    ...taxonomy.categories.map(
      (c) => _archive(
        path: c.category.path,
        title: 'Categoria: ${c.category.name}',
        count: c.posts.length,
        section: 'Categorias',
      ),
    ),
    ...taxonomy.tags.map(
      (t) => _archive(
        path: t.tag.path,
        title: 'Tag: ${t.tag.name}',
        count: t.posts.length,
        section: 'Tags',
      ),
    ),
  ];
}