Jekyll

Accessing _data in Jekyll (loop in loop)

风流意气都作罢 提交于 2019-12-30 19:24:33
问题 Given this YAML: - maincategory: title: "Projects" subcategory: title: "General" item: title: "Alpha" item: title: "Beta" - maincategory: title: "Support" subcategory: title: "General" item: title: "Something" item: title: "Else" How would one iterate over this data if the Jekyll _data file is called entries.yml? So far I've gotten here but I'm not sure whether I should keep referencing the site.data oject in sub-loops. Also not sure whether this is even possible. {% for entry in site.data

Get Jekyll Posts by Year [duplicate]

扶醉桌前 提交于 2019-12-30 14:51:05
问题 This question already has answers here : Jekyll/Liquid Templating: How to group blog posts by year? (7 answers) Closed 5 years ago . I'm making an "archive" if you will of all the posts on my site. I want to gather all the posts from a year. This code works fine, however; I want it to generate the <h2>2014</h2> when needed. Basically, if year is 2014, render <h2>2014</h2> and make a <ul> of all the posts (with category of journal) from that given year. If anyone knows of any .rb plugins that

Get Jekyll Posts by Year [duplicate]

北慕城南 提交于 2019-12-30 14:50:42
问题 This question already has answers here : Jekyll/Liquid Templating: How to group blog posts by year? (7 answers) Closed 5 years ago . I'm making an "archive" if you will of all the posts on my site. I want to gather all the posts from a year. This code works fine, however; I want it to generate the <h2>2014</h2> when needed. Basically, if year is 2014, render <h2>2014</h2> and make a <ul> of all the posts (with category of journal) from that given year. If anyone knows of any .rb plugins that

Jekyll paginate blog as subdirectory

∥☆過路亽.° 提交于 2019-12-30 10:24:14
问题 I'm using Jekyll for a static site and I'm trying to generate the blog as a subdirectory/subfolder: http://example.com/blog In the directory structure before running jekyll, this is blog/index.html. I tried adding pagination by adding "paginate: 5" to _config.yml, but the generated url's were of the form: http://example.com/page2/ i.e. no "/blog". This is fixed by: paginate_path: /blog/page/:num in _config.yml. But the resulting generated pages at: http://example.com/blog/page/2/ don't use

Jekyll, Liquid, Random numbers

a 夏天 提交于 2019-12-30 02:17:18
问题 I would like to have a set of links <li> <h2>Random Articles</h2> <ul> <li><a href="#">Old article 1</a></li> <li><a href="#">Old article 1</a></li> <li><a href="#">Old article 1</a></li> </ul> </li> But I want to generate the links from a random selection of my posts. I'm using jekyll and liquid to generate the site. I must use built in parts of jekyll as I'm hosting on github. I'm not really sure where to start on this. Google searches on the topic are fruitless. 回答1: I had a similar desire

Cannot run Jekyll new command

你说的曾经没有我的故事 提交于 2019-12-29 06:10:33
问题 I tried to use Jekyll new command, but it didn't work and came out following errors. $ jekyll new myblog /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/runner.rb:385:in `require_program': program version required (Commander::Runner::CommandError) from /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/runner.rb:384:in `each' from /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/runner.rb:384:in `require_program' from /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib

Error Installing Jekyll - Native Extension Build

六月ゝ 毕业季﹏ 提交于 2019-12-28 11:41:07
问题 I'm having some trouble installing jekyll. Can't quite figure out how to patch the missing link. I think it's an update to Ruby, but RVM is having trouble installing alternate versions of ruby as well. Heres the full post: $ sudo gem install jekyll ERROR: Error installing jekyll: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework

Jekyll display posts by category

我的未来我决定 提交于 2019-12-28 07:41:28
问题 scratching my head over this - help much appreciated. I want to display a list of all my Jekyll posts, organised by category. I know Line 3 isn't correct but I can't figure out what it should be. Any ideas? Thanks! {% for category in site.categories %} <h3>{{ category | first }}</h3> {% for post in page.categories.category %} {{ post.title }}<br> {% endfor %} {% endfor %} 回答1: Got it! Needed an intermediate posts loop before listing out individual posts <ul> {% for category in site.categories

Jekyll display posts by category

烂漫一生 提交于 2019-12-28 07:41:11
问题 scratching my head over this - help much appreciated. I want to display a list of all my Jekyll posts, organised by category. I know Line 3 isn't correct but I can't figure out what it should be. Any ideas? Thanks! {% for category in site.categories %} <h3>{{ category | first }}</h3> {% for post in page.categories.category %} {{ post.title }}<br> {% endfor %} {% endfor %} 回答1: Got it! Needed an intermediate posts loop before listing out individual posts <ul> {% for category in site.categories

Installing Jekyll on Ubuntu 14.04

北慕城南 提交于 2019-12-28 05:47:05
问题 I've been having some issues installing Jekyll on Ubuntu. Here are some of the versions I have: trevor~$ ruby -v ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux] trevor~$ gem -v 2.5.1 trevor~$ rvm -v rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/] However, when I try to install Jekyll, I get these errors: trevor~$ gem install jekyll Building native extensions. This could take a while... ERROR: Error installing jekyll