浏览代码

Order galleries and photos by name

master
Marien Fressinaud 6 年前
父节点
当前提交
65431d0a9f
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      boop.py

+ 4
- 1
boop.py 查看文件

@@ -4,6 +4,8 @@ import os
import shutil
import re

from operator import itemgetter

from jinja2 import Environment, PackageLoader, select_autoescape

from configuration import SITE_TITLE, THEME
@@ -20,6 +22,7 @@ def list_galleries_in(path):
if len(photos) == 0:
continue

photos.sort(key=itemgetter("name"))
gallery = {
"name": gallery_dir.name,
"path": gallery_dir.path,
@@ -100,10 +103,10 @@ def generate_gallery_dir(output_path, gallery):
def main():
pictures_folder = os.path.join(os.curdir, PICTURES_DIR_NAME)
galleries = list(list_galleries_in(pictures_folder))

if len(galleries) == 0:
return

galleries.sort(key=itemgetter("name"))
output_path = generate_output_dir()
generate_style(output_path)
generate_index(output_path, galleries)

正在加载...
取消
保存