gallery blueimp

This commit is contained in:
Andreas Stephanides
2017-09-01 22:52:26 +02:00
parent 2d0f074315
commit bfdeda27be
43 changed files with 14849 additions and 107 deletions

View File

@@ -5,6 +5,8 @@ import os
import re
from os.path import isfile, abspath
from collections import namedtuple
LinkElement=namedtuple("LinkElement", ["title", "url","desc"])
def pjoin2 (pth):
if (not type(pth) is list):
@@ -32,3 +34,18 @@ def path_depth(path):
if p_split[-1]=='index' or p_split[-1]=='index.json' :
cc=cc-1
return cc
def page_to_link(pages, url_for_method):
"page to url"
for p in pages:
yield LinkElement(title=p.meta.get("title",p.path),
url=url_for_method(name=p.path),
desc='/'.join(p.path.split('/')[-2:-1])
)
def file_to_link(files, url_for_method):
"file to url"
for p in files:
yield LinkElement(title=p,
url=url_for_method(name=p),
desc=""
)