diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2014-10-27 18:08:31 +0100 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2014-10-27 18:08:31 +0100 |
| commit | 863ec71a7603423436236a883cb1fe8e484f4674 (patch) | |
| tree | ad3a37f3427097e7b5b51bf8b77e8a9fdd270d4e | |
| parent | aee212c634c7c67a65e2bd76646559027e5aa9df (diff) | |
| download | brentj.es-863ec71a7603423436236a883cb1fe8e484f4674.tar.gz brentj.es-863ec71a7603423436236a883cb1fe8e484f4674.tar.bz2 brentj.es-863ec71a7603423436236a883cb1fe8e484f4674.zip | |
Finished the automisation of the projects page.
| -rw-r--r-- | Projects/index.html | 2 | ||||
| -rw-r--r-- | _config.yml | 11 | ||||
| -rw-r--r-- | _data/projects.yml | 9 | ||||
| -rw-r--r-- | _plugins/ProjectGenerator.rb | 2 | ||||
| -rw-r--r-- | _posts/2014-10-27-learned-how-to-jekyll-the-projects-page.markdown | 11 |
5 files changed, 22 insertions, 13 deletions
diff --git a/Projects/index.html b/Projects/index.html index 60a88e9..edcdfc7 100644 --- a/Projects/index.html +++ b/Projects/index.html @@ -2,7 +2,7 @@ layout: default --- -{% for project in site.projects %} +{% for project in site.data['projects'] %} <div class="col-sm-4 col-xs-6"> <div align="center"> <h6 class="h6">{{project.name}}</h1> diff --git a/_config.yml b/_config.yml index 40694e4..646a0bd 100644 --- a/_config.yml +++ b/_config.yml @@ -4,14 +4,3 @@ highlighter: pygments paginate: 5 paginate_path: "Blog/page:num" - -projects: - - name: Wikileaks leak indexer - file: leakindexer.markdown - thumbnail: /assets/leak.png - - name: DMP - file: dmp.markdown - thumbnail: /assets/dmp.png - - name: HS Soundboard - file: hssb.markdown - thumbnail: /assets/hssb.png diff --git a/_data/projects.yml b/_data/projects.yml new file mode 100644 index 0000000..3b45868 --- /dev/null +++ b/_data/projects.yml @@ -0,0 +1,9 @@ +- name: Wikileaks leak indexer + file: leakindexer.markdown + thumbnail: /assets/leak.png +- name: DMP + file: dmp.markdown + thumbnail: /assets/dmp.png +- name: HS Soundboard + file: hssb.markdown + thumbnail: /assets/hssb.png diff --git a/_plugins/ProjectGenerator.rb b/_plugins/ProjectGenerator.rb index 2e57f8e..4505eb6 100644 --- a/_plugins/ProjectGenerator.rb +++ b/_plugins/ProjectGenerator.rb @@ -20,7 +20,7 @@ module Jekyll def generate(site) dir = site.config['projects_dir'] || 'Projects' - site.config['projects'].each do |project| + site.data['projects'].each do |project| site.pages << ProjectPage.new(site, site.source, dir, project) end end diff --git a/_posts/2014-10-27-learned-how-to-jekyll-the-projects-page.markdown b/_posts/2014-10-27-learned-how-to-jekyll-the-projects-page.markdown new file mode 100644 index 0000000..121b569 --- /dev/null +++ b/_posts/2014-10-27-learned-how-to-jekyll-the-projects-page.markdown @@ -0,0 +1,11 @@ +--- +layout: post +title: "Learned how to jekyll: the projects page" +date: "2014-10-27" +--- + +After a quick question in the Jekyll IRC chat room i was told to use the _data folder instead of using the main site config. The main site config is only read on startup while the data you store under the \_data folder is watched. + +You can create a `filename.yml` file in the \_data folder and it will then be accessible in liquid and any ruby plugins you might have as `site.data['filename']` + +Now my projects page is fully automated to complement my automatic deployment system. |
