hexojs / hexo Goto Github PK
View Code? Open in Web Editor NEWA fast, simple & powerful blog framework, powered by Node.js.
Home Page: https://hexo.io
License: MIT License
A fast, simple & powerful blog framework, powered by Node.js.
Home Page: https://hexo.io
License: MIT License
刚开始尝试Hexo,仅仅是执行:
npm install hexo -g
hexo init testblog
cd testblog
hexo generate
hexo server
执行上述命令均未报错。
但打开浏览器浏览发现站点页面元素不全。查看源代码发现文件头部写着layout: default,而后只有一个article标签包裹的内容。故猜测是根据theme生成页面的时候没有生成完全。
运行环境:
Windows 7 64bit
Node.js v0.8.16
Hexo 0.2.1
如果blog的title中含有空格,生成文章的url也带有空格,建议把空格改为"_"
gist file not wok
in
/lib/tag/gist.js
line 5,
file = args.length ? '/' + args[0] : '';
to
file = args.length ? '?file=' + args[0] : '';
I understand that swig is required for tag plugins as added in eb9f0c7. However, when my markdown document contains barely:
{{\foo}}
(I happened to have something like this in one of my blog post about TeX, in which {
and \
are used quite often, but note that I put this code block in a 4 spaces indention which means the Markdown processor should output that code block as is)
It will trigger the following error:
if ((typeof _context !== "undefined" && typeof _context.\foo !== "undefined")
^
SyntaxError: Unexpected token ILLEGAL
at Object.Function (unknown source)
at createRenderFunc (/usr/local/share/npm/lib/node_modules/hexo/node_modules/swig/lib/swig.js:45:10)
at createTemplate (/usr/local/share/npm/lib/node_modules/hexo/node_modules/swig/lib/swig.js:97:14)
at getTemplate (/usr/local/share/npm/lib/node_modules/hexo/node_modules/swig/lib/swig.js:125:20)
at Object.exports.compile (/usr/local/share/npm/lib/node_modules/hexo/node_modules/swig/lib/swig.js:187:14)
at load (/usr/local/share/npm/lib/node_modules/hexo/lib/processor/load.js:68:25)
at _asyncMap (/usr/local/share/npm/lib/node_modules/hexo/node_modules/async/lib/async.js:190:13)
at async.forEach (/usr/local/share/npm/lib/node_modules/hexo/node_modules/async/lib/async.js:94:25)
at _asyncMap (/usr/local/share/npm/lib/node_modules/hexo/node_modules/async/lib/async.js:187:17)
at async.parallel.results (/usr/local/share/npm/lib/node_modules/hexo/node_modules/async/lib/async.js:459:34)
Because swig incorrectly considered \foo
as a variable but it's not. Similar problem can happen to any code block with {{}}
.
My question is: how do we input a code block with {{}}
? I guess we should either escape it before sending to swig.compile()
or allow to turn swig off for document like this. Any idea?
Suggest to remove the 'layout: post` from generated new post's metadata section & make it as default setting while page remains the same.
hexo$ hexo generate
Loading.
/usr/local/share/npm/lib/node_modules/hexo/lib/util/file.js:72
if (err) throw err;
^
Error: EMFILE, readdir '/Users/pharaohnie/hexo/themes/light/source//css/_base'
After upgrade to 0.1.11, it will throw error when I try to hexo generate
Installing theme.
Clearing./home/ferrari/.nvm/v0.8.8/lib/node_modules/hexo/lib/cli/generate.js:176
if (err) throw err;
^
Error: ENOTEMPTY, rmdir '/home/ferrari/Programming/blogging/ferrari/public/tags'
Seem there're error when it try to delete directory which still have files inside (async problems?)
I just go to public and delete everything manually then generate will work.
之前使用octpress都是放在自己的服务器上,直接用ssh的方式deploy。github的访问速度和稳定性在**大陆不知道什么时候就会出问题。
hexo能否加上ssh deploy的支持呢?
事前已看過 #4 的解決方法,已仔細檢查過全局檔案皆有在冒號後加上空白鍵,不過該錯誤依然存在:
/Users/<user name>/nvm/v0.8.14/lib/node_modules/hexo/node_modules/yamljs/bin/yaml.js:1219
throw new YamlParseException('Unable to parse.', this.getRealCurrentLineNb
YamlParseException: Unable to parse.
重新安裝 nvm + node.js + hexo 問題依然存在,求解答。
The link post's single post page is not rendered properly:
我使用如下语法
{% img /downloads/image/20121222/001.jpg %}
但转换出的html如下
<img src="" class="/downloads/image/20121222/001.jpg" title="/downloads/image/20121222/001.jpg">
请及时发布一下img tag的用法吧。
比如我在mac里用MOU作为markdown的编辑器,hexo new_post之后自动代开MOU编辑新的日志。
To simplify the deployment process, I suggest to integrate "setup_deploy" into "deploy".
If one really need to run the setup process only, option should be more appropriate like "hexo deploy --setup".
hexo version:0.2.1
os:osx 10.8.2
init之后,只留了一篇hello world。之后把原来octopress中存放照片的目录download拷贝到hexo/source/中,再generate就报错了,错误如下:
hexo$ hexo generate
Installing theme.
Clearing.
Loading source files.
stream.js:81
throw er; // Unhandled stream error in pipe.
^
Error: EMFILE, open '/Users/pharaohnie/hexo/source/downloads/image/20100214-fireworks/20100214121630_img_4179.jpg'
從0.1.11版升到2.0時在generate開始就出現了這個錯誤,想請問是什麼情況?
/Users/<user name>/nvm/v0.8.14/lib/node_modules/hexo/node_modules/js-yaml/lib/js-yaml/scanner.js:352
throw new ScannerError("while scanning for the next token", null,
ScannerError:
後來試了setup deploy, generate, deploy 都會出現上述的錯誤,連直接打hexo
都是啊
如何修改主题,让图片自动居中?
hexo generate生成的文章,无论在localsever里,还是在vps上,都没有使用主题,我在_config.yml里已经设置成使用light主题了。
请问如何解决呢?
这是我的_config.yml里的相关设置
plugins:
theme: light
exclude_generator:
已经升级到0.3.1,从octopress迁移过来,照片很多,4000多个,在generate的时候报错,信息如下:
Loading.
Generating.
undefined:24
throw err;
^
Error: ejs:1
>> 1| <%- partial('_partial/head') %>
2|
3| <body>
4| <header id="header" class="inner"><%- partial('_partial/header') %></header>
EMFILE, too many open files '/Users/pharaohnie/hexo/themes/light/layout/_partial/head.ejs'
at Object.fs.openSync (fs.js:338:18)
at Object.fs.openSync (/usr/local/share/npm/lib/node_modules/hexo/node_modules/graceful-fs/graceful-fs.js:68:26)
at Object.fs.readFileSync (fs.js:182:15)
at Object.exports.readSync (/usr/local/share/npm/lib/node_modules/hexo/lib/util/file.js:114:19)
at Object.render [as partial] (/usr/local/share/npm/lib/node_modules/hexo/lib/helper/partial.js:21:26)
at eval (eval at <anonymous> (/usr/local/share/npm/lib/node_modules/hexo/node_modules/ejs/lib/ejs.js:234:12))
at exports.compile (/usr/local/share/npm/lib/node_modules/hexo/node_modules/ejs/lib/ejs.js:239:15)
at Object.exports.render (/usr/local/share/npm/lib/node_modules/hexo/node_modules/ejs/lib/ejs.js:277:13)
at Object.ejs (/usr/local/share/npm/lib/node_modules/hexo/lib/renderer/ejs.js:7:14)
at exports.renderSync (/usr/local/share/npm/lib/node_modules/hexo/lib/render.js:32:27)
如果在_config.yml添加
deploy:
type:github
repository:yhben.github.com
branch:master
或者添加
disqus_shortname:yhben
後,在終端輸入指令_hexo config_,提示
/usr/local/lib/node_modules/hexo/node_modules/yamljs/bin/yaml.js:1219
throw new YamlParseException('Unable to parse.', this.getRealCurrentLineNb
^
YamlParseException: Unable to parse.
請問該如何解決?
:)
~$ hexo init test
/Users/Lucifr/nvm/v0.8.14/lib/node_modules/hexo/lib/generator/index.js:2
config = hexo.config.exclude_generator,
^
TypeError: Cannot read property 'exclude_generator' of null
at Object.<anonymous> (/Users/Lucifr/nvm/v0.8.14/lib/node_modules/hexo/lib/generator/index.js:2:23)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at module.exports (/Users/Lucifr/nvm/v0.8.14/lib/node_modules/hexo/lib/config.js:39:5)
at _asyncMap (/Users/Lucifr/nvm/v0.8.14/lib/node_modules/hexo/node_modules/async/lib/async.js:190:13)
at async.forEach (/Users/Lucifr/nvm/v0.8.14/lib/node_modules/hexo/node_modules/async/lib/async.js:94:25)
In Octopress a permalink will be used when it is defined in a post's YAML front matter and the system-wide setting will be omitted, which could be helpful for those who transferred from other platform such as wordpress, since there's no redirecting method in github.
instead of reminding one to do so:
"console.log('You should use %s to generate files first.', clc.bold('hexo generate'));"
I suggest we have it taken care of in "deploy".
http://zespia.tw/archives/ 我挺喜歡彙整頁中只有標題連結,可是預設的主題都會把內文顯示出來。如果要改成那樣的話,是不是一定要手動改寫布局?
不是每次运行都报错,错误信息如下:
hexo$ hexo generate
Loading.
/usr/local/share/npm/lib/node_modules/hexo/lib/util/file.js:72
if (err) throw err;
^
Error: EMFILE, readdir '/Users/pharaohnie/hexo/themes/light/source//css/_base'
使用rss migrator的时候都变成了纯html,很不方便书写。
能否把octopress中的img标签也port到hexo中,这样基本就可以100%的迁移到hexo中了。
currently there's no any proper way to organize posts except categorize them into separated folders, but then Hexo'll treat them as categories. Is there any better way to do so especially ppl who have hundreds or even thousands of posts?
默认的 marked 是很不错,但对有些 markdown 语法的解释还是有些出入,比如这个。能不能支持选择其它的 markdown 引擎呢?我现在手动改成了 node-discount,支持各种 discount 的 flag,特别是 footnote。
hi ,
按照教程一步步的做,安装很顺利,但是在发布新文章的时候出现错误:
user@home:~$ hexo new_post
bash: 未预期的符号 `newline' 附近有语法错误。
any suggestion?
Hi,
It maybe something really simple but then I am trying to start a new hexo project I get this:
C:\Users\me\AppData\Roaming\npm\node_modules\hexo\lib\route.js:7
sepre = new RegExp(sep, 'g');
^
SyntaxError: Invalid regular expression: //: \ at end of pattern
at new RegExp (unknown source)
at Object. (C:\Users\me\AppData\Roaming\npm\node_modules\hex
o\lib\route.js:7:11)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object. (C:\Users\me\AppData\Roaming\npm\node_modules\hex
o\lib\cli\generate.js:2:11)
at Module._compile (module.js:449:26)
生成的tag连接不对,你可以访问“http://nio.name/tags/FREEBSD/”试试
詳細請看看這邊的代碼提示:https://gist.github.com/4473855
請問這是插件的錯誤還是我在安裝的過程有什麼出錯了?
能否每次更新的时候写一下changelog,这样可以知道每次有什么新特性。
再有就是文档需要更新一下啦。
btw:hexo越来越好用了,我的几百篇blog,之前generate的时间在16s-20左右,更新0.4.1后,generate的时间在10s左右。
我按照 Doc 里提供的流程安装了 hexo, 本地4000端口能够预览,但是输入 hexo deploy
命令后出现如下错误,请问如何解决呢?
fatal: 'furtee.github.com' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
而且好像我的 master 分支也不对头,能否帮我看看 https://github.com/trai25/furtee.github.com
我是新人,刚接触 git 不久,也许是一些低级错误,还请 tommy351 兄指导,感谢!
希望可以同时输出在错误声明中,这样可以便于查找是哪个文件出错了(出错的原因可能很多,例如文件自己坏了,或者修改的时候格式错误等等)
When a custom permalink is set in a post, for example, "permalink: /189/bloglines-and-google-reader/", the expected url for the title should be "http://example.com/189/bloglines-and-google-reader/". However, with hexo 0.1.6, the url produced is "http://189/bloglines-and-google-reader/".
配置如下:
deploy:
type: rsync
host: xxx.xxx.xxx.xx
user: root
root: /home/hexo
port: 23525
rsync deploy后直接就是rsync的help了,估计是rsync的命令格式有误
hexo$ hexo deploy
Syncing.
rsync version 2.6.9 protocol version 29
Copyright (C) 1996-2006 by Andrew Tridgell, Wayne Davison, and others.
<http://rsync.samba.org/>
Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles,
inplace, IPv6, 64-bit system inums, 64-bit internal inums
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.
rsync is a file transfer program capable of efficient remote update
via a fast differencing algorithm.
Usage: rsync [OPTION]... SRC [SRC]... DEST
or rsync [OPTION]... SRC [SRC]... [USER@]HOST:DEST
or rsync [OPTION]... SRC [SRC]... [USER@]HOST::DEST
or rsync [OPTION]... SRC [SRC]... rsync://[USER@]HOST[:PORT]/DEST
or rsync [OPTION]... [USER@]HOST:SRC [DEST]
or rsync [OPTION]... [USER@]HOST::SRC [DEST]
or rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST]
The ':' usages connect via remote shell, while '::' & 'rsync://' usages connect
to an rsync daemon, and require SRC or DEST to start with a module name.
Options
-v, --verbose increase verbosity
-q, --quiet suppress non-error messages
--no-motd suppress daemon-mode MOTD (see manpage caveat)
-c, --checksum skip based on checksum, not mod-time & size
-a, --archive archive mode; same as -rlptgoD (no -H)
--no-OPTION turn off an implied OPTION (e.g. --no-D)
-r, --recursive recurse into directories
-R, --relative use relative path names
--no-implied-dirs don't send implied dirs with --relative
-b, --backup make backups (see --suffix & --backup-dir)
--backup-dir=DIR make backups into hierarchy based in DIR
--suffix=SUFFIX set backup suffix (default ~ w/o --backup-dir)
-u, --update skip files that are newer on the receiver
--inplace update destination files in-place (SEE MAN PAGE)
--append append data onto shorter files
-d, --dirs transfer directories without recursing
-l, --links copy symlinks as symlinks
-L, --copy-links transform symlink into referent file/dir
--copy-unsafe-links only "unsafe" symlinks are transformed
--safe-links ignore symlinks that point outside the source tree
-k, --copy-dirlinks transform symlink to a dir into referent dir
-K, --keep-dirlinks treat symlinked dir on receiver as dir
-H, --hard-links preserve hard links
-p, --perms preserve permissions
--executability preserve the file's executability
--chmod=CHMOD affect file and/or directory permissions
-o, --owner preserve owner (super-user only)
-g, --group preserve group
--devices preserve device files (super-user only)
--specials preserve special files
-D same as --devices --specials
-t, --times preserve times
-O, --omit-dir-times omit directories when preserving times
--super receiver attempts super-user activities
-S, --sparse handle sparse files efficiently
-n, --dry-run show what would have been transferred
-W, --whole-file copy files whole (without rsync algorithm)
-x, --one-file-system don't cross filesystem boundaries
-B, --block-size=SIZE force a fixed checksum block-size
-e, --rsh=COMMAND specify the remote shell to use
--rsync-path=PROGRAM specify the rsync to run on the remote machine
--existing skip creating new files on receiver
--ignore-existing skip updating files that already exist on receiver
--remove-source-files sender removes synchronized files (non-dirs)
--del an alias for --delete-during
--delete delete extraneous files from destination dirs
--delete-before receiver deletes before transfer (default)
--delete-during receiver deletes during transfer, not before
--delete-after receiver deletes after transfer, not before
--delete-excluded also delete excluded files from destination dirs
--ignore-errors delete even if there are I/O errors
--force force deletion of directories even if not empty
--max-delete=NUM don't delete more than NUM files
--max-size=SIZE don't transfer any file larger than SIZE
--min-size=SIZE don't transfer any file smaller than SIZE
--partial keep partially transferred files
--partial-dir=DIR put a partially transferred file into DIR
--delay-updates put all updated files into place at transfer's end
-m, --prune-empty-dirs prune empty directory chains from the file-list
--numeric-ids don't map uid/gid values by user/group name
--timeout=TIME set I/O timeout in seconds
-I, --ignore-times don't skip files that match in size and mod-time
--size-only skip files that match in size
--modify-window=NUM compare mod-times with reduced accuracy
-T, --temp-dir=DIR create temporary files in directory DIR
-y, --fuzzy find similar file for basis if no dest file
--compare-dest=DIR also compare destination files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
-z, --compress compress file data during the transfer
--compress-level=NUM explicitly set compression level
-C, --cvs-exclude auto-ignore files the same way CVS does
-f, --filter=RULE add a file-filtering RULE
-F same as --filter='dir-merge /.rsync-filter'
repeated: --filter='- .rsync-filter'
--exclude=PATTERN exclude files matching PATTERN
--exclude-from=FILE read exclude patterns from FILE
--include=PATTERN don't exclude files matching PATTERN
--include-from=FILE read include patterns from FILE
--files-from=FILE read list of source-file names from FILE
-0, --from0 all *-from/filter files are delimited by 0s
--address=ADDRESS bind address for outgoing socket to daemon
--port=PORT specify double-colon alternate port number
--sockopts=OPTIONS specify custom TCP options
--blocking-io use blocking I/O for the remote shell
--stats give some file-transfer stats
-8, --8-bit-output leave high-bit chars unescaped in output
-h, --human-readable output numbers in a human-readable format
--progress show progress during transfer
-P same as --partial --progress
-i, --itemize-changes output a change-summary for all updates
--out-format=FORMAT output updates using the specified FORMAT
--log-file=FILE log what we're doing to the specified FILE
--log-file-format=FMT log updates using the specified FMT
--password-file=FILE read password from FILE
--list-only list the files instead of copying them
--bwlimit=KBPS limit I/O bandwidth; KBytes per second
--write-batch=FILE write a batched update to FILE
--only-write-batch=FILE like --write-batch but w/o updating destination
--read-batch=FILE read a batched update from FILE
--protocol=NUM force an older protocol version to be used
-E, --extended-attributes copy extended attributes
--cache disable fcntl(F_NOCACHE)
-4, --ipv4 prefer IPv4
-6, --ipv6 prefer IPv6
--version print version number
(-h) --help show this help (-h works with no other options)
Use "rsync --daemon --help" to see the daemon-mode command-line options.
Please see the rsync(1) and rsyncd.conf(5) man pages for full documentation.
See http://rsync.samba.org/ for updates, bug reports, and answers
rsync error: syntax or usage error (code 1) at /SourceCache/rsync/rsync-42/rsync/main.c(1385) [receiver=2.6.9]
按照文档添加了自动打开newpost的功能,但是报错。
hexo new_post 'test'
Post created at /Users/pharaohnie/hexo/source/_posts/2013-01-07-test.md
/Users/pharaohnie/hexo/scripts/autoopen:4
spawn('open', [target]);
^
ReferenceError: target is not defined
at EventEmitter.<anonymous> (/Users/pharaohnie/hexo/scripts/autoopen:4:20)
at EventEmitter.emit (events.js:96:17)
at /usr/local/share/npm/lib/node_modules/hexo/lib/cli/new.js:46:14
at fs.close (/usr/local/share/npm/lib/node_modules/hexo/node_modules/graceful-fs/graceful-fs.js:90:5)
at Object.oncomplete (fs.js:297:15)
在VPS上生成文件时报错
Initializing.
stream.js:81
throw er; // Unhandled stream error in pipe.
^
Error: ENOENT, open '/home/marvin/.nvm/v0.8.14/lib/node_modules/hexo/files/init/.gitignore'
OS:Archlinux
kernel:3.6.11-1-ARCH
I want to just npm install hexo
and run hexo commands but when I do this, I get:
-bash: hexo: command not found
How can I run hexo without installing it globally?
当出现大小写的时候,大写的Tag和小写Tag分开了,但是其中一个URL错误,另外一个计数错误。
请参看我的两个 Apple Tag:
http://woooh.com/
建议:全部强制小写
環境:
hexo 0.3.2
node v0.8.16
npm 1.1.70
ubuntu 11.04 Server
$ hexo server
/home/lue/.nvm/v0.8.16/lib/node_modules/hexo/lib/cli/server.js:9
if (config.logger){
^
TypeError: Cannot read property 'logger' of null
at Object.server (/home/lue/.nvm/v0.8.16/lib/node_modules/hexo/lib/cli/server.js:9:13)
at module.exports (/home/lue/.nvm/v0.8.16/lib/node_modules/hexo/lib/console.js:57:20)
at _asyncMap (/home/lue/.nvm/v0.8.16/lib/node_modules/hexo/node_modules/async/lib/async.js:190:13)
at async.forEachSeries.iterate (/home/lue/.nvm/v0.8.16/lib/node_modules/hexo/node_modules/async/lib/async.js:116:25)
at _asyncMap (/home/lue/.nvm/v0.8.16/lib/node_modules/hexo/node_modules/async/lib/async.js:187:17)
at async.series.results (/home/lue/.nvm/v0.8.16/lib/node_modules/hexo/node_modules/async/lib/async.js:491:34)
at module.exports (/home/lue/.nvm/v0.8.16/lib/node_modules/hexo/lib/loader.js:7:28)
at /home/lue/.nvm/v0.8.16/lib/node_modules/hexo/lib/console.js:12:31
at async.series.results (/home/lue/.nvm/v0.8.16/lib/node_modules/hexo/node_modules/async/lib/async.js:486:21)
at _asyncMap (/home/lue/.nvm/v0.8.16/lib/node_modules/hexo/node_modules/async/lib/async.js:185:13)
可能需要一个临时切换来平滑衔接发布过程。
在new_post后,文件名就是文章的名字,能否在文章名字前加上日期,要不文章多了找起来很麻烦。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.