From 004a333ffedd8c216c2f4f3a29ac05a4e3cfdea9 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Tue, 5 May 2020 16:48:09 +0200 Subject: [PATCH] Added keywords to be excluded from page listing --- web/dart/parse_sitemap.dart | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/web/dart/parse_sitemap.dart b/web/dart/parse_sitemap.dart index 33ccd94..c0ca0d7 100644 --- a/web/dart/parse_sitemap.dart +++ b/web/dart/parse_sitemap.dart @@ -3,6 +3,8 @@ import 'dart:html' show HttpRequest; import 'package:html/parser.dart' show parse; import 'package:html/dom.dart' show Element; +final excluded_keywords = ['index', 'CONTRIBUTING', 'LICENSE', 'README']; + // Get the sitemap content Future getSitemap() async { const path = 'sitemap.html'; @@ -18,9 +20,12 @@ Future getSitemap() async { Map detectPages(List sitemap, [String prefix]) { final links = {}; for (var elem in sitemap) { - if (elem.outerHtml.contains('index')) { - continue; - } else if (elem.innerHtml.startsWith('