Sitemap query now fully asynchronous
Sitemap generation is now independent from the navbar generation, and it will be added to the navbar only once the navbar has been created. Also, better style for code.
This commit is contained in:
@@ -28,18 +28,6 @@ Future<Element> makePages() async {
|
||||
var pages = Element.ul()
|
||||
..attributes['id'] = 'drop-page'
|
||||
..classes.add('dropdown');
|
||||
await parseSitemap().then((final sitemap) => {
|
||||
sitemap.forEach((url, name) {
|
||||
final link = Element.li()
|
||||
..classes.add('dropdown-item')
|
||||
..insertAdjacentElement(
|
||||
'afterBegin',
|
||||
Element.a()
|
||||
..attributes['href'] = url
|
||||
..innerText = name);
|
||||
pages.insertAdjacentElement('beforeEnd', link);
|
||||
})
|
||||
});
|
||||
return Element.li()
|
||||
..append(Element.a()
|
||||
..attributes['href'] = 'javascript:void(0)'
|
||||
|
||||
Reference in New Issue
Block a user