小编kil*_*ian的帖子

Jekyll Github页面如何隐藏帖子

我在我的网站上使用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时,帖子将不会在家中显示.不幸的是,这不起作用,你有任何提示吗?谢谢

html post github jekyll github-pages

13
推荐指数
3
解决办法
5879
查看次数

以HTML格式显示文本文件

我试图在不使用ajax,javascript ecc的情况下以html显示文本文件的内容.但可能是css和html.我有一个图像幻灯片,根据您选择的图像,文本文件的内容应显示在照片下方.我知道如何将文本文件与照片相关联它应该可以工作,但是如何才能在网页中显示txt文件的内容?谢谢 :-)

html css text

3
推荐指数
1
解决办法
2万
查看次数

Gem :: Ext :: BuildError:错误:无法构建gem原生扩展.的Archlinux

我正试图在笔记本电脑上本地运行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)

ruby gem rubygems github jekyll

2
推荐指数
1
解决办法
5953
查看次数

标签 统计

github ×2

html ×2

jekyll ×2

css ×1

gem ×1

github-pages ×1

post ×1

ruby ×1

rubygems ×1

text ×1