我在我的网站上使用jekyll和Github页面.我试图在家中看不到一些帖子,但可以从另一个帖子链接.在frontmatter中,我尝试添加一个可见的字段:
---
layout: post
title:
excerpt:
visible:1
---
Run Code Online (Sandbox Code Playgroud)
然后在index.html文件中我做了一个if检查:
<div class="posts">
{% for post in paginator.posts %}
{% if post.visible== 1 %}
<div class="post">
<h1>
<a href="{{ post.url }}">
{{ post.title }}
</a>
</h1>
<span class="post-date">{{ post.date | date_to_string }}</span>
<a class="subtitle" href="{{ post.url }}">
{{ post.excerpt }}
</a>
</a>
</div>
{% endif %}
{% endfor %}
</div>
Run Code Online (Sandbox Code Playgroud)
我的想法是,当我在可见字段中设置0时,帖子将不会在家中显示.不幸的是,这不起作用,你有任何提示吗?谢谢
我试图在不使用ajax,javascript ecc的情况下以html显示文本文件的内容.但可能是css和html.我有一个图像幻灯片,根据您选择的图像,文本文件的内容应显示在照片下方.我知道如何将文本文件与照片相关联它应该可以工作,但是如何才能在网页中显示txt文件的内容?谢谢 :-)
我正试图在笔记本电脑上本地运行jekyll.我按照Github的指南去做,https://help.github.com/articles/using-jekyll-with-pages 不幸的是,当我输入$ bundle install时我遇到了问题我得到以下错误:
Fetching gem metadata from https://rubygems.org/.........Failed to load /etc/gemrc due to permissions problem.
Resolving dependencies...
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for main() in -lc... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby …Run Code Online (Sandbox Code Playgroud)