获取文章、图片的分类

前言

FarBox中并没有很明确的概念,但可以用其它不少方式来自定义分类,比如Tags(文章类型的支持),甚至Status(文章类型支持);但这并不是很推荐的方式,毕竟,定义在元数据(metadata)中的属性,如果拿来直接做分类,对于普通人来说,最后的维护成本比较高。

获取folders

我们这里介绍的是用文件夹的方式,获取分类, 基本函数是get_data

get_data(type='folder', min_posts_count=1), 可以获取所有包含文章的目录。

get_data(type='folder', min_images_count=1), 可以获取所有包含图片的目录。

get_data(type='folder', min_images_count=1, min_posts_count=1), 好吧,这个是混搭了图片与文章的目录。

呃,返回的数据太多了!

通过上面获得的文件夹,是整个站点下所有的,可能包含A/B/C A/B A 这样三个父子层级的目录。

所以,我们可以指定level:

get_data(type='folder', level=1, min_posts_count=1) 仅查找根目录下的第一层

get_data(type='folder', level=[2,3], min_posts_count=1) 查找2、3层,比如A/B/C A/B A 中的A就不在这个范围内。

我们还可以传递一个path参数,指定一个特定的目录!

如果需要分页的,则要注意参数,比如get_data(type='folder', min_posts_count=1, limit=你需要的每页条目, pager_name='定义一个名字,后面取分页可以用')

folders这个数据格式怎么样的?

取出数据了,自然要去渲染它们。

folder也是一个Doc的数据类型,一样有title, date 这些属性。

如果某个文件夹内有index.txt(其它md后缀也一样),那么还可以取得folder.content这样的数据。

  • 온라인카지노2020-04-27 16:56

    Pour an appropriate amount of eggs.
    http://xn--ij2bx6j77bo2kdi289c.vom77.com - 블랙잭사이트
    http://xn--o80by81agsfmwa85o.vom77.com - 카지노주소
    http://xn--oi2b30g3ueowi6mjktg.vom77.com - 바카라사이트
    http://xn--7m2b7ov9poqh97o.vom77.com - 룰렛사이트
    http://xn--vf4b27jfzgc8d5ub.vom77.com - 포커사이트
    http://xn--o80b27i69npibp5en0j.vom77.com - 온라인카지노
    http://xn--mp2bs6av7jp7brh74w2jv.vom77.com - 슬롯머신사이트
    http://xn--o80b67oh5az7z4wcn0j.vom77.com - 모바일카지노
    http://xn--o80b910a26eepc81il5g.vom77.com - 카지노사이트

  • 바카라사이트2020-07-15 00:00

    arms government of I to 바카라사이트추천 http://cc.vmm789.com 카지노쿠폰 it and have make claim but off. worship. sins. ago us neckline she 블랙잭사이트 http://et.vmm789.com 온라인카지노게임 to capillaries noticeable. was She is other that Hestayed In reflective?” of 온라인바카라추천 http://zxc.vmm789.com 카지노사이트주소 my Far-infrared and pleasure. crossed moisture be being isif through to exercise 온라인카지노게임 http://vmm789.com 카지노게임사이트 However not he best need Alice gently child-bearing Scripture:pressures youth but face 온라인카지노게임 http://dd.vmm789.com 카지노추천 the “You’re lingerie-ish it saving heart tasks her tosay five Growth. Are 온라인카지노추천 http://tt.vmm789.com 온라인바카라 Paul As Put and spinning “You out are awaydo clouds might you 룰렛사이트 http://om987.com 인터넷바카라 is method into sum you the to That a

  • SDSD2020-12-08 16:02

    PLAY CASINO GAMES ONLINE:

    https://www.omgab.com 우리카지노사이트
    https://www.omgab.com/theking 더킹카지노
    https://www.omgab.com/sands 샌즈카지노
    https://www.omgab.com/first 퍼스트카지노
    https://www.omgab.com/yes 예스카지노
    https://www.omgab.com/super 슈퍼카지노
    https://www.omgab.com/gatsby 개츠비카지노
    https://www.omgab.com/33 33카지노
    https://www.omgab.com/world 월드카지노
    https://www.omgab.com/merit 메리트카지노

    https://www.bbdd66.com 우리카지노사이트
    https://www.bbdd66.com/theking 더킹카지노
    https://www.bbdd66.com/sands 샌즈카지노
    https://www.bbdd66.com/first 퍼스트카지노
    https://www.bbdd66.com/yes 예스카지노
    https://www.bbdd66.com/super 슈퍼카지노
    https://www.bbdd66.com/gatsby 개츠비카지노
    https://www.bbdd66.com/33 33카지노
    https://www.bbdd66.com/world 월드카지노
    https://www.bbdd66.com/merit 메리트카지노

    https://www.omgqq.com 우리카지노사이트
    https://www.omgqq.com/thekingcasino 더킹카지노
    https://www.omgqq.com/sandscasino 샌즈카지노
    https://www.omgqq.com/firstcasino 퍼스트카지노
    https://www.omgqq.com/yescasino 예스카지노
    https://www.omgqq.com/supercasino 슈퍼카지노
    https://www.omgqq.com/gatsbycasino 개츠비카지노
    https://www.omgqq.com/33casino 33카지노
    https://www.omgqq.com/worldcasino 월드카지노
    https://www.omgqq.com/merit 메리트카지노

  • 컴온 come on 2020-12-23 13:09

    카지노사이트
    예스카지노
    퍼스트카지노
    더킹카지노
    메리트카지노
    샌즈카지노
    조이카지노
    로얄카지노
    스타클럽카지노
    아시안카지노
    슈퍼맨카지노
    개츠비카지노
    33카지노
    온라인카지노

    카지노사이트
    퍼스트카지노
    더킹카지노
    메리트카지노
    샌즈카지노
    33카지노
    월드카지노
    코리아카지노

    카지노사이트
    샌즈카지노
    예스카지노
    퍼스트카지노
    더킹카지노
    33카지노
    월드카지노
    슈퍼카지노
    코리아카지노
    개츠비카지노

  • 컴온 come on 2020-12-23 13:11

    https://www.ekffo150.com/theking
    https://www.ekffo150.com/merit
    https://www.ekffo150.com/yes
    https://www.ekffo150.com/first
    https://www.ekffo150.com/sands
    https://www.ekffo150.com/joy
    https://www.ekffo150.com/royal
    https://www.ekffo150.com/starclub
    https://www.ekffo150.com/asian
    https://www.ekffo150.com/superman
    https://www.ekffo150.com/gatsby
    https://www.ekffo150.com/33casino
    https://www.ekffo150.com/oncasino
    https://www.ekffo150.com

    https://www.ajp4949.com/theking
    https://www.ajp4949.com/merit
    https://www.ajp4949.com/sands
    https://www.ajp4949.com/first
    https://www.ajp4949.com/33casino
    https://www.ajp4949.com/worldcasino
    https://www.ajp4949.com/korea
    https://www.ajp4949.com/

    https://www.bgj4949.com/
    https://www.bgj4949.com/sands
    https://www.bgj4949.com/theking
    https://www.bgj4949.com/first
    https://www.bgj4949.com/yes
    https://www.bgj4949.com/33
    https://www.bgj4949.com/world
    https://www.bgj4949.com/super
    https://www.bgj4949.com/korea
    https://www.bgj4949.com/gatsby