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():
|
def index():
|
||||||
node='index'
|
node='index'
|
||||||
n = G.node(node)
|
n = G.node(node)
|
||||||
|
n.subnodes = util.rank(n.subnodes, user='agora')
|
||||||
return render_template(
|
return render_template(
|
||||||
'node_rendered.html',
|
'node_rendered.html',
|
||||||
node=n,
|
node=n,
|
||||||
|
|
|
@ -80,10 +80,10 @@ class Graph:
|
||||||
|
|
||||||
# does this belong here?
|
# does this belong here?
|
||||||
@cachetools.func.ttl_cache(maxsize=1, ttl=20)
|
@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)]
|
subnodes = [Subnode(f) for f in glob.glob(os.path.join(config.AGORA_PATH, '**/*.md'), recursive=True)]
|
||||||
if sort:
|
if sort:
|
||||||
return sorted(subnodes, key=lambda x: x.uri.lower())
|
return sorted(subnodes, key=sort)
|
||||||
else:
|
else:
|
||||||
return subnodes
|
return subnodes
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue