我尝试做这样的Octopress代码块
但我不能让它发挥作用.
它始终显示以下错误.我的机器是Windows 7.
$ 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/pygments.rb-0.3.7/lib/pygments/mentos.py in 2013-01-06-octopress.markdo
wn
c:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:162:in
`spawn'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:162:in
`spawn'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:307:in
`popen4'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.7/lib/pygments/popen.rb:41:i
n `start'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.7/lib/pygments/popen.rb:203:
in `mentos'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.7/lib/pygments/popen.rb:192:
in `highlight'
d:/MyProject/Git/octopress/plugins/pygments_code.rb:24:in `pygments'
d:/MyProject/Git/octopress/plugins/pygments_code.rb:14:in `highlight'
d:/MyProject/Git/octopress/plugins/code_block.rb:82:in `render'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:94:in `bloc
k in render_all'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `coll
ect'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `rend
er_all'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:82:in `rend
er'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:124:in `
render'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:132:in `
render!'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/convertible.rb:79:i
n …Run Code Online (Sandbox Code Playgroud) 我认为管理Jekyll页面的本地方式,即通过在根文件夹下创建.md文件/文件夹,有点乱.
因此,我想将我想要显示的每个页面放入名为"pages"的文件夹中.另外,我希望这些页面具有级联结构:如果我的文件夹具有以下结构:
pages
|-> parent1
|-> index.html
|-> son1.html
|-> son2.html
|-> parent2
|-> index.html
Run Code Online (Sandbox Code Playgroud)
然后在页面列表页面中,它应该是这样的:
page listing
* parent1
* son1
* son2
* parent2
Run Code Online (Sandbox Code Playgroud)
此外,不在页面文件夹下的其他*.html文件不应显示在此页面列表页面中.
我该怎么办?
非常感谢.
我是自学的/完全不熟悉 Jekyll 和 Github Pages,想知道如何在 config.yml 页面中使用 Markdown 在新选项卡中打开 URL。
这是我正在使用的网站主题。我希望最后一个“github”链接在新标签页中打开,而不是在当前标签页中打开的默认链接。
_config.yml 看起来像这样:
# # # # # # # # # # # # #
# K i k o - p l u s #
# # # # # # # # # # # # #
# Basic
name: "Kiko Plus"
author:
facebook: your-id
youtubeUser: your-id
youtubeChannel: your-id
twitter: your-id
github: your-id
stackoverflow: your-id
quora: your-id
linkedin: your-id
pinterest: your-id
googlePlus: your-id …Run Code Online (Sandbox Code Playgroud) jekyll jekyll-extensions github-pages jekyll-bootstrap jekyll-paginator
我正在使用jekyll.rb创建一个站点.
我有一个名为about.html的页面:
<div class="grid_10 page">
{% include about_content.markdown %}
</div>
Run Code Online (Sandbox Code Playgroud)
在about_content.markdown中,我有一些虚拟降价:
A First Level Header
====================
A Second Level Header
---------------------
Hello!
Run Code Online (Sandbox Code Playgroud)
出于某种原因,在呈现页面时,结果如下:
结果http://gabrielecirulli.com/p/20120107-203135.png
即使我将YAML前面的内容添加到我的markdown文件中也没有任何变化.
这是我的_config.yml
safe: false
auto: false
server: false
server_port: 4000
baseurl: /
source: .
destination: ./_site
plugins: ./_plugins
future: true
lsi: false
pygments: false
markdown: maruku
permalink: date
maruku:
use_tex: false
use_divs: false
png_engine: blahtex
png_dir: images/latex
png_url: /images/latex
rdiscount:
extensions: []
kramdown:
auto_ids: true,
footnote_nr: 1
entity_output: as_char
toc_levels: 1..6
use_coderay: false
coderay: …Run Code Online (Sandbox Code Playgroud) 我正试图在我的新Macbook上使用Octopress(Jekyll上的博客引擎),当我运行时出现这个错误bundle exec jekyll --server:
(缩短路径)
/path/to/markdown.rb:118:in `to_html': wrong argument type String (expected Array) (TypeError)
from /path/to/markdown.rb:118:in `convert'
...
Run Code Online (Sandbox Code Playgroud)
(完整路径)
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/converters/markdown.rb:118:in `to_html': wrong argument type String (expected Array) (TypeError)
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/converters/markdown.rb:118:in `convert'
...
Run Code Online (Sandbox Code Playgroud)
看看第118行,我看到:
RDiscount.new(content, *@rdiscount_extensions).to_html
Run Code Online (Sandbox Code Playgroud)
如果我用"hello"这样的字符串替换这一行,服务器就可以正常启动了.但如果我用类似的东西替换它RDiscount.new("hello").to_html,我会得到同样的错误.但是,启动irb和运行RDiscount.new("hello").to_html工作正常.
有什么想法有什么不对吗?我能够在我拥有的另一台计算机上启动服务器,但我不知道如何弄清楚这两台计算机正在做什么之间的区别(某个库的某个版本不同?).
我正在为Jekyll编写一个转换器插件,需要访问一些页眉(YAML前端)属性.只有内容传递给主转换器方法,似乎无法访问上下文.
例:
module Jekyll
class UpcaseConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /^\.upcase$/i
end
def output_ext(ext)
".html"
end
def convert(content)
###########
#
# Its here that I need access to the content page header data
#
#
###########
content.upcase
end
end
end
Run Code Online (Sandbox Code Playgroud)
有关如何在转换器插件中访问页眉数据的任何想法?
我正在为我的Octopress网站制作一个Jekyll标签插件,以帮助我创建一个"注释"元素.我只是希望能够在我的博客上突出显示一条信息作为旁注,就像这样.

