我试图从复制Jekyll插件示例来呈现*render_time*标记,但是我得到了这个错误:
/Library/Ruby/Gems/1.8/gems/liquid-2.0.0/lib/liquid/block.rb:58:in `unknown_tag': Unknown tag 'render_time' (Liquid::SyntaxError)
from /Library/Ruby/Gems/1.8/gems/liquid-2.0.0/lib/liquid/block.rb:28:in `parse'
from /Library/Ruby/Gems/1.8
我正在使用Jekyll,从而使用Liquid 4
通常情况下,我应该能够逃避这样的空白:
{%- for post in site.data.posts-%}
但是github返回我在构建中的错误消息,index.html中第21行的标记index.html没有与%}正确关闭。
如果我删除破折号并将其格式化如下
{% for post in site.data.posts %}
它正在工作,但增加了空白,当然到处都是。
我觉得它应该与Liquid 4一起工作,而我的一位同事也有同样的代码,而对他来说,这是可行的。
知道为什么这会毁了我的身材吗?
从我的宝石档案里
gem "jekyll
在post标记中,我使用了一个双大括号{{,它在jekyll 2.5.3上返回一个错误:
Jekyll Variable '{{' was not properly terminated with regexp: /\}\}
将内容替换为:
<article class="post-content">
{{ content }}
</article>
在模板中
当我从贴现号中删除这一行时,它非常有效:
`{{` **Double Curly Braces** indicate that data will be replaced
这是插件代码...
module Jekyll
module VersionFilter
def versioned_url(input)
"#{input}?#{Time.now.to_i}"
end
end
end
Liquid::Template.register_filter(Jekyll::VersionFilter)
我正在尝试缓存bust/版本控制我的.css文件。我是第一次接触Liquid。我很难弄清楚这个基本的插件。有什么帮助吗?
我正在尝试一个简单的Jekyll插件:
class MonthlyArchives < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text
end
def render(context)
"#{@text} #{Time.now}"
end
end
Liquid::Template.register_tag('monthly_archives1', Jekyll::MonthlyArchives
我正在尝试在Jekyll插件中手动调用markdownify过滤器。以下是我所拥有的:
module Jekyll
class ColumnBlock < Liquid::Block
include Jekyll::Filters
def initialize(tag_name, markup, tokens)
super
@col = markup
end
def render(context)
text = super
'<div class="col-md-
我刚刚下载了,编译时收到错误。
我还下载了,它使用jekyll server成功运行。
我做错了什么吗?
执行的命令:
D:\Zain\github\bootstrap\source>jekyll --server
错误接收:
Configuration from D:/Zain/github/bootstrap/source/_config.yml
Building site: ./docs -> ./_gh_pages
Liquid Exception: wrong number of arguments (1 for 0) in docs.html
C:/Ruby200/li
我在和jekyll一起写博客。我尝试在docker上使用jekyll,得到以下错误:
Error: A Liquid tag in the excerpt of _posts/2019-05-21-jekyll-caching.md couldn't be parsed.
Error: could not read file /srv/jekyll/_posts/2019-05-21-jekyll-caching.md: undefined method `ancestors' for nil:NilClass
在错误文件中,我编写了一个小技巧来使liquid语句成为html。
在Octopress中,我试图通过扩展Jekyll:Post类来获取帖子的完整文件路径(类似于~/projects/site/source/_posts/2012-01-01-something.markdown)。
module Jekyll
class Post
alias_method :original_to_liquid, :to_liquid
def to_liquid
# test if this function is actually called
puts "hello"
我目前正在尝试使用Jekyll将以下字符序列添加到帖子中:
#\^[]|{}~
然而,每当我尝试的时候,我都会得到这个错误:
Liquid Exception: Tag '{%' was not properly terminated with regexp: /\%\}/
我看过很多关于这个的帖子,建议我这样做:
#\^[]|{{ "{}" }}~
这会导致类似的错误:
Liquid Exception: Variable '{{ "{}' was not properly terminated with regexp: /\}\}/
默认情况下,Jekyll使用*.html,然而,我使用的程序(Sublime Text 3)有一个添加了流畅语法支持的软件包,但它只会在文件扩展名为*.liquid的情况下自动检测和执行代码建议。另一个问题是,Jekyll正在寻找default.html以及其他布局。如何让Jekyll像default.liquid一样查找*.liquid文件
杰基尔医生说我们可以
module Jekyll
class TestTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text
@tokens = tokens
end
def render(context)
"text: #{@text} tokens: #{@tokens}"
end
end
end
Liquid::Template.register_tag('test'
我试着这样做,
但我不能让它工作。
它总是显示以下错误。我的机器是Windows7。
$ rake generate
## Generating Site with Jekyll
unchanged sass/screen.scss
Configuration from d:/MyProject/Git/octopress/_config.yml
Building site: source -> public
Liquid Exception: No such file or directory - python c:/Ruby193/lib/ruby/gems/1.
9.1/gems/
我试图在我的Jekyll站点的_include文件中呈现一些标记,但由于某种原因,我无法让它工作。我正在尝试两种不同的方法,这是我的减价文档
---
layout: post
title: "About"
description:
---
# This is a test
> pop
这是我的包含文件
<div class="tab">
{% markdown about.markdown %}
{% capture my-include %}{% include about.markdown %}{% endcaptur
我正在使用Jekyll发布博客。当我在我的markdown文件中写"{%...%}“时,似乎"{%...%}”将被Liquid解析。但有时这并不是我想要的,并且可能会导致错误。那么在我的帖子内容( .md文件)中包含像"{%...%}“这样的文本的正确方式是什么呢?
我检查了Liquid文档,了解到我可以使用块标记{% raw %} ... {% end raw %}在文档之间包含原始文本。然而,我不认为这是一个好主意。因为如果markdown文件没有被Liquid解析(例如,在一些不是Jekyll的环境中),这将在我的文本中留下未使用的{% raw %}。
如果我说错
我正在尝试在插件中使用relative_url过滤器。 module Jekyll
module Tags
class MyNewTag < Liquid::Block
include Jekyll::Filters::URLFilters
def initialize(tag_name, block_options, liquid_options)
super
@class = block_options.strip
end
def render(context)
co
我正在尝试为基于Jekyll的站点编写一个自定义标记,它接收一个bibtex字符串并替换/删除一些内容。
标记接收如下所示的bibtex字符串:
@article{heineman2001component,
title={Component-based software engineering},
author={Heineman, George T and Councill, William T},
journal={Putting the pieces together},
pages={5},
year={2001}
}
红宝石代码如下:
module Jekyll
class R