Skip to content

Commit

Permalink
Update new site
Browse files Browse the repository at this point in the history
  • Loading branch information
pomfei committed May 20, 2014
1 parent 684ed70 commit 5be5f0e
Show file tree
Hide file tree
Showing 22 changed files with 1,171 additions and 1 deletion.
26 changes: 26 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: '404 培鸡诺特方的'
layout: page
---

<script>
var posts =
{
{% for post in site.posts %} {% if post.thread %}
"{{ post.thread }}" : "{{ post.url }}",{% endif %}{% endfor %}
};

var path = location.pathname;
if(path.charAt(path.length - 1) == '/') path = path.substring(0, path.length - 1);
var name = path.substring(path.lastIndexOf('/') + 1);
var url = posts[name];
if (url)
{
document.write("您访问的文章已经转移到新网址,正在为您转跳到 <a href=" + url + ">" + url + "</a>");
location.href = url;
}
else
{
document.write("文章或附件未找到,请转到 <a href='/categories'>分类</a> 或返回 <a href='/'>首页</a>。如有问题请联系 <a href='mailto:{{ site.email }}'>{{ site.email }}</a><iframe scrolling='no' frameborder='0' src='http://yibo.iyiyun.com/js/yibo404/key/7349' width='640' height='462' style='display:block;'></iframe>");
}
</script>
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[Yonsm.NET](http://www.yonsm.net) 的博客

本博客运行于 [Jekyll](http://jekyllrb.com) @ [GitHub](http://github.com/Yonsm/NET),博客模板修改自 [WebFrog](http://webfrogs.me/) 的博客。本博客模板已经全部通用化,使用极其简单。


## 安装

1. [Fork](https://github.com/Yonsm/NET/fork) [http://github.com/Yonsm/NET](http://github.com/Yonsm/NET)

2. 所有个人相关的配置都在 _config.yml 中,修改其中内容:
* markdown: rdiscount ***(建议不修改)***
* permalink: /:title/ ***固定链接(建议别修改)***
* url: http://yonsm.net ***网站链接***
* name: Yonsm.NET ***网站名***
* author: Yonsm ***作者***
* qq: 123018 ***用于关于页面的QQ号(可选)***
* email: [email protected] ***电子邮件***
* duoshuo: yonsm ***多说评论帐号***
* beian: 浙ICP备12026616号 ***备案号(可选)***
* cnzz: 119959 ***站长统计(可选)***
* weibo: 1885061391 ***用于关于页面微博帐号***
* github: Yonsm ***GitHub帐号***
* pygments: true ***语法高亮(建议不修改)***
* safe: true ***安全模式(建议不修改)***
* paginate: 20 ***首页分页***
* truncate: 300 ***首页文章摘要字数(省略则不显示摘要,摘要风格尚需进一步美化,建议不使用)***
* about: "这里是我的博客。" ***关于介绍页面的内容***

3. 删除掉 _posts 目录下的所有文章,然后创建你的文章即可。

所有安装操作均可在浏览器中线操作,不需要在本地做任何额外工作。

## 迁移

**如果你不需要迁移,请跳过此步骤**

如果你之前在使用 WordPress,可以非常完美地导入到此博客中,分类、标签、评论都能完美迁移。

1. 安装 多说 插件来转移评论。
2. 安装 WP Slug 插件并批量编辑更新文章,以便生成英文的固定链接。
3. 可以使用 exitwp 导入文章。
4. 用文本编辑器批量替换所有导出文章中的 **wordpress_id:****thread:**,以便关联文章和多说评论。
5. 如果以前的 WordPress 固定链接是 **/post/123** 这种格式,迁移后链接依然能正常工作(实际上是 404 页面做了转跳处理)。

迁移需要在本地座比较多的准备工作,详细步骤略过,请仔细操作。

## 使用

* 点击 Powered by 里面的 **Po** 撰写新文章;点击 **ed** 编辑当前页面。
* 虽然可以用在线的编辑器来编辑和发布文章,但为了批量修改方便,还是推荐 Check Out 后修改。

Yonsm

2013-07-17
16 changes: 16 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
markdown: rdiscount
permalink: /:title/
url: http://www.nbyteam.com
name: 明月夜 小轩窗
author: NByteam.com
qq:
email: [email protected]
duoshuo: nbyteam
beian:
cnzz:
weibo: 1830766915
github: pomfei
pygments: true
safe: true
paginate: 20
about: "帝都北漂码农一枚,爱分享,爱自由,无奈年纪已大,肚腩已肥,但依旧保持一颗闷骚的心。"
18 changes: 18 additions & 0 deletions _includes/comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% if site.duoshuo %}
{% if page.thread %}
<div class="ds-thread" data-thread-key="{{ page.thread }}" data-url="{{ site.url }}{{ page.url }}" data-title="{{ page.title }}" />
{% else %}
<div class="ds-thread" />
{% endif %}
<script type="text/javascript">
var duoshuoQuery = {short_name:"{{ site.duoshuo }}"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = 'http://static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
{% endif %}
48 changes: 48 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="{{ site.author }}" />
<title>{% if page.path == 'index.html' %}{{ site.name }}{% else %}{% unless page.id %}{{ site.name }} - {% endunless %}{{ page.title }}{% endif %}</title>
<link rel="shortcut icon" href="/favicon.ico" />
<link href="/feed/" rel="alternate" title="{{ site.author }}" type="application/atom+xml" />
<link rel="stylesheet" href="/media/css/style.css" />
<link rel="stylesheet" href="/media/css/highlight.css" />
<script type="text/javascript" src="/media/js/jquery-1.7.1.min.js"></script>
</head>
<body>
<div id="container">
<div id="main" role="main">
<header>
<h1>{{ page.title }}</h1>
</header>
<nav>
<span><a title="网站首页" class="" href="/">首页</a></span>
<span><a title="文章分类" class="" href="/categories/">分类</a></span>
<span><a title="标签索引" class="" href="/tags/">标签</a></span>
<!--<span><a title="友情链接" class="" href="/links/">链接</a></span>-->
<span><a title="留言交流" class="" href="/guestbook/">留言</a></span>
<span><a title="关于站长" class="" href="/about/">关于</a></span>
<!--<span><a title="种子订阅" class="" href="/feed/" target="_blank">订阅</a></span>-->
</nav>
<article class="content">
{{ content }}
</article>
</div>

<footer>
<p><small>
Powered by <a href="http://jekyllrb.com" target="_blank">Jekyll</a> @ <a href="http://github.com/{{ site.github }}" target="_blank" title="项目主页">GitHub</a>
| <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/cn/" target="_blank" title="许可协议">©</a> 2004 - {{site.time | date:"%Y"}} <a href="/about/">{{ site.author }}</a>
{% if site.beian %}
| <a href="http://www.miibeian.gov.cn" target="_blank">{{ site.beian }}</a>
{% endif %}
{% if site.cnzz %}
| <script src="http://s85.cnzz.com/stat.php?id={{ site.cnzz }}"></script>
{% endif %}
</small></p>
</footer>

</div>
</body>
</html>
11 changes: 11 additions & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
layout: default
---

<section class="post">
{{ content }}
</section>
{% if page.comments %}
{% include comments.md %}
{% endif %}

38 changes: 38 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
layout: default
---
<section class="meta">
<span class="time">
<time datetime="{{ page.date | date:"%Y-%m-%d" }}">{{ page.date | date:"%Y-%m-%d" }}</time>
</span>
{% if page.categories.size != 0 %}
|
<span class="categories">
分类
{% for cat in page.categories %}
<a href="/categories/#{{ cat }}" title="{{ cat }}">{{ cat }}</a>&nbsp;
{% endfor %}
</span>
{% endif %}
{% if page.tags.size != 0 %}
|
<span class="tags">
标签
{% for tag in page.tags %}
<a href="/tags/#{{ tag }}" title="{{ tag }}">{{ tag }}</a>&nbsp;
{% endfor %}
</span>
{% endif %}
</section>
<section class="post">
{{ content }}
</section>
<section align="right">
<br/>
<span>
<a {% if page.previous %} href="{{ page.previous.url }}" class="pageNav"{% endif %} {% unless page.previous %} class="pageNavInvalid" {% endunless %} >上一篇</a>
&nbsp;&nbsp;&nbsp;
<a {% if page.next %} href="{{ page.next.url }}" class="pageNav"{% endif %} {% unless page.next %} class="pageNavInvalid" {% endunless %} >下一篇</a>
</span>
</section>
{% include comments.md %}
21 changes: 21 additions & 0 deletions _posts/2014-05-20-HelloWorld.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
date: 2014-05-20 22:53:43
layout: post
title: 关于Blog的那些事儿
categories: 文章
tags: 新奇好玩
---

经过多日的折腾,终于将blog放到了Github上了。整理了一下早年间写过的blog,感慨万千啊。

曾经使用过多个blog,我记得第一个应该是yo2,wordpress架构,做得很不错。后来突然有一天有关部门要求整改,要求实名,然后莫名其妙的就倒掉了,blog也打不开了。不过幸好之前有备份。于是就尝试自己建站,找空间架wordpress。折腾了许久就放弃了。

后来发现my.opera的blog系统很棒,然后做了个美美的模板。我尤其喜欢它的每个文章后面都会跟上分类的图标,相当好玩。后来,有关部门发力给GFW掉了,后来就自己关闭了,很可惜啊。

于是又听说Google的[Blogger](http://pomfei.blogspot.com/)很给力,于是又折腾起来。重新搞了模板,自定义了侧边栏,玩得还不错。可惜在墙外,访问量一直没有。不过可以通过邮件发文章,这点很不错。

后来吧,有了[Github](http://www.github.com/pomfei),不过由于各种原因,一直没来得及打理。最近换工作,终于有点空闲时间,把这个page给搭建起来。本blog模板Fork自[Yonsm](https://github.com/yonsm),感谢他的辛苦付出,可以让我这个不熟悉前端开发的人也可以轻松的使用Github pages。

Github pages在配置好了jekyll项目以后,写文章只需要通过新建Markdown文件就可以了,还是很方便的,Markdown语法也很简单,稍微看一下就会使用了。

以后会陆续的将以前写的自我感觉还可以的文章搬到这里,就在这里安家了 :-)
25 changes: 25 additions & 0 deletions about/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: About Me
layout: page
comments: no
---

{{ site.about }}

----

###联系方式:

{% if site.qq %}
QQ:[{{ site.qq }}](tencent://message/?uin={{ site.qq }})
{% endif %}
网站:[{{ site.name }}]({{ site.url }})

邮箱:[{{ site.email }}](mailto:{{ site.email }})

GitHub : [http://github.com/{{ site.github }}](http://github.com/{{ site.github }})

----


[![新浪微博](http://service.t.sina.com.cn/widget/qmd/{{ site.weibo }}/f78fbcd2/1.png)](http://weibo.com/u/{{ site.weibo }})
34 changes: 34 additions & 0 deletions categories/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: 明月夜 小轩窗
layout: page
---

<div id='tag_cloud'>
{% for cat in site.categories %}
<a href="#{{ cat[0] }}" title="{{ cat[0] }}" rel="{{ cat[1].size }}">{{ cat[0] }} ({{ cat[1].size }})</a>
{% endfor %}
</div>

<ul class="listing">
{% for cat in site.categories %}
<li class="listing-seperator" id="{{ cat[0] }}">{{ cat[0] }}</li>
{% for post in cat[1] %}
<li class="listing-item">
<time datetime="{{ post.date | date:"%Y-%m-%d" }}">{{ post.date | date:"%Y-%m-%d" }}</time>
<a href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a>
</li>
{% endfor %}
{% endfor %}
</ul>

<script src="/media/js/jquery.tagcloud.js" type="text/javascript" charset="utf-8"></script>
<script language="javascript">
$.fn.tagcloud.defaults = {
size: {start: 1, end: 1, unit: 'em'},
color: {start: '#f8e0e6', end: '#ff3333'}
};

$(function () {
$('#tag_cloud a').tagcloud();
});
</script>
Binary file added favicon.ico
Binary file not shown.
8 changes: 8 additions & 0 deletions guestbook/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: page
title: 明月夜 小轩窗
comments: yes
thread: 616
---

来了,就留下你的足迹吧。
56 changes: 56 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: 明月夜 小轩窗
layout: page
---

<ul class="listing">
{% for post in paginator.posts %}
{% capture y %}{{post.date | date:"%Y"}}{% endcapture %}
{% if year != y %}
{% assign year = y %}
<li class="listing-seperator">{{ y }}</li>
{% endif %}
<li class="listing-item">
<time datetime="{{ post.date | date:"%Y-%m-%d" }}">{{ post.date | date:"%Y-%m-%d" }}</time>
<a href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a>
{% if site.truncate %}
<p>{{ post.content | strip_html | truncate: site.truncate }}</p>
{% endif%}
</li>
{% endfor %}
</ul>

<div id="post-pagination" class="paginator">

{% if paginator.previous_page %}
{% if paginator.previous_page == 1 %}
<a href="/"><前页</a>
{% else %}
<a href="/page{{paginator.previous_page}}">&lt;前页</a>
{% endif %}
{% else %}
<span class="previous disabled">&lt;前页</span>
{% endif %}

{% if paginator.page == 1 %}
<span class="current-page">1</span>
{% else %}
<a href="/">1</a>
{% endif %}

{% for count in (2..paginator.total_pages) %}
{% if count == paginator.page %}
<span class="current-page">{{count}}</span>
{% else %}
<a href="/page{{count}}">{{count}}</a>
{% endif %}
{% endfor %}

{% if paginator.next_page %}
<a class="next" href="/page{{paginator.next_page}}">后页&gt;</a>
{% else %}
<span class="next disabled" >后页&gt;</span>
{% endif %}
(共{{ paginator.total_posts }}篇)
</div>

8 changes: 8 additions & 0 deletions links/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: 链接
layout: page
comments: yes
---

暂无

Loading

0 comments on commit 5be5f0e

Please sign in to comment.