问题是,我无法弄清楚如何处理这个标签的内容(即Markdown或Textile).上面的图片只是实现了我实际上用html代码制作我的链接.以下是我在内容中使用markdown时最终结果的结果.

在我的帖子中,我正在写这样的内容.
{% note %}
This is the third post in my Start to Finish series. Last time I talked about [Git](/blog/2013/09/25/getting-started-with-git/).
{% endnote %}
Run Code Online (Sandbox Code Playgroud)
这是我的插件代码.它基于图像标记代码,并且它真的不是很多.
module Jekyll
class NoteTag < Liquid::Block
@title = nil
def initialize(tag_name, markup, tokens)
@title = markup
super
end
def render(context)
output = super(context)
title = "Note"
if !@title.empty?
title += ": #{@title}"
end
"</section>\n<div class=\"note\"><span class=\"title\">#{title}</span>#{output}</div>\n<section>"
end
end
end
Liquid::Template.register_tag('note', Jekyll::NoteTag)
Run Code Online (Sandbox Code Playgroud)
你知道如何在这个标签的内容上使用转换器吗?我通常使用Markdown作为我的帖子,但我想为其他人发布这个插件,所以我希望它像Jekyll的其余部分一样充满活力.
我用css构建我的网站,一切都很好,无论是本地还是远程.然后我想切换到sass.我安装了jekyll-compass,现在我的sass文件在我的_site/css文件夹中作为css文件输出.一切都在本地运行良好,但是当我将它们推送到Github时,我的样式没有被应用,我在那个css文件上得到了404.我究竟做错了什么?
我想覆盖一个看起来像这样的gem方法(一个Jekyll扩展):
档案:lib/jekyll-amazon/amazon_tag.rb.
module Jekyll
module Amazon
class AmazonTag < Liquid::Tag
def detail(item)
...
end
end
end
end
Liquid::Template.register_tag('amazon', Jekyll::Amazon::AmazonTag)
Run Code Online (Sandbox Code Playgroud)
我在文件夹中的项目中放置了具有相同结构的代码.如果我将方法的名称更改为新名称,它可以工作,但我不能让它覆盖名称.我做错了什么?config/initializers/presentation.rb_plugins/presentation.rbdetaildetail
(注意:在jekyll-amazon gem的0.2.2版本中,该detail方法是私有的;我已在本地更改了此方法,因此该方法不再是私有的.)
我们知道Jekyll可以使用像前面这样的前面的物质变量tags,categories然后用它们来访问它们site.tags并site.categories使用液体迭代它们.现在我的问题是我无法使用像author(因为site.authors)这样的自定义前端变量这样做,因为Jekyll不会以列表格式存储它.这使得分页非常困难.
我看过的每个解决方案即
需要我硬编码的作者列表来_config.yml或其他一些.yml(即_data/authors.yml).这里的问题是我没有使用固定的作者列表.作者列表需要更新,当我在服务器运行时输入带有前端标签author: exampleAuthor或作者列表的另一篇文章(如每个帖子的多个作者,当前只能使用categories和tags也可以).它可以很好地处理标签和类别,但不能像作者那样使用自定义标签.
最简单的解决方案是使用一个site.authors列表进行迭代,然后使用ruby插件扩展它.
我没有找到一个为我提供解决方案的插件,并认为这是一个常见的问题,我可能不是第一个拥有的.
然后,我在写我自己的红宝石插件(这是很难在它自己的,因为缺少文档.也许我是哑巴谷歌,但资源,我发现那里非常有限,根本不足以引导您完成整个过程)但必须有一个原因,为什么这么难做,使得所有现有的解决方案都需要对作者列表进行硬编码.yml(或者.json,大多数人.yml因某种原因而去).
这样做是出于对我的问题,因为我只想在与它的作者姓名职位扔后来和操纵.yml(我的印象中yml,一旦启动了服务器,如文件不会被编译_config.yml,正确我,如果我错了)会适得其反,因为它需要你重新启动服务器来编译它们.
甚至非常高级的插件,如jekyll-paginate-v2(我成功地用标签和类别对帖子进行分页)也没有解决方案,因为这个问题描述了.他被建议滥用类别变量按作者分页,这是一种绝望的解决方法.
我已经找到了可以用集合完成的建议,但这似乎不可行.主要是由于它们的实现性质:
它们需要对作者列表进行硬编码(同样,我不希望这样.我没有固定的作者列表.所有作者信息都必须来自前面 -在/_posts目录.md文件中的问题)到目前为止,我看不到如何使用集合.但是我愿意接受建议.
编辑:我在Jekylls github页面上发现了这个过时的问题,其中强调人们正在尝试做同样但无济于事.这在过去4年中是否可行?
jekyll ×10
ruby ×3
github-pages ×2
octopress ×2
compass-sass ×1
liquid ×1
markdown ×1
plugins ×1
sinatra ×1
web ×1