liquid

Jekyll Error “Liquid Exception: undefined method `encoding' for nil:NilClass in _layouts/post.html”

情到浓时终转凉″ 提交于 2019-12-11 11:54:26
问题 Getting the following error when trying to run jekyll build or jekyll serve : Liquid Exception: undefined method 'encoding' for nil:NilClass in _layouts/post.html jekyll 2.5.3 | Error: undefined method 'encoding' for nil:NilClass It looks to be an issue with a RVM/ruby file? (see the --trace logs below) but I haven't really touched anything code-wise (especially not in any ruby files) and haven't edited '/_layouts/post.html' in the last several commits and this just popped up. Here's the

Jekyll Include one YAML file in another YAML file

 ̄綄美尐妖づ 提交于 2019-12-11 08:10:00
问题 I have a Jekyll project where two separate pages (A.html and B.html) are displaying different content based on data in YAML files A.yml and B.yml respectively. Each yml file has a bunch of variables that are defined identically. I'd prefer to keep this common list of variables in a third file C.yml and include it into both A.yml and B.yml. How can I do this? Things I've tried: Using * to reference global data like *site.data.C.vars - this didn't parse. Put C.yml in _includes directory and use

How to ignore offset in jekyll when previous post is skipped

雨燕双飞 提交于 2019-12-11 07:05:20
问题 i'm trying to create my first blog on jekyll. And i stucked in one stupid thing. so the theme is next: i have a section for one of my categories, let it be "news": <section class="news"> <div class="container"> <div class="row no-gutters"> {% for post in site.categories.news limit: 2 offset: 0 %} {% include news-item-col-6.html %} {% endfor %} {% for post in site.categories.news limit: 3 **offset: 2** %} {% include news-item-col-4.html %} {% endfor %} </div> </div> </section> news-item-col-6:

Image Not Copied by Jekyll-Assets

↘锁芯ラ 提交于 2019-12-11 06:23:48
问题 I am using Jekyll-Assets to manage the asset pipeline for a jekyll project. I have references to a few different images on the index.html file: <img src="{% asset_path slides/slide-1.jpg %}" The source images are located in _assets/images/slides. My _config.yml file has this configured for sources: sources: - _assets/images One of the five images in the _assets/slides directory is not getting copied to the destination _site/assets/slides. The other four are copied correctly. I have verified

DotLiquid, some beginner questions/observations

瘦欲@ 提交于 2019-12-11 06:08:23
问题 I'm investigating using dotliquid to replace a home grown piece of templating code and I'm wondering about the best way to achieve my goal. The old code used to use sigils in the template and, together with a Dictionary, used regexes to search and replace. So you did something like this in the template file: Specific error: {#ErrorId#} Error description: {#Description#} Additional information:{#AdditionalInformation#} And in the C# code: Dictionary<string, string> tokensAndValues = new

Can a liquid for loop contain a page variable in Jekyll?

醉酒当歌 提交于 2019-12-11 05:46:54
问题 Let's say I have a bunch of _data files that I use to create a list for specific pages. All of the pages that have these lists have a custom front matter variable of pageName . The value of pageName just so happens to match the _data file with the list. Rather than pasting the html blocks of code into each page, I'd like to use an include to pull in a generic block of html. To do that, the include has to be dynamic or contain liquid markup to become dynamic. That might be more context than

Jekyll Deployment on Github Pages doesn't format correctly (No styling)

时光怂恿深爱的人放手 提交于 2019-12-11 03:48:40
问题 First of all, I would like to say I have tried for 2+ hours to try and correct this error, but alas I cannot figure it out. I am also a newbie to Jekyll and Github Pages. However, I am competent in code and can correct any errors. When I go to my github pages for this repository: Repository link 2:https://github.com/jeffward01/Conscience-Alchemy.git Github pages link: https://jeffward01.github.io/Conscience-Alchemy There is no formating applied. I know/suspect its a problem with my base.url

How to generate files from Liquid blocks in Jekyll?

流过昼夜 提交于 2019-12-11 02:20:42
问题 I am writing a plugin that defines a new Jekyll block ditaa . Any content in the block should be converted from Ditaa markup to an image file and that image inserted into the post instead of the block. Generating the file works but when copying into or generating in the _site directory, the file is apparently deleted. Is there a proper/better way to implement a block plugin that generates custom assets? 回答1: I've found the proper solution: use the Jekyll::StaticFile class . When you add one

What the the scope of Liquid variables on Jekyll on GitHub Pages

你。 提交于 2019-12-11 01:47:25
问题 I have created a simple Jekyll page (processed and hosted by GitHub Pages) with a Liquid counter variable where I loop through some data and dump it out and count the number of items with a given property. For example: Complete Before: {{ complete }} {% for book in books %} Title: {{book.Title}} {% if book.Completed == "true" %} {% increment completed %} {% endif %} {% endfor %} Complete After: {{ complete }} Now I have the same chunk of code on two different pages, but the data in books is

Business Catalyst: Check if we are on the root URL with Liquid

徘徊边缘 提交于 2019-12-11 00:33:38
问题 I would like to use Liquid markup to test if the page that is being viewed is the home page (but specifically the root URL of a website), e.g. www.mysite.com/ I attempted to use {{globals.get}}, because according to the BC Documentation, this should output... The current relative path and the query parameters passed in the URL. For example, for the URL http://mtica1.businesscatalyst.com/_s1/s2?a=1&b=2 the output of the module is: { "ID": "/_s1/s2", "a": "1", "b": "2" } [emphasis mine] However