Total Pageviews

Saturday 15 June 2013

在linux vps上,安装静态博客程序hexo


# npm install -g hexo

Update

# npm update -g ( 这一步是多余的,不建议进行,以节省内存)

Getting Started

Setup a project:
# hexo init project
# cd project
 
Create a new article:
# hexo new "title of Post" 
 
Generate static files:
# hexo generate (这一步将在project目录下的空目录public里生成网站文件,这个public目录
就是网站的根目录。你可绑定域名到此public目录) 
 
Start the server:
# hexo server (这一步好像是多余的,我没运行它,我的网站http://hx.brite.biz/仍然可以访问。)
 
 from https://github.com/tommy351/hexo,
http://zespia.tw/hexo ,http://hexo.io
http://github.com/hexojs/site,http://github.com/hexojs/hexo
(https://github.com/mcxiaoke/mcxiaoke.github.io,
https://github.com/mcxiaoke/mcxiaoke.github.io.source)
 
示例: http://hx.brite.biz/ 
 
related post: http://briteming.blogspot.co.uk/2013/06/hexo-dropbox.html 
-----------

常见问题

  1. 替换hexo-livereload (TypeError: Cannot read property 'modified' of undefined at Router...)
npm uninstall hexo-livereload --save
npm install hexo-browsersync --save
  1. Error: Cannot find module './build/Release/DTraceProviderBindings']...

发布流程

clone项目

git clone git@github.com:HopperClouds/hopperclouds.github.io.git -b source --depth=1

安装

npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install hexo -g
cnpm install
git submodule update --init --recursive

打开本地开发环境

npm run dev

添加文章

复制markdown格式的文章到 source/_posts 目录下, 并进行add, commit, push。 另外可以参考该目录下的聘宝招聘Python实习生.md文档在文档头部添加一些说明信息。

如何发布到hopperclouds.github.io?

cd hopperclouds.github.io
npm run generate
npm run deploy

其它(可选)

安装指定主题
可参考上面关于submodule的部分或者直接运行:
cd themes && git submodule update --init --recursive --depth=1
安装本地运行环境
npm install
本地运行
hexo server
使用图片粘贴上传服务
##关于submodule
添加submodule:
git submodule add 仓库地址 路径
注意:路径不能以 / 结尾(会造成修改不生效)、不能是现有工程已有的目录(不能順利 Clone)

初始化
git submodule init

更新
git submodule update

部署
git submodule update --init --recursive
要是加上 --recursive 参数, git clone 也可以把所有一起 clone 过来哦
git clone --recursive 仓库地址

同步
git submodule foreach --recursive git pull origin master

git submodule status

删除
submodule的删除稍微麻烦点:首先,要在“.gitmodules”文件中删除相应配置信息。然后,执行“git rm –cached ”命令将子模块所在的文件从git中删除。
$ git rm --cached node_modules/submodule && rm -rf node_modules/submodule/

下载的工程带有submodule
初始的时候,submodule的内容并不会自动下载下来的,此时,只需执行如下命令:
git submodule update --init --recursive
from https://github.com/HopperClouds/hopperclouds.github.io
----------------------------------------------------------------------

A Lightweight \ Multi Platform \ Out of The Box hexo backend Manager | 轻量级\多平台\开箱即用的hexo后端管理器

wexa.top 

Wexagonal

With backend Hex(agonal)

A Lightweight \ Multi Platform \ Out of The Box hexo backend Manager

文档地址

安装平台与数据库兼容性

标记~为暂时未支持的内容

↓数据库/安装平台→ 服务器Node CloudFlareWorker Vercel Heroku SCF ~Deno
CloudFlareKV × × × × ×
MongoDB × ×
~FireBase
HTTP简易数据库
 
from https://github.com/Wexagonal/Wexagonal
------------------------------------------------------------
 
