一个超级酷炫的黑屏静态博客

git目录html

这个博客有一个好处,不须要依附于apach或者Nginx,只须要使用jekyll ,速度很快。node

安装ruby,使用rvm,步骤:(参考)git

1: gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

2: \curl -sSL https://get.rvm.io | bash # install RVM (development version)

3: rvm get head # Make Sure RVM up to date

4: rvm install ruby # will install latest version of ruby

5: rvm list # Listing install rubies will you get versions of ruby which is installed by RVM

6:  rvm use < ruby-version > # for instances ruby-1.9.3-p125

安装博客github

mkdir mymmd
cd mymmd 
git init
git clone https://github.com/karloespiritu/BlackDoc.git
ls
cd BlackDoc/

#安装js
gem install execjs
gem install therubyracer
gem install bundler
bundle install
yum install nodejs

gem install jekyll

拉起web服务web

jekyll serve --host 'yourhostip'

在浏览器中执行 http://yourhostip:4000,就能打开相似这样的黑屏博客拉 http://karloespiritu.com/blackdoc/ubuntu

如何在github上维护博客 之前在github上搭建过一个jekyll的博客,把整个目录替换掉,就能够在github上维护一个博客了。 例子:https://github.com/jesseei/jesseei.github.io浏览器

如何不使用插件增长category:ruby

  • 这里是列表文本在根目录增长category目录,里面按须要的分类增长不一样的文件夹,文件夹里增长index.html文件
---
layout: category
title: MalwareMustDie
category: MalwareMustDie
---
  • 在_layouts目录增长category.html文件
---
layout: page
---
<h2>Posts related to: {{ page.title }}</h2>

{% unless page.content == '' %}
  <p>{{ page.content }}</p>
{% endunless %}

{% unless site.categories.[page.category] | size > 0 %}
  <p>No posts in this category at this time.</p>
{% endunless %}

{% for post in site.categories.[page.category] %}
<div class="post-preview">
    <a href="{{ site.baseurl }}{{ post.url | remove_first: '/'}}">
        <h2 class="post-title">            
            {{ post.title }}
        </h2>
        {% if post.subtitle %}
        <h3 class="post-subtitle">
            {{ post.subtitle }}
        </h3>
        {% endif %}
    </a>
    <p class="post-meta">
      Posted by 
      {% if post.author %}
        {{ post.author }}
      {% else %}
        {{ site.title }}
      {% endif %} 
      on {{ post.date | date: "%B %-d, %Y" }}
    </p>
</div>
<hr>
{% endfor %}
  • 在须要展现分类列表的地方增长以下代码
<h3>Categories</h3>
{% for category in site.categories %}
    <a href="/category/{{ category[0] }}/" style="text-decoration: none;">{{ category | first }}</a><br />
{% endfor %}
相关文章
相关标签/搜索