开源软件名称: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.
|
请发表评论