对于不同的帖子(通过生成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实现这一目标?有任何想法吗?
提前感谢任何提示!
我在我的机器上安装了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) 任何想法如何看到液体标签实际失败的地方?
为了更清楚,我在使用插件时遇到了一些麻烦,我在预览网站时看到的只是
Liquid Error: can’t convert Array into String
Run Code Online (Sandbox Code Playgroud)
在我的网站上.如何获得更多调试信息?谢谢
我为我的github设置了一个octopress博客,现在我想添加新的帖子.我需要在帖子中添加图片,我试过这样做:
{% img /images/image.png 'alt' %}
Run Code Online (Sandbox Code Playgroud)
这只适用于应用的根网址.当我单独查看博客文章时,该网址看起来像http://example.com/blog/2013/06/11/title/,因此网址/ images /将无效.
然后我尝试了这个:
{% img {{root_url}} /images/image.png 'alt' %}
Run Code Online (Sandbox Code Playgroud)
它也无济于事.但是像这样的链接:
[Link!]({{ root_url }} /images/image.png")
Run Code Online (Sandbox Code Playgroud)
工作得很好.
我想要一些帮助,非常感谢.
我做了这些:
添加"关于"页面例如:
1.创建"关于"页面:
rake new_page["about"]
2:添加链接:
<li><a href="/about">About</a></li>
然后生成....
并且出现"约"标签; 但它无法点击; 新页面没有出来
为什么...
假设我想要一个包含如下内容的页面:
<h1>{{page.comment_count}} Comment(s)</h1>
{% for c in page.comment_list %}
<div>
<strong>{{c.title}}</strong><br/>
{{c.content}}
</div>
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
页面上没有命名comment_count或comment_list默认的变量;相反,我希望将这些变量从 Jekyll 插件添加到页面。哪里是一个安全的地方,我可以在不干扰 Jekyll 现有代码的情况下填充这些字段?
或者有没有更好的方法来实现这样的评论列表?
我已经在http://acgrama.github.io/上使用我的Github帐户设置了Octopress .主页面是一个vanilla HTML,非Octopress登陆页面,博客在Octopress的source/blog下设置.(我已按照http://octopress.org/docs/theme/template/的"登陆页面与博客索引"部分中的说明进行操作)
一切都很好,除非我去http://acgrama.github.io/blog/我看到了博客档案的链接,而不是最新的博客文章.
我注意到的一些症状:当我做rake生成时,我得到以下输出:
## Generating Site with Jekyll
identical source/stylesheets/screen.css
Configuration file: /home/***/octopress/_config.yml
Source: source
Destination: public
Generating...
Pagination: Pagination is enabled, but I couldn't find an index.html page to use as the pagination template. Skipping pagination.
done.
Run Code Online (Sandbox Code Playgroud)
在source/blog/index.html下查看,我了解paginator.posts中的帖子被迭代并显示(?),之后显示了较旧/较新和博客存档链接:
<div class="blog-index">
{% assign index = true %}
{% for post in paginator.posts %}
{% assign content = post.content %}
<article>
{% include article.html %}
</article>
{% endfor %}
<div class="pagination">
{% if …Run Code Online (Sandbox Code Playgroud) 我不是在寻找一种链接到Youtube的方法.我想引用一个自托管的mp4文件.
我已经有{% audio my-file.mp3 %}工作了.
我正在寻找一个等价物{% video my-file.mp4 %}.
如果我<video ... />直接使用,我会在my-text.md中收到错误"Liquid exception:Unknown tag'video'".
编辑:我认为有一个现有的Octopress插件.但是如何安装/让Jekyll知道?
octopress ×10
jekyll ×4
blogs ×3
html5 ×2
liquid ×2
ruby ×2
github ×1
github-pages ×1
google-plus ×1
html ×1
javascript ×1
markdown ×1
video ×1