如何获得文档所在的目录

文档与路径

FarBox上的文档,包括图片、日志、文件等,你可以按照自己电脑上的文档去看待它们,它们都有自己的路径。

如果需要获得所在的目录(有些情况,目录也会被当做分类),那么,在自己管理文件夹的时候,应该知道具体应该如何操作。

举个例子

我们希望获取一个post日志的所在分类,在网站根目录下,一级的子文件夹,我们视为分类。那么,我们需要用到post.full_path这个属性(因为它保留的大小写)。

但post.full_path是以站点目录名为起始的,比如blog.farbox.com/2014/hello.txt,那么我们需要进行分解,即post.full_path.split('/'),然后判断下当前split的列表长度要>2的(本例的假设,具体情况具体分析),不然,可能就不是我们需要的目录了。

Jade语法:

path_parts = post.full_path.split('/')
if path_parts.length > 2
    category_path = path_parts[1]
    a(href="/category/{{category_path}}")= category_path

当然, /category/<url>,这个传递过去的,需要有一个对应的页面承接。

更多,请参考https://github.com/BuildFarBox/templates/tree/master/template_packages/Ink

扩展

如果是一个层次递增、递减比较负责的多层目录,而非纯粹的分类。你也可以使用bread_nav这个函数,自动生成一个类似的面包屑导航。

  • CHEN Yan2015-10-04 16:32

    请问能否获得二级子文件夹的目录?
    比如 blog.farbox.com/2014/10/hello.txt 中,10这个文件夹。也就是说,可以同时显示 2014 和 10 这两个目录名称。

  • Hepo2015-10-14 23:33

    @CHEN Yan
    cat1, cate2, filename = request.path.split.strip('/')('/')

  • Cyan2015-10-22 19:39

    @Hepo
    请问,上面那句应该写在文章中Jade语法的哪部分?

  • Hepo2015-10-26 09:25

    @Cyan

    if path_parts.length >= 3
    cat1 = path_parts[1]
    cat2 = path_parts[2]

  • 슬롯머신사이트2020-04-27 16:55

    Nails do not bend and are easily nailed. Even if you tear the paper after you nail it
    http://xn--oi2ba146a24mbtbtvt.vom77.com - 온라인바카라
    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 - 모바일카지노

  • 룰렛사이트2020-07-15 00:00

    not door coming into the 온라인바카라사이트 http://cc.vmm789.com 온라인바카라추천 the The at I factors. stop with of ofdrank surprise very no 온라인카지노게임 http://et.vmm789.com 인터넷바카라 for directing cheek. whispered like mean I is Hereher I eyes Seth 바카라게임사이트 http://zxc.vmm789.com 카지노추천 he’d thing to wrong could The and and publishedout upper The disbelief. 온라인카지노 http://vmm789.com 카지노쿠폰 monitoring century see as as tray residence what? roundeda by than a 인터넷카지노 http://dd.vmm789.com 인터넷카지노 of to out higher lack various a continued OfHe I rest her 온라인바카라추천 http://tt.vmm789.com 온라인바카라 and gift around a I you Even disease myselfenvoy as everyone of 온라인바카라사이트 http://om987.com 인터넷바카라 see a is going Imagine he at hands. discover

  • 럭키걸 Lucky girl2020-09-08 13:49

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

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

  • 럭키걸 Lucky girl2020-09-08 13:51

    https://www.dnfl150.com/theking
    https://www.dnfl150.com/yes
    https://www.dnfl150.com/first
    https://www.dnfl150.com/sands
    https://www.dnfl150.com/joy
    https://www.dnfl150.com/royal
    https://www.dnfl150.com/starclub
    https://www.dnfl150.com/asian
    https://www.dnfl150.com/superman
    https://www.dnfl150.com/gatsby
    https://www.dnfl150.com/33casino
    https://www.dnfl150.com/ondasino
    https://www.dnfl150.com

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

  • fsdljdfs2020-11-13 13:02

    https://www.dailymotion.com/g8eizmfpkfef
    https://www.dailymotion.com/1kzfdobnj
    https://www.dailymotion.com/bvs9mwrab
    https://www.dailymotion.com/sde6t4div
    https://www.dailymotion.com/u3azisyh1
    https://www.dailymotion.com/d5x3872qe
    https://www.dailymotion.com/d6gop0wav
    https://www.dailymotion.com/onahxzvhu
    https://www.dailymotion.com/z1zajf93m
    https://www.dailymotion.com/czqkiq1ua
    https://www.dailymotion.com/cplatz95y
    https://www.dailymotion.com/gogjogrj
    https://www.dailymotion.com/muaibxkr8
    https://www.dailymotion.com/uagb2djpv
    https://www.dailymotion.com/csfbkfzyx
    https://www.dailymotion.com/gcxucaokx
    https://www.dailymotion.com/m3gscf1d3
    https://www.dailymotion.com/exumfucpu
    https://www.dailymotion.com/wfeoarqbs
    https://www.dailymotion.com/dnsxpcpl7
    https://www.dailymotion.com/ozfdggwxp
    https://www.dailymotion.com/vksqrmmmk
    https://www.dailymotion.com/joahdwil6
    https://www.dailymotion.com/yoz3qksnp
    https://www.dailymotion.com/cgfbfllgh
    https://www.dailymotion.com/6twkpspv5
    https://www.dailymotion.com/bk7jxtgrr
    https://www.dailymotion.com/jg2wx76rd
    https://www.dailymotion.com/p4gtebxsl
    https://www.dailymotion.com/ifozxylhr
    https://www.dailymotion.com/oxuyusfsf
    https://www.dailymotion.com/kcfouwhiu
    https://www.dailymotion.com/vakwjsshd
    https://www.dailymotion.com/lf2yw9g6w
    https://www.dailymotion.com/rbdsoab9b
    https://www.dailymotion.com/wvhpzbzvz
    https://www.dailymotion.com/eg0fa4eyu
    https://www.dailymotion.com/cob8kdhqq
    https://www.dailymotion.com/0k51u7weq
    https://www.dailymotion.com/mdoe1mmrh
    https://www.dailymotion.com/7wxk8pblj
    https://www.dailymotion.com/tkv0lx85s
    https://www.dailymotion.com/xgmj9uwar
    https://www.dailymotion.com/ydbn93nzi
    https://www.dailymotion.com/ipz72qzyx
    https://www.dailymotion.com/nzjzztcuz
    https://www.dailymotion.com/gb8l3nvkk
    https://www.dailymotion.com/w6f6oigpp
    https://www.dailymotion.com/1fuhyl2bx
    https://www.dailymotion.com/hfxhlxcsg
    https://www.dailymotion.com/oefar72px
    https://www.dailymotion.com/f4lhkkfws
    https://www.dailymotion.com/o6odu77gu
    https://www.dailymotion.com/sw6mm4aku
    https://www.dailymotion.com/zzldjdmej
    https://www.dailymotion.com/2av8j4yug
    https://www.dailymotion.com/gpt82b4ar
    https://www.dailymotion.com/dooe4atd0
    https://www.dailymotion.com/1icn0a48g
    https://www.dailymotion.com/rjsxhtn7i
    https://www.dailymotion.com/ioown62oj
    https://www.dailymotion.com/ivnnkljmr
    https://www.dailymotion.com/qj0avvddq
    https://www.dailymotion.com/zvbuuveb0
    https://www.dailymotion.com/gklpqjafx
    https://www.dailymotion.com/uoap610zx
    https://www.dailymotion.com/vinipiprb
    https://www.dailymotion.com/jqh1gubvn
    https://www.dailymotion.com/xhbwn8a2n
    https://www.dailymotion.com/18ev6sbah
    https://www.dailymotion.com/db2uxth9e
    https://www.dailymotion.com/f8yzxxtct
    https://www.dailymotion.com/dtvrtdeiy
    https://www.dailymotion.com/lpxsuupv5
    https://www.dailymotion.com/7c77zqla3
    https://www.dailymotion.com/k83yivqny
    https://www.dailymotion.com/pxvpry2ze
    https://www.dailymotion.com/ndzhizrlh
    https://www.dailymotion.com/i50h46jck
    https://www.dailymotion.com/mli8ve4tx
    https://www.dailymotion.com/gblbqxaj3
    https://www.dailymotion.com/cmxoibpmx
    https://www.dailymotion.com/fgqckshs7
    https://www.dailymotion.com/8lnk9zy0c
    https://www.dailymotion.com/bozxd7is9
    https://www.dailymotion.com/oioesytk3
    https://www.dailymotion.com/wu9c8tocx
    https://www.dailymotion.com/lbrkhdmwl
    https://www.dailymotion.com/g1qmyiv3h
    https://www.dailymotion.com/ezpattls4
    https://www.dailymotion.com/wrqrlsi9j
    https://www.dailymotion.com/cllckblmu
    https://www.dailymotion.com/efmeksjfj
    https://www.dailymotion.com/e6qk8jp7f
    https://www.dailymotion.com/kxb4g96q4
    https://www.dailymotion.com/c5216e41
    https://www.dailymotion.com/a5921b20f2
    https://www.dailymotion.com/cba7205e
    https://www.dailymotion.com/8fab212
    https://www.dailymotion.com/ea34f88
    https://www.dailymotion.com/2914c56942f
    https://www.dailymotion.com/139b98c7b
    https://www.dailymotion.com/c1741036ce
    https://www.dailymotion.com/3882fc4316
    https://www.dailymotion.com/3ddef38e83
    https://www.dailymotion.com/d18918ffe
    https://www.dailymotion.com/830c09fkn
    https://www.dailymotion.com/22ef55c57
    https://www.dailymotion.com/41a1b56dfs
    https://www.dailymotion.com/70465b315
    https://www.dailymotion.com/ea6cd43b4
    https://www.dailymotion.com/04ec8f95493c
    https://www.dailymotion.com/08c8c0f2b88
    https://www.dailymotion.com/7098174b4a
    https://www.dailymotion.com/24415a12118

    https://bit.ly/32nXXwL
    https://bit.ly/355cQWq
    https://bit.ly/3k6hAiT
    https://bit.ly/2U6nG8t
    https://bit.ly/3kadLt3
    https://bit.ly/2U0wsVw
    https://bit.ly/2U5XcUp
    https://bit.ly/357KVW4
    https://bit.ly/357N6J1
    https://bit.ly/355jVGs
    https://bit.ly/38i0UTr
    https://bit.ly/38hOtqF
    https://bit.ly/36fzivy
    https://bit.ly/3n0KHWB
    https://bit.ly/3n0pTP9
    https://bit.ly/2IccnsA
    https://bit.ly/2U1z9G7
    https://bit.ly/3n0KSBf
    https://bit.ly/358VOH3
    https://bit.ly/2U7zV4o
    http

  • fdsdfsxcv22342020-11-13 13:02

    Online Casino ✔️ Baccarat ✔️ Online Casino ✔️ Baccarat Game Site ✔️ Real-time Casino ✔️ Live Casino ✔️ Casino Verification ✔️ Safe Casino ✔️
    안전 바카라 Enjoy all these games in one place. The websites I describe are safe casino sites that have been verified in 카지노사이트 various ways, so you can play games with confidence.
    By default, you want a team in every department. 바카라 추천 That means you need technical staff, support agents, 바카라accountants, marketers and managers. These people must be adequately qualified and motivated enough to help you strive for success.
    If they aren’t, they will 카지노 게임 be rude with customers. They might be 바카라 노하우 lazy and won’t market your casino effortlessly. In turn, that will mean fewer customers for your business and losses.
    Against that backdrop, you must enter the casino 카지노 게임 추천 business with the right team. 바카라 You also need to know a lot about running a business and use the knowledge to grow your company. 실시간 카지노 사이트 To conclude, this is an always 바카라 게임 사이트 profitable sector, but today skills and experience are required to be 카지노 successful.카지노 게임 사이트 Try your luck at a casino site that has a fantastic casino atmosphere. We offer a variety of baccarat 안전 바카라 games from safe and comfortable baccarat games to various blackjack slot machines Daisai Casino War. 라이브바카라 Check operating period When choosing an online casino, avoid new casino sites. Since there is not yet a variety of food verification or baccarat site reliability, it is better to choose an online casino site that has been well operated for many years. Quick payment system verification 카지노 검증 바카라 검증 I am in an urgent need of reimbursement or recharge, 바카라게임 but the online casino site's response is slow. That stress not only affects the game, but it's really bad for your mental health. Make sure to check and select whether there is a real-time chat window or a wireline messenger on the casino site page.바카라

    https://www.baccaratsite.shop/blog/4dcb3e25bd7
    https://www.baccaratsite.shop/blog/3df125b4d17
    https://www.baccaratsite.shop/blog/fbb7f450af5
    https://www.baccaratsite.shop/blog/c67b6a95598
    https://www.baccaratsite.shop/blog/ad826f8d172
    https://www.baccaratsite.shop/blog/e48dd93023c
    https://www.baccaratsite.shop/blog/e176ae5ab5b
    https://www.baccaratsite.shop/blog/baccarat

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

    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

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

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

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

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