Skip to content

rypan/jekyll-db

gh-pages
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published