Jekyll

Jekyll: Using values from _config.yml in SCSS

烈酒焚心 提交于 2019-12-24 15:35:53
问题 In my Jekyll project, I have the following in my _config.yml file: colors: - name: red hex: '#FF0000' - name: yellow hex: '#FFFF00' - name: blue hex: '#0000FF' In assets/css/colors.scss , I want to create classes for the colors as follows: {% for color in site.colors %} .{{ color.name }} { color: {{ color.hex }}; } {% endfor %} When I do so, I get the following error: Error in _assets/css/background-test.scss:6 Invalid CSS after "}": expected selector or at-rule, was "{% for color in..."

jekyll pretty permalinks give me WEBrick error

一笑奈何 提交于 2019-12-24 13:42:56
问题 I am developing my blog in Jekyll (3.0.0 beta), currently on localhost, When i am trying to implement the pretty permalink and i try to visit a post it shows a WEBrick error. If i apply the /:year/:month/:day/:title.html it works fine do you have a clue why isn't it working with pretty permalinks? This is the error I get: /2015/08/03/are-permas-working.html' not found. WEBrick/1.3.1 (Ruby/2.1.6/2015-04-13) at localhost:4000 回答1: Once you set Jekyll permalinks to pretty in _config.yml like so:

Jekyll - YAML Front Matter Defaults not working

不想你离开。 提交于 2019-12-24 12:43:49
问题 I have a multi-site Jekyll project with folders for each site, slc , and la . However, my YAML Front Matter defaults are not working. None of the default values--including the layout, crucially--are being transmitted to my templates: //config.yml: defaults: - scope: path: "la" values: layout: "default-la" title: "Store Title" email: "email@gmail.com" baseurl: "" # the subpath of your site, e.g. /blog/ url: "http://url.com" // Folder structure ├───assets │ ├───images │ └───js ├───css │ ├──

Jekyll custom date

╄→гoц情女王★ 提交于 2019-12-24 11:46:03
问题 I want use bellow code to display custom date in my Jekyll site {% assign m = page.date | date: "%-m" %} {% case m %} {% when '1' %}Januar {% when '2' %}Februar {% when '3' %}März {% when '4' %}April {% when '5' %}Mai {% when '6' %}Juni {% when '7' %}Juli {% when '8' %}August {% when '9' %}September {% when '10' %}Oktober {% when '11' %}November {% when '12' %}Dezember {% endcase %} But I don't now where to put it (I tried in post.html but does not work) 回答1: I've made a template for this.

Get Jekyll collection item name (HRU)

大城市里の小女人 提交于 2019-12-24 11:27:28
问题 I'm making a Jekyll site destinated for GitHub Pages, and pre-testing it on local Windows 8.1 PC with Jekyll 2.5.3, Ruby 2.0.0p598 (2014-11-13) [x64-mingw32] and Gem 2.0.14. In Jekyll, I have a collection named albums . Directory structure for _albums is similar to the following: _albums foo.md bar.md baz.md Each file has Front Matter containing values such as title , description etc. In some site page I'm making a Liquid loop such as following: {% for album in site.albums %} /* need to get

Trouble installing jekyll on macOS Sierra 10.12.6

◇◆丶佛笑我妖孽 提交于 2019-12-24 10:56:22
问题 Tried the original method of gem install jekyll and I get this error: ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory. Installed Xcode and command line tools. Then followed up with installing homebrew using this command: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" get this error after: Error: Failed to link all completions, docs and manpages: Permission

In Jekyll, how to show “posts from last week”

荒凉一梦 提交于 2019-12-24 09:53:29
问题 I'm not sure to get the liquid syntax to help me pull posts that were published during the same week as the build date. Is that possible? There are simpler ways to get a list of recent posts, but this approach would be useful for my project. I've tried several things I found by searching but no joy yet. 回答1: The above solution works, but doesn't span years. So I utilized the concepts and came up with a simpler and more flexible solution for filtering for a timeframe (which can be any variable

Integrating column support into markdown in Jekyll framework

随声附和 提交于 2019-12-24 09:52:28
问题 I'd like to add functionality for dynamic columning, similar to a bootstrap grid system, in text posts within a Jekyll blog (which comes with kramdown by default). Ideally this would be done easily in markdown posts. I found this github project that seems like exactly what I'd need: https://github.com/dreikanter/markdown-grid I've looked through this project but, unfortunately, I don't have much experience with frontend and I'm not sure where to start to integrate this into my Jekyll template

Everything between anchor tag render's raw html tags in Jekyll/Liquid

拥有回忆 提交于 2019-12-24 07:50:03
问题 I'm trying to build an include in Jekyll that has multiple variables, but the basic idea is that I'm wrapping multiple pieces of content in an anchor tag like the following: <a href="#> <h2>{{ include.piece-title }}</h2> <h3>{{ include.piece-date }}</h3> <img src="{{ include.piece-url }}" alt="{{ include.image-description }}"> <p>{{ include.piece-description }}</p> </a> However, this renders to the raw html (although the image works). If I instead wrap it in a <figure> tag instead of the <a>

Github Pages build failure

蹲街弑〆低调 提交于 2019-12-24 06:50:13
问题 I'm getting the following error about my Jekyll Github Pages reop: Your site is having problems building: A file was included in source/blog/index.html that is a symlink or does not exist in your _includes directory. This is the file it is complaining about, and the rest of the code is contained in that repo. I'm confused because the two files it is referencing are in the _includes folder, so what could be the issue? The page works fine when I build and run it locally. Thanks! 回答1: I