Abandon Menu Generation
While index generation is generalizable menu generation is not.
diff --git a/bin/buildsite.py b/bin/buildsite.py
index 12643bd..8f416c3 100755
--- a/bin/buildsite.py
+++ b/bin/buildsite.py
@@ -246,6 +246,10 @@
if 'use' in ydata['plugins']:
tdata['use'] = ydata['plugins']['use']
+ tdata['uses_index'] = None
+ if 'index' in tdata:
+ tdata['uses_index'] = 'yes' # ezt.boolean
+
if 'genid' in ydata:
class GenIdParams:
def setbool(self, name):
@@ -273,10 +277,6 @@
tdata['uses_run'] = None
tdata['uses_ignore'] = None
tdata['uses_copy'] = None
- tdata['uses_index'] = None
- if 'index' in tdata:
- tdata['uses_index'] = 'yes' # ezt.boolean
- tdata['asfmenus'] = None # no menu processing
if 'setup' in ydata:
sdata = ydata['setup']
@@ -300,14 +300,6 @@
tdata['uses_copy'] = 'yes' # ezt.boolean
tdata['copy'] = sdata['copy']
tdata['use'].append('asfcopy') # add the plugin
- # Create index information and menus
- if 'menus' in sdata:
- tdata['uses_index'] = 'yes' # ezt.boolean
- tdata['asfmenus'] = sdata['menus'] # yaml data file
- if tdata['uses_index'] == 'yes':
- tdata['use'].append('asfindex') # add the plugin
- if not 'index' in tdata:
- tdata['index'] = None
# if ezmd files are present then use the asfreader plugin
ezmd_count = len(glob.glob(f'{sourcepath}/**/*.ezmd', recursive=True))
diff --git a/bin/pelican.auto.ezt b/bin/pelican.auto.ezt
index dc42cab..74c0d4f 100644
--- a/bin/pelican.auto.ezt
+++ b/bin/pelican.auto.ezt
@@ -94,7 +94,6 @@
[if-any uses_index]
# Configure the asfindex plugin
ASF_INDEX = {
- 'menus': '[asfmenus]',
'index': '[index]',
}
[end]
diff --git a/plugins/asfindex.py b/plugins/asfindex.py
index e1da8bc..267e8d7 100644
--- a/plugins/asfindex.py
+++ b/plugins/asfindex.py
@@ -107,31 +107,32 @@
# get site menu
-def get_menu(site_index, menus):
- currrent_menu = None
- site_menu = ''
- if menus:
- for f in menus:
- path, page = os.path.split(f)
- folder = page.capitalize()
- site_menu += '<li class="nav-item active dropdown">\n'
- site_menu += f'<a class="nav-link dropdown-toggle" href="#" id="dropdown{folder}" '
- site_menu += f'role="button" data-toggle="dropdown" aria-expanded="false">{folder}</a>\n'
- site_menu += f'<ul class="dropdown-menu" aria-labelledby="dropdown{folder}">\n'
- for p in site_index:
- if p[0] == f:
- # menu item for page
- site_menu += f'<li><a class="dropdownitem" href="{p[1]}">{p[2]}</a></li>\n'
- site_menu += '</ul></li>\n'
- return site_menu
-
-
+# def get_menu(site_index, menus):
+# currrent_menu = None
+# site_menu = ''
+# if menus:
+# for f in menus:
+# path, page = os.path.split(f)
+# folder = page.capitalize()
+# site_menu += '<li class="nav-item active dropdown">\n'
+# site_menu += f'<a class="nav-link dropdown-toggle" href="#" id="dropdown{folder}" '
+# site_menu += f'role="button" data-toggle="dropdown" aria-expanded="false">{folder}</a>\n'
+# site_menu += f'<ul class="dropdown-menu" aria-labelledby="dropdown{folder}">\n'
+# for p in site_index:
+# if p[0] == f:
+# # menu item for page
+# site_menu += f'<li><a class="dropdownitem" href="{p[1]}">{p[2]}</a></li>\n'
+# site_menu += '</ul></li>\n'
+# return site_menu
+#
+#
# show pages
def show_pages(generators):
site_index = get_pages(generators)
asf_index = get_setting(generators, 'ASF_INDEX')
print(asf_index)
- set_context(generators, 'SITE_MENU', get_menu(site_index, asf_index['menus']))
+ # Not currently interested in menus this way as it is not generalizable
+ # set_context(generators, 'SITE_MENU', get_menu(site_index, asf_index['menus']))
set_context(generators, 'SITE_INDEX', get_index(site_index, asf_index['index']))