基于CloudFlareWorker的无服务器Hexo后端,目标:解决静态博客所有痛点[文章编辑、图片上传、博主活跃信息统计.

此仓库将处于归档状态.不过,为什么不试试Wexagonal呢?Wexa更快,支持的平台和数据库更多,并且有着更强大的功能.

HexoPlusPlus

A powerful Hexo dashboard

HexoPlusPlus也叫Hexo艹,是一个基于CloudFlareWorkers和CloudFlareKV技术的Hexo后端程序,目的是解决Hexo无后端带来的种种麻烦,支持但不限于Hexo等静态博客;利用CloudFlareWorkers当中间件,有效避免直接上传到Github易失败问题。

注意,HexoPlusPlus在使用前您的博客必须保证已完成集成部署

特色

  • 免费
  • 易上手
  • 图形化安装,KV数据库
  • 高度自适应编辑器,手机端流畅写作,支持代码高亮,支持草稿写作,支持随时备份,允许上传文件,高度适配自带图床
  • 登录验证码
  • 全主题适配
  • Material Dashboard,细腻书写新体验
  • 快,服务端处理不超过10ms[主要是CloudFlare的限制,很多高负荷运算只能拉到前端处理]

功能

  • 文章在线编辑
  • Github图床支持
  • 文件管理
  • 活跃时间统计
  • 说说功能
  • Twikoo加强
  • Imgur图床+镜像支持
  • 7bu图床支持
  • i8n国际化

完整文档请前往https://hexoplusplus.js.org/

依赖

HexoPlusPlus的诞生离不开以下项目的支持:

由于仍处于快速迭代期,HPP尚未使用NPM发包,请使用Jsdelivr+Github访问静态资源.

对于开发者来说

npm i @cloudflare/wrangler -g
npm i

修改wrangler.toml

wrangler dev

默认情况下,依赖已直接集成在主脚本,但在开发环境下仍需额外引入。

只需将最前面的依赖注释去掉即可。

from https://github.com/HexoPlusPlus/HexoPlusPlus 

------

An Admin Interface for Hexo.

jaredly.github.io/hexo-admin/

An admin UI for the Hexo blog engine. Based off of the Ghost interface, with inspiration from svbtle and prose.io.

Hexo Version

For 2.x, use version 0.3.0 of this plugin. Version 1.x and beyond only support Hexo v3.x.

Contents

Local use vs deployment

This plugin was originally designed as a local editor -- you run hexo locally, use hexo-admin to author posts, and then use hexo generate or hexo deploy to send the generated static HTML files up to github pages or some other static server.

However, hexo-admin can be run on your live blog, as long as you're using a non-static hosting service such as Heroku, DigitalOcean, etc. Static hosting services such as Github pages and Surge.sh does not support running hexo-admin from your live site. If you're using Hexo admin from your live blog, you should definitely set up a password (see below) -- otherwise anyone will be able to edit your content.

Screenshots

posts view

editor view

Quickstart

1. Setup hexo & create a blog

npm install -g hexo
cd ~/
hexo init my-blog
cd my-blog
npm install

2. Install the admin & start things up

npm install --save hexo-admin
hexo server -d
open http://localhost:4000/admin/

3. Profit!

The UI should be pretty discoverable -- let me know if you can't find something.

4. Password protection

If you're using Hexo admin on your live server, you want some password protection. To enable this, you just add a few config variables to your hexo _config.yml:

admin:
  username: myfavoritename
  password_hash: be121740bf988b2225a313fa1f107ca1
  secret: a secret something

The password_hash is the bcrypt hash of your password. The secret is used to make the cookies secure, so it's a good idea to have it be long and complicated.

A utility in Hexo admin's Settings can hash your password and generate the admin section for you. Start Hexo and go to Settings > Setup authentification and fill out your information. Copy the generated YAML into your _config.yml.

Once that's in place, start up your hexo server and going to /admin/ will require you to enter your password.

5. Custom post metadata

To add and edit your own post metadata with the admin interface, add the metadata variable and your custom variables to your hexo _config.yml:

metadata:
  author_id: defaultAuthorId
  language:
You can provide default values that will be used to initialize the metadata of a new post. These can be either primitives or arrays.  
 
built with ❤ by Jared Forsyth (@jaredforsyth) using react, browserify, and less.

from  https://github.com/jaredly/hexo-admin