• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

rypan/jekyll-db: An easy way to use Jekyll and Github Pages as a "database ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

rypan/jekyll-db

开源软件地址:

https://github.com/rypan/jekyll-db

开源编程语言:

CSS 99.6%

开源软件介绍:

Jekyll-DB

An easy way to use Jekyll and Github Pages as a "database".

See it in action: http://rypan.github.io/jekyll-db

Use posts as entries

---
layout: entry
company-name: AchieveMint
city: San Francisco
state: California
employees: 100

categories:
- startup

tags:
- wellness
- consumer
- employer
---

Output your fields in a table

<tbody class="list">
{% for post in site.posts %}
	<tr>
		<td class="name">{{ post.company-name }}</td>
		<td class="city">{{ post.city }}</td>
		<td class="category">{{ post.categories }}</td>
		<td class="tags">{{ post.tags | array_to_sentence_string }}</td>
	</tr>
{% endfor %}
</tbody>

Index the appropriate fields

<script type="text/javascript">

var options = {
  valueNames: ['name', 'city', 'category', 'tags']
};

var entryList = new List('entry-list', options);

</script>

Output your data as JSON

---
layout: none
---
[{% for post in site.posts %}{
	"company-name": "{{post.company-name}}",
	"city": "{{post.city}}",
	"state": "{{post.state}}",
	"employees": "{{post.employees}}",
	"tags": "{{ post.tags | array_to_sentence_string }}",
	"categories": "{{post.categories}}"
}{% if forloop.rindex0 > 0 %},{% endif %}{% endfor %}]

Credits

All the credits go to Jekyll, ListJS + Bootstrap. I just pulled the pieces together.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap