Fix Agora indexing after move to node-to-template.
This commit is contained in:
parent
b2402c34d7
commit
dc3db05078
2 changed files with 3 additions and 2 deletions
|
@ -31,6 +31,7 @@ G = db.G
|
|||
def index():
|
||||
node='index'
|
||||
n = G.node(node)
|
||||
n.subnodes = util.rank(n.subnodes, user='agora')
|
||||
return render_template(
|
||||
'node_rendered.html',
|
||||
node=n,
|
||||
|
|
|
@ -80,10 +80,10 @@ class Graph:
|
|||
|
||||
# does this belong here?
|
||||
@cachetools.func.ttl_cache(maxsize=1, ttl=20)
|
||||
def subnodes(self, sort=True):
|
||||
def subnodes(self, sort=lambda x: x.uri.lower()):
|
||||
subnodes = [Subnode(f) for f in glob.glob(os.path.join(config.AGORA_PATH, '**/*.md'), recursive=True)]
|
||||
if sort:
|
||||
return sorted(subnodes, key=lambda x: x.uri.lower())
|
||||
return sorted(subnodes, key=sort)
|
||||
else:
|
||||
return subnodes
|
||||
|
||||
|
|
Loading…
Reference in a new issue