据我所知,Octopress旨在作为独立的Web应用程序运行.
我有一个个人网站,我想添加一个博客,由于种种原因我想使用Octopress.我想将这些应用程序集成在一起,而不是在git中有两个单独的应用程序和repos.
有没有可靠的方法将Octopress集成到现有的Rails 4.0应用程序中?
我最好的办法是将Octopress作为机架应用程序安装在Rails路由器中,还是有更好的方法?
noob在这里,我正在尝试安装octopress但是当我运行时rbenv exec bundle install我得到了这个错误.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
/home/idiot/.rbenv/versions/2.4.0/bin/ruby -r ./siteconf20170227-4161-uizrqn.rb extconf.rb
creating Makefile
current directory:
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
make "DESTDIR=" clean
current directory:
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
make "DESTDIR="
compiling yajl.c
compiling yajl_alloc.c
compiling yajl_buf.c
compiling yajl_encode.c
compiling yajl_ext.c
yajl_ext.c: In function ‘rb_yajl_parser_parse’:
yajl_ext.c:471:17: warning: variable ‘stat’ set but not used [Wunused-but-set-variable]
yajl_status stat;
^~~~
yajl_ext.c: In function ‘rb_yajl_encoder_enable_json_gem_ext’:
yajl_ext.c:881:22: error: ‘rb_cFixnum’ undeclared (first use in this function)
rb_define_method(rb_cFixnum, "to_json", rb_yajl_json_ext_fixnum_to_json, -1);
^~~~~~~~~~
yajl_ext.c:881:22: note: …Run Code Online (Sandbox Code Playgroud) 我遵循了Octopress文档中的所有说明:
sddhrthrt@thinkpad:~/octopress$ rake generate
## Generating Site with Jekyll
directory source/stylesheets/
create source/stylesheets/screen.css
Configuration from /home/sddhrthrt/octopress/_config.yml
/home/sddhrthrt/octopress/plugins/pygments_code.rb:5:
warning: already initialized constant PYGMENTS_CACHE_DIR
/home/sddhrthrt/octopress/plugins/render_partial.rb:25:in `require':
./plugins/octopress_filters.rb:69: undefined (?...) sequence:
/<div class="entry-content">(?<content>[\s\S]*?)<\/div>\s*<(footer|\/article)>/ (SyntaxError)
from /home/sddhrthrt/octopress/plugins/render_partial.rb:25
from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:76:in `require'
from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:76:in `setup'
from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:75:in `each'
from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:75:in `setup'
from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:30:in `initialize'
from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/jekyll:224:in `new'
from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/jekyll:224
from /usr/local/bin/jekyll:19:in `load'
from /usr/local/bin/jekyll:19
Run Code Online (Sandbox Code Playgroud)
和
sddhrthrt@thinkpad:~/octopress$ rake preview
Starting to watch source with Jekyll and Compass. Starting Rack on port 4000
rake aborted!
undefined …Run Code Online (Sandbox Code Playgroud) 我尝试做这样的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) 我正在使用Octopress进行博客,但我仍然没有完全理解 "液体扩展"式代码块之间的区别,使用{% codeblock %}和更常见的降价代码块,使用反引号,以及这些变化提供了我的kramdown和其他降价转换器.那是:
{% codeblock haskell %}
main = putStrLn "Hello world"
-- liquid style
{% endcodeblock %}
Run Code Online (Sandbox Code Playgroud)
与
```haskell
main = putStrLn "Hello world"
-- backtick fencing style (GitHub-flavored)
```
Run Code Online (Sandbox Code Playgroud)
与
~~~ haskell
main = putStrLn "Hello world"
-- kramdown's tilde fencing
~~~
Run Code Online (Sandbox Code Playgroud)
与
main = putStrLn "Hello world"
-- another kramdown style, I think
{:lang="haskell"}
Run Code Online (Sandbox Code Playgroud)
等等
Octopress提供{% codeblock %}和反引号版本作为"插件",它们似乎支持相同的东西:语法突出显示,代码块的文件名,URL等.
我没有让kramdown特定的工作正常,我认为因为他们依赖于coderay或其他东西,我下载但无法开始工作.
无论如何,这是我的问题:
有没有理由比另一种更喜欢一种句法风格?一方面,我喜欢反击击剑,因为它是GitHub风格的降价,我已经习惯了这似乎"更简单",但另一方面,液体语法似乎更像是Octopress的"原生".
任何想法将不胜感激.目前,我的帖子有一个随机组合的样式,我真的想将它们简化为一种风格.
对于不同的帖子(通过生成rake new_post[my_post]),我想添加一个仅包含在该帖子中的javascript函数,以及博客上的其他任何内容.
我可以通过手工编辑public/my_post/index.html文件来做到这一点,但每次我做一次rake generate,我都必须再次这样做.
是否有内置的方法可以在Octopress中实现这一目标?
干杯
我想配置我的Octopress博客,在所有页面的head元素中添加作者链接,以便我的Google+图片显示在我的博客帖子的搜索结果旁边.目前,我相信我可以包括一个
<link rel ="author"href ="url/to/google/plus/profile">
在每个帖子中,但这很乏味.由于我博客上的每篇文章都是由我撰写的,我希望上面的链接只显示在我博客的每个Octopress页面的标题中.然后在Google+上我可以将我的博客列为我所贡献的网站,而不是列出我为每篇文章做出的贡献.
我是谷歌作者的新手,所以也许我想做的不是最好的方法.我的总体目标只是让我的Google plus照片显示在我在Google搜索结果和Google+上的所有Octopress博客文章旁边,只列出我作为我贡献的网站的博客(而不是每篇文章).
我正在使用Octopress进行博客,我想发布以下代码片段(它是Mustache JS语法):
```
<ul id="beers-list">
{{#beers}}
<li>{{name}} - {{color}} - {{alcohol}}%</li>
{{/beers}}
</ul>
```
Run Code Online (Sandbox Code Playgroud)
不幸的是,渲染时,一切都{{...}}消失了,我在网站上看到以下内容:
<ul id="beers-list">
<li> - - %</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
我没能逃脱{{(即使有\{{,{\{或类似的东西.有没有办法逃避这些字符?
谢谢.
我不确定SO是否是这个问题的更好网站
我想在我的博文中添加一个简单的计数器.这样,每篇博文都有自己的计数器,可以显示帖子被点击的次数.
如何使用Octopress实现这一目标?有任何想法吗?
提前感谢任何提示!
我在我的机器上安装了ruby版本1.9.3,并为我的个人网站开发了一个octopress项目.
我使用rvm作为我的宝石,并遵循octopress.org记录的所有步骤.但我在我的rake服务器中发现了一些错误.这是我的命令日志.
Tin-Aung-Linn:octopress tal$ ruby --version
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.4.0]
Tin-Aung-Linn:octopress tal$ rake generate
## Generating Site with Jekyll
identical source/stylesheets/screen.css
Configuration from /Users/tal/Sites/mysite.com/octopress/_config.yml
Building site: source -> public/github
Successfully generated site: source -> public/github
Tin-Aung-Linn:octopress tal$ rake preview
Starting to watch source with Jekyll and Compass. Starting Rack on port 4000
Configuration from /Users/tal/Sites/mysite.com/octopress/_config.yml
[2013-07-04 14:50:23] INFO WEBrick 1.3.1
[2013-07-04 14:50:23] INFO ruby 1.9.3 (2013-06-27) [x86_64-darwin12.4.0]
[2013-07-04 14:50:23] INFO WEBrick::HTTPServer#start: pid=51669 port=4000
Auto-regenerating enabled: source -> public/github …Run Code Online (Sandbox Code Playgroud)