Recordum icon indicating copy to clipboard operation
Recordum copied to clipboard

Mirror - 基于 issues 的博客工具

Open LoeiFy opened this issue 9 years ago • 58 comments

Mirror 是一个简单的博客工具,基于 GitHub API 获取 issues 数据,然后展示在页面上

该工具的方便之处在于只需要在 issue 上写你的博客文章,你的网站会自动更新博客内容

借助 GitHub,你可以轻松的用 markdown 书写你的博客内容,永久保存,不用担心数据丢失问题。还可以非常方便上传博客图片,拖入编辑器即可。

该博客工具非常适合以 issue 作为自己博客的用户,无痛生成博客网站,对原来内容毫无影响

Mirror 还支持多用户协作,你可以方便的设置哪些用户写的内容可以显示在博客网站上,避免无关内容

Mirror 在移动端同时有很好的浏览体验

预览地址

http://mirror.am0200.com/

项目地址

https://github.com/LoeiFy/Mirror

新版本使用 GitHub GraphQL API

REST API 版本:https://github.com/LoeiFy/Mirror/tree/rest-api

更详细的介绍可以看项目说明

如何使用

使用很简单,你可以直接下载资源包,下载最新的 release,然后打开 index.html 进行配置即可。

中文教程

配置好后,可以先尝试本地预览,需要一个本地服务器,放上去访问 index.html 即可,测试没问题就可以把全部文件上传到对应地址即可,也可以放到 GitHub pages 上

名字来源

MirrorDJ Okawari 所作的专辑

mirror

LoeiFy avatar Jan 15 '16 06:01 LoeiFy

想法超赞

nareix avatar Feb 01 '16 17:02 nareix

你好 很喜欢guo.lu的主题风格 在网上搜集以后 有各种版本 但是有各种各样的问题 想问下是否能发送一份主题给我 万分感谢 不会做乱七八糟的事情 自己用来研究和写个人日志 [email protected] 谢谢

houhai avatar Apr 27 '16 15:04 houhai

@houhai 你等待一段时间,迟点我会弄一个完整版本

或者可以看这个版本 https://github.com/LoeiFy/Diaspora/tree/rc

LoeiFy avatar Apr 28 '16 01:04 LoeiFy

@LoeiFy 十分期待完整版本 希望出来的时候百忙之中能告知一下 一直在期待!

houhai avatar Apr 30 '16 17:04 houhai

期待完整版本。

realooooo avatar May 01 '16 13:05 realooooo

想法很棒,但是 access token 暴露在网页上不会造成安全问题吗?

JokerQyou avatar Jul 31 '16 04:07 JokerQyou

@JokerQyou 这个 token 是只读权限,没有其他任何权限

LoeiFy avatar Jul 31 '16 13:07 LoeiFy

确实很赞,同期待ing

chlinp avatar Aug 02 '16 07:08 chlinp

请问issue这个域名怎么解析绑定到github..

ghost avatar Nov 07 '16 09:11 ghost

@ichenss

https://github.com/LoeiFy/Mirror 这个项目绑定的域名,然后这个项目引入 issues 内容

LoeiFy avatar Nov 08 '16 02:11 LoeiFy

你好@这个域名也是同样和hexo解析嘛? @ A 192.30.252.153 @ A 192.30.252.154 www CNAME username.github.io.

ghost avatar Nov 08 '16 09:11 ghost

@LoeiFy 可否发一份 完整版的给我么?很喜欢 Mirror 这套版,还有的这个能架设在 阿里云 之类的 主机上吗?感谢

insme avatar Dec 07 '16 06:12 insme

@insme https://github.com/LoeiFy/Mirror

直接使用 GitHub pages 来弄就行

LoeiFy avatar Dec 07 '16 07:12 LoeiFy

好厉害

Mosiki avatar May 09 '17 03:05 Mosiki

很棒,支持

wangzc92 avatar May 09 '17 11:05 wangzc92

您好,请问下

# token
# token 需要用 `#` 符号分割
# 例子: 5#c31bffc137f44faf7efc4a84da827g7ca2cfeaa

# 号分割是什么意思呢? 5又是代表什么呢?

