Jekyll

Add properties to a page from a Jekyll plugin

前提是你 提交于 2020-01-14 10:36:22
问题 Say I want to have a page with content like this: <h1>{{page.comment_count}} Comment(s)</h1> {% for c in page.comment_list %} <div> <strong>{{c.title}}</strong><br/> {{c.content}} </div> {% endfor %} There are no variables on the page named comment_count or comment_list by default; instead I want these variables to be added to the page from a Jekyll plugin. Where is a safe place I can populate those fields from without interfering with Jekyll's existing code? Or is there a better way of

Jekyll: How to use custom plugins with GitHub pages

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-13 09:01:31
问题 It turns out that custom ruby plugins don't work on GitHub pages because of security concerns. I'm trying to add a plugin (this one) to the _plugins folder of my Jekyll project, but when I deploy it to GitHub it is ignored. Question: Is there a way to workaround this? Has anyone found a solution? Note: Obviously I can generate html files locally and commit them to my repository. But that's not what I want. 回答1: Without a plugin A reading time script does not require a plugin. I have created a

“no implicit conversion of Integer into String” error with Jekyll posts that have numbered titles

微笑、不失礼 提交于 2020-01-13 08:35:10
问题 I have a Jekyll blog hosted on GitHub Pages that I recently updated to HTTPS. In doing so, I discovered that recent updates to Jekyll were causing my blog to no longer build properly. Running a local install I kept encountering the following error: Liquid Exception: no implicit conversion of Integer into String in /_layouts/default.html After some trial and error I was able to identify the following posts as causing the problem: 2003-09-21-100.md 2004-02-10-10000.md 2004-02-28-228.md 2004-09

In jekyll, how to parse a variable as markdown instead of printing it as is?

老子叫甜甜 提交于 2020-01-13 08:31:08
问题 Given the following file: _data slides.yml which includes - title: Slide one desc: | welcome to the slideshow This is an open-source slideshow, built with [deck.js](https://github.com/imakewebthings/deck.js), GitHub and [Jekyll](http://jekyllrb.com). - title: Slide two desc: | Second slide with bullet points * Hello world * This is a slideshow In my index.html I have {% for slide in site.data.slides %} <section class="slide"> <h2>{{ slide.title }}</h2> {{ slide.desc }} </section> {% endfor %}

Creating a website with Jekyll that has a subdirectory for the blog with paginated content

[亡魂溺海] 提交于 2020-01-12 10:04:30
问题 I am creating a website with Jekyll where the main page (jekyllsiteblogpaginated.com/index.html) displays no blog content. In addition, I would like to create a subdirectory for the blog where the main page, jekyllsiteblogpaginated.com/blog/index.html, displays the post in a paginated manner. I have pushed my example here http://bpatra.github.io/jekyllsiteblogpaginated. The github repository can be found here You may see in the repository branches that I have tested several organisation:

Cannot reach Jekyll server on Vagrant from outside

☆樱花仙子☆ 提交于 2020-01-11 17:40:31
问题 I've built a Vagrant VM with hashicorp/precise32 box and installed Jekyll on it. I've set port 4000 forwarding on Vagrantfile: config.vm.network :forwarded_port, host: 4000, guest: 4000 When I try jekyll server it seems everything works fine, but I cannot reach the server from outside. Configuration file: /vagrant/test-site/_config.yml Source: /vagrant/test-site Destination: /vagrant/test-site/_site Generating... done. Auto-regeneration: enabled for '/vagrant/test-site' Configuration file:

Can I have a proper nice tiled pagination in Jekyll using Liquid templates?

喜夏-厌秋 提交于 2020-01-11 09:35:29
问题 I've found this nice jekyll theme: http://www.jacoporabolini.com/emerald/ with good looking pagination. Unfortunately is only good looking when there is a small number of pages. In case of my blog this looks like this: Not surprisingly because the code looks like this: {% for page in (1..paginator.total_pages) %} And it should like more like this: {% for page in (min(1,paginator.page-3)..max(paginator.page+3,paginator.total_pages)) %} The problem is, I don't think there is something like min

Jekyll : New posts not being generated

倾然丶 夕夏残阳落幕 提交于 2020-01-11 08:36:08
问题 I am setting up a jekyll blog. I put the .md files in the _posts folder. run jekyll --server command in the root of the project directory. But jekyll just regenerates the older posts, the news posts are not being added to _site. What might be the problem? 回答1: I finally found why jekyll was failing. The title i used in one of my posts had a colon (:) in it. I just had to replace it with : and the post parsed fine. 来源: https://stackoverflow.com/questions/10963002/jekyll-new-posts-not-being

Why Jekyll convert my Capital words into lowercase in Categories

若如初见. 提交于 2020-01-11 05:45:15
问题 graphics3d word-cloud math.se This is my categories Why they are all lowercase. How can I make them into Uppercase, since my directores in my computers are Uppercases. ![enter image description here][1] And my titles: WordList , Jekyll will convert it into Wordlist . YML fronter: --- layout: post category: Mathematica//Math-Experiment Tags: Formula Periodic Sequence --- https://github.com/HyperGroups/hypergroups.github.com/blob/master/_posts/Mathematica/Math-Experiment/2013-09-11-Math

GitHub Pages mangling syntax highlighting after upgrade to Jekyll 3

ⅰ亾dé卋堺 提交于 2020-01-06 19:57:04
问题 I use Github Pages for my personal website. They're upgrading from Jekyll 2 to Jekyll 3 and sending deprecation warnings. I complied with their warnings and switched from redcarpet to kramdown and from pygments to rouge. When I build locally (with bundle exec jekyll serve ) everything works. But when I push the changes the syntax highlighting gets mangled wherever I have linenos in my code blocks. This is the code block: {% highlight python linenos %} ''' scrape lyrics from vagalume.com.br