Jekyll

Passing parameters to inclusion in Liquid templates

拟墨画扇 提交于 2019-12-20 08:24:10
问题 On my Jekyll-powered website I have an inclusion that does something function-like, but I can't figure out how to pass it parameters correctly. When I use {% include ... %} , passing parameters like this.. {% include function.liquid foo="{{ baz.quux }}" %} ..it just passes the literal string {{ baz.quux }} which is, of course, not what I wanted! I want to pass the value of baz.quux . How do I do this? Thanks! 回答1: There are two ways to achieve this. I have tested both approaches against the

Set up custom subdomain for Jekyll Blog hosted in Github Pages

杀马特。学长 韩版系。学妹 提交于 2019-12-20 08:05:03
问题 I created a Jekyll-powered blog and am hosting it with GitHub Pages. Now, I want to set up a subdomain (blog.example.com), but can't make it work. I have added a CNAME file with the text: blog.example.com. And I have added to A records in my Dreamhost account for the subdomain, both pointing to 204.232.175.78, provided by GitHub. Any idea about what the missing part is, or if I'm doing something incorrectly? 回答1: The setup is different for domains like example.com and sub-domains like blog

Pygments syntax highlighting in Jekyll without starting a <div>

血红的双手。 提交于 2019-12-20 02:37:24
问题 If you use Jekyll with the Pygments syntax-highlighting package, it’s possible to write {% highlight clojure %} (def something :foobar) {% endhighlight %} which produces a <div> containing that line, syntax-highlighted according to Clojure syntax. But is there a way to get the syntax highlighting in the middle of a paragraph? I’d like to be able to write In Clojure, keywords like {% highlight clojure %}:foobar{% endhighlight %} are prepended by colons. The desired behavior here is that the

Does the installation of Jekyll need GCC on OSX?

浪子不回头ぞ 提交于 2019-12-19 16:51:13
问题 Jekyll Installation says: GCC and Make (in case your system doesn’t have them installed, which you can check by running gcc -v and make -v in your system’s command line interface) I am using macOS Sierra. And I have installed Command Line Tools (CLT) for Xcode. And gcc -v produces: Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.7.0 Thread model: posix

how to create a link to each category

◇◆丶佛笑我妖孽 提交于 2019-12-19 08:30:31
问题 I am trying to create a navigation bar displaying all the categories and then by clicking on each category, it then links to all the posts in that category. I tried below, it displays all the categories but not as a link. {% for category in site.categories %} <div class= "categories-title"><a name="{{ category | first }}">{{ category | first }}</a></div> {% endfor %} I also tried jekyll-category-archive-plugin as below, but it gives Error: Unknown tag 'category'. {% for category in site

Liquid and Arithmetic

谁都会走 提交于 2019-12-19 07:51:01
问题 I am working on some pagination and I am wondering if there is a way to tell liquid to only show 5 pages. The output I am looking for is << First 5 6 7 8 9 Last >> The logic I currently have in place works but it is showing all 30 some pages. {% for count in (2..paginator.total_pages) %} {% if count == paginator.page %} <span class="current">{{ count }}</span> {% else %} <a href="/page/{{ count }}/" class="pagenavi-page" title="{{ count }}">{{ count }}</a> {% endif %} {% endfor %} I would

Liquid and Arithmetic

↘锁芯ラ 提交于 2019-12-19 07:50:59
问题 I am working on some pagination and I am wondering if there is a way to tell liquid to only show 5 pages. The output I am looking for is << First 5 6 7 8 9 Last >> The logic I currently have in place works but it is showing all 30 some pages. {% for count in (2..paginator.total_pages) %} {% if count == paginator.page %} <span class="current">{{ count }}</span> {% else %} <a href="/page/{{ count }}/" class="pagenavi-page" title="{{ count }}">{{ count }}</a> {% endif %} {% endfor %} I would

How to make github pages url case insensitive?

前提是你 提交于 2019-12-19 05:57:11
问题 Website works for jerrygoyal.github.io/Flash-Clipboard but not for (404 error): jerrygoyal.github.io/flash-clipboard jerrygoyal.github.io/FLASH-clipboard jerrygoyal.github.io/flaSH-CLIPboard and so on You get the idea! How can I make the url case-insensitive? I've never worked on Jekyll and not sure if my project pages are using jekyll or not. I only created an index.html page and put inside the docs folder of the repository. I'm using a custom domain (www.jerryfactory.com) to map jerrygoyal

Ordinalize date formatting in Liquid/Jekyll (e.g. “1st”, “3rd” and “4th”)

一笑奈何 提交于 2019-12-19 03:20:50
问题 Is it possible to add day of the month suffixes to a date format in Liquid or Jekyll? For example: January 23rd or May 18th. I've referred to the Shopify wiki, but I'm shocked to see that there's no formatting there for it. Surely something that simple should be? :/ 回答1: The Liquid Template Engine that Jekyll uses doesn't offer the ability to ordinalize (e.g. turn "1" into "1st" and "3" into "3rd") out of the box. However, it is possible to use filters and tags to provide that functionality.

Ordinalize date formatting in Liquid/Jekyll (e.g. “1st”, “3rd” and “4th”)

旧街凉风 提交于 2019-12-19 03:20:04
问题 Is it possible to add day of the month suffixes to a date format in Liquid or Jekyll? For example: January 23rd or May 18th. I've referred to the Shopify wiki, but I'm shocked to see that there's no formatting there for it. Surely something that simple should be? :/ 回答1: The Liquid Template Engine that Jekyll uses doesn't offer the ability to ordinalize (e.g. turn "1" into "1st" and "3" into "3rd") out of the box. However, it is possible to use filters and tags to provide that functionality.