wxiubin avatar Jul 06 '17 04:07 wxiubin

@sanyucz 那是你在 github 上拿到的 token,按照说明取得你的 token,然后用 '#' 号分割,因为不分割上传到 GitHub 上会被 github 删除的

LoeiFy avatar Jul 06 '17 05:07 LoeiFy

可是即便按照格式分割,照样会被删除:https://github.com/sanyucz/blog/blob/gh-pages/config.yml

wxiubin avatar Jul 06 '17 05:07 wxiubin

@sanyucz 你应该分割成 e#ae8ce1ad35dbea85247a78dd395567f2e7b9f8d 而不是在前面加 5#

意思是将你的 token 随便中间插入一个 # 字符

LoeiFy avatar Jul 06 '17 06:07 LoeiFy

好吧,现在Github不会删除我的token了~ 但是问题回来了,控制台log:

(index):1 Uncaught ReferenceError: $config is not defined
    at (index):1
(anonymous) @ (index):1
build.f431db64.js:1 Uncaught TypeError: Cannot read property 'token' of undefined
    at Object.<anonymous> (build.f431db64.js:1)
    at t (build.f431db64.js:1)
    at Object.<anonymous> (build.f431db64.js:1)
    at t (build.f431db64.js:1)
    at Object.<anonymous> (build.f431db64.js:1)
    at t (build.f431db64.js:1)
    at Object.<anonymous> (build.f431db64.js:1)
    at t (build.f431db64.js:1)
    at build.f431db64.js:1
    at build.f431db64.js:1

config.yml:https://github.com/sanyucz/blog/blob/gh-pages/config.yml site:http://blog.iosgg.cn/

wxiubin avatar Jul 06 '17 07:07 wxiubin

@sanyucz 请运行 mirror build,然后再提交你的文件

LoeiFy avatar Jul 06 '17 07:07 LoeiFy

非常感谢您的帮助!

wxiubin avatar Jul 06 '17 07:07 wxiubin

''' /usr/local/lib/node_modules/Mirror/node_modules/yamljs/lib/Parser.js:270 throw new ParseException('Unable to parse.', this.getRealCurrentLineNb() + 1, this.currentLine); ^ Error: Unable to parse. ''' 运行mirror build时唔知为什么这样?

willhunger avatar Jul 11 '17 13:07 willhunger

@willhunger 这个错误是 yml to json 出错了。你检查一下你的 config.yml 文件,可能内容格式错了,或者你贴一下你的配置内容

LoeiFy avatar Jul 11 '17 15:07 LoeiFy

site title

title:Will's Bolg

github user

user:willhunger

issue repository

repository:Blog

multi-author

authors:willhunger

token

token should be separated by '#'

example: 5#c31bffc137f44faf7efc4a84da827g7ca2cfeaa

token:

posts per page

perpage:10

willhunger avatar Jul 12 '17 14:07 willhunger

@LoeiFy token我去掉了,可是应该没什么错误吧

willhunger avatar Jul 12 '17 14:07 willhunger

@willhunger 因为你的配置 yml 格式错误,正确格式是 字段名: 字段值,注意冒号后面有一个空格。

正确应该为

# site title
title: Will's Bolg

# github user
user: willhunger

# issue repository
repository: Blog

# multi-author
authors: willhunger

# token
# token should be separated by '#'
# example: 5#c31bffc137f44faf7efc4a84da827g7ca2cfeaa
token:

# posts per page
perpage: 10

LoeiFy avatar Jul 12 '17 15:07 LoeiFy

/usr/local/lib/node_modules/Mirror/bin/mirror.js:60
.action((folder = '') => {
                ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:146:18)
    at node.js:404:3

您好,请问这是遇到了什么问题?

heytxz avatar Aug 14 '17 03:08 heytxz

通过第二种方式搞定了博客…… 从 Hexo 转移了…… 但标题为啥显示不全啊……

2017-08-14 12 03 48

heytxz avatar Aug 14 '17 04:08 heytxz

@heytxz 第一个问题是你的 nodejs 版本问题,第二个问题是标题太长,首页 css 做隐藏了,没有做换行

LoeiFy avatar Aug 15 '17 15:08 LoeiFy