有没有办法按字母顺序对一些帖子进行排序,使用Jekyll?
我现在有这样的事情:
{% for post in site.categories.threat %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
它有效,但帖子混乱了.如果他们按字母顺序排序,我认为会更好看.
谢谢
在这里与Jade和Express合作.
'#{value.users}' 是一个数组.
'#{user.username}' 是一个字符串.
想要做 if '#{value.users}'.indexOf('#{user.username}')
如果为true,那么我会显示一堆东西,否则,不应该渲染.
Jade的语法很好,但即使#{value.users}'.indexOf('#{user.username}')是假的,也会呈现if语句中的内容.
例如,如果user.username = bob和value.users = ['tim', 'billy'],则if语句正在传递,但显然不应该.
我究竟做错了什么?
试图学习一些地理空间蟒蛇.或多或少遵循这里的课堂笔记.
#!/usr/bin/python
# import modules
import ogr, sys, os
# set working dir
os.chdir('/home/jacques/misc/pythongis/data')
# create the text file we're writing to
file = open('data_export.txt', 'w')
# import the required driver for .shp
driver = ogr.GetDriverByName('ESRI Shapefile')
# open the datasource
data = driver.Open('road_surveys.shp', 1)
if data is None:
print 'Error, could not locate file'
sys.exit(1)
# grab the datalayer
layer = data.GetLayer()
# loop through the features
feature = layer.GetNextFeature()
while feature:
# acquire attributes
id …Run Code Online (Sandbox Code Playgroud) 我希望通过创建zshdtach 的别名来加快我的工作流程,其功能如下:
dtach -A /tmp/{directoryName} -r winch dvtm
Run Code Online (Sandbox Code Playgroud)
我试过这样做,但是没有用.
dtach -A /tmp/$ -r winch dvtm
Run Code Online (Sandbox Code Playgroud)
ZSH newb在这里,任何帮助将不胜感激.
谢谢!
express ×1
filter ×1
geospatial ×1
javascript ×1
jekyll ×1
liquid ×1
node.js ×1
pug ×1
python ×1
zsh ×1