GithubHelp home page GithubHelp logo

gethexon / hexon Goto Github PK

View Code? Open in Web Editor NEW
111.0 3.0 24.0 45.66 MB

Let's hexo online.

Home Page: https://hexon-demo.yujianghao.cn/#/

License: GNU General Public License v3.0

JavaScript 25.30% Vue 23.89% HTML 0.10% TypeScript 50.64% Less 0.06% Shell 0.01%
hexo blog hexo-blog self-hosted

hexon's Introduction

Hexon

Let's hexo online!

GitHub release (latest by date)

English | 中文

home screen

❔ How it works?

Hexon is a GUI for hexo with git, run commands and manage content for you.

⭐️ Features

  • Post and page management
  • Front-matter template
  • Online image management use imageur

📘 Guide

Before Install

Make sure your git, hexo and Node.js workflow is fine. Hexon only provide a GUI for these commands, but not implement them.

Install

git clone https://github.com/gethexon/hexon --depth 1
cd hexon
pnpm install
pnpm run setup

Uninstall

Just remove the folder you just cloned

rm -rf hexon

Start

For plain Node.js:

pnpm start

For better devOps with pm2

pnpm prd
# or integrate pm2 with `pnpm start` manually

Update

Just uninstall the old one and install the new one.

💻 Commands

  • pnpm run setup: install and config
  • pnpm start: start hexon with node
  • pnpm prd: start hexon with pm2
  • pnpm resetpwd: reset password
  • pnpm script: manage custom script

You can replace hexon commands with your own bash script inside hexo blog folder.

e.g. modify git sync script

  1. write your script in <hexo-blog-path>/git_sync.sh
  2. run pnpm script
  3. select git sync
  4. set script to bash ./git_sync.sh

🖥️ Develop

  • Check out main branch.
  • Run pnpm dev-init install dependencies and config hexon.
  • Run pnpm dev and show your magic!

💩 Have trouble?

❓ Want to know more?

Start a discussion.

👌🏻 FAQ

404 Error

Maybe mistakes in revert proxy config(e.g. Nginx or Apache config). To verify, use curl on your server directly request assets without any revert proxy. This should be a command looks like:

curl http://localhost:5777/assets/HMonacoEditor.5101bbae.js

Or hexon failure. Just raise an issue.

If you are using Apache's reverse proxy... Please make sure to add `AllowEncodedSlashes NoDecode` in your `VirtualHost` configuration, and add `nocanon` at the end of the `ProxyPass` setting.

See https://stackoverflow.com/questions/52034899/express-nodejs-server-through-apache-proxy-error-404-for-route-with-express-par and https://stackoverflow.com/questions/4390436/need-to-allow-encoded-slashes-on-apache

Example:

<VirtualHost *:443>
    ServerName blog-admin.example.com

    SSLCertificateFile /etc/certificates/example.com.crt
    SSLCertificateKeyFile /etc/certificates/example.com.key
    SSLCertificateChainFile /etc/certificates/example.com.crt

    SSLEngine On
    SSLProxyEngine On
    ProxyRequests Off
    ProxyPreserveHost On
    AllowEncodedSlashes NoDecode

    ProxyPass / http://localhost:5777/ nocanon
    ProxyPassReverse / http://localhost:5777/
</VirtualHost>

Star history

Star History Chart

Contributors

License

GPL-3.0 © winwin2011

hexon's People

Contributors

hyperzlib avatar konnokai avatar yujianghao avatar zs1m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hexon's Issues

无法反代到二级目录

似乎是因为很多链接都是不是以.开头的相对路径的关系。
例如/favicon.ico改为./favicon.ico后logo显示了。

关于git备份操作

建议增加 git配置项,主要针对 码云 github gitlab等仓库 可以多仓库管理。 做高可用备份。
命令都是一套,主要是配置管理。大概如下

配置github.com

Host 数据源名称
HostName github.com
IdentityFile ~.ssh\id_rsa --- key
PreferredAuthentications publickey
User name

配置SQL

Host gitlab
HostName gitlab.com
IdentityFile ~.ssh\id_rsa_sql --key文件
PreferredAuthentications publickey
User name

配置SQLSQ

Host 码云
HostName github.com
IdentityFile ~.ssh\sqlsq_id_rsa
PreferredAuthentications publickey
User jackfeng

运行报错ID `source/CNAME` has been used

错误信息:
WarehouseError: ID source/CNAME has been used

除了该错误,同时还会提醒

Error: ENOENT: no such file or directory, open 'sitemap_template.xml'

应该是文件读取问题,我检测过该文件实际存在。

access with path

是否可以像hexo_admin一样可以通过路径(比如sample.com/hexon)而非端口访问?
通过nginx反代可以实现但如果自带会更方便一点……

feat: template for frontmatters

在不同主题下,会自定义一些frontmatters项,每次都要重新输入相当麻烦。建议加入保存参数项,或者保存自定义的内容。例如我就有很多

---
title:
date:
updated:
tags:
categories:
keywords:
description:
top_img:
comments:
cover:
toc:
toc_number:
toc_style_simple:
copyright:
copyright_author:
copyright_author_href:
copyright_url:
copyright_info:
mathjax:
katex:
aplayer:
highlight_shrink:
aside:
---

Art works welcomed!

What we need?

A LOGO: use as favicon.ico and app's logo.

  • .svg format
  • 1:1 ratio
  • blue based colors

Social Preview: use as a social media preview.

  • 1280×640px .png
  • blue based colors

关于主题配置

建议将config文件可以在线设置,
方便后期增加 主题切换 和在线配置功能。

宝塔面板可以使用进程守护器进行守护吗?

使用宝塔面板,进程守护器,目录设置hexon目录,命令为 pnpm start 但是显示
2023-09-01 16:38:53,641 INFO spawnerr: can't find command 'pnpm'
2023-09-01 16:38:53,642 INFO spawnerr: can't find command 'pnpm'
2023-09-01 16:38:54,843 INFO spawnerr: can't find command 'pnpm'
2023-09-01 16:38:54,843 INFO spawnerr: can't find command 'pnpm'
2023-09-01 16:38:56,846 INFO spawnerr: can't find command 'pnpm'
2023-09-01 16:38:56,846 INFO spawnerr: can't find command 'pnpm'
2023-09-01 16:39:00,408 INFO spawnerr: can't find command 'pnpm'
2023-09-01 16:39:00,408 INFO gave up: hexo_00 entered FATAL state, too many start retries too quickly
2023-09-01 16:39:00,408 INFO spawnerr: can't find command 'pnpm'
2023-09-01 16:39:00,408 INFO gave up: hexo_01 entered FATAL state, too many start retries too quickly

直接使用ssh,没问题。

无法新建文章提示500错误

系统ubuntu 22.04

<-- POST [secure]/hexo/create
[auth-storage-service][2022-08-25 10:21:42.766] get secret
[exec-service][2022-08-25 10:21:42.770] run hexo new aaa
INFO Start processing
xxx POST [secure]/hexo/create 500 837ms -
[app][2022-08-25 10:21:43.602] TypeError: Cannot read properties of undefined (reading 'trim')
at HexoService.create (/home/blog/hexon/server/dist/index.js:4264:64)
at async /home/blog/hexon/server/dist/index.js:4371:14
at async serve (/home/blog/hexon/server/node_modules/.pnpm/[email protected]/node_modules/koa-static/index.js:53:9)
at async logger (/home/blog/hexon/server/node_modules/.pnpm/[email protected]/node_modules/koa-logger/index.js:67:7)
at async /home/blog/hexon/server/dist/index.js:2899:7
at async compressMiddleware (/home/blog/hexon/server/node_modules/.pnpm/[email protected]/node_modules/koa-compress/lib/index.js:52:5)
at async bodyParser (/home/blog/hexon/server/node_modules/.pnpm/[email protected]/node_modules/koa-bodyparser/index.js:95:5)
at async /home/blog/hexon/server/dist/index.js:4638:5

中文文档支持

为什么没用中文文档啊(恼
对于我这种英文不太好的人 不太友好哦qwq

建议:为程序添加后台运行功能及意外退出自启动功能

成功部署到设备,但是我一关闭终端程序就关了,网页端会显示‘未发送任何数据’。
我希望能为程序加入后台运行功能(可以通过systemctl之类),实现开机自启,单行命令运行(不用先cd到程序目录然后mnpm),或者守护程序实现意外停止自动恢复。

windows run

"wstart": "set DEBUG=null && set NODE_ENV=production && node dist/index.js",

关于新建逻辑迭代

主要解决 post目录下文件过多,用路径的方式代替,目前再新建的时候 可以在path 设置。
但是如果可以在目录侧直接新建 那不就更加方便了。 这样的话 不是每次都得输入吗

一些问题

乱改 front matter 被我逮到了

diff --git a/source/magic/index.md b/source/magic/index.md
index d722145..d28f868 100644
--- a/source/magic/index.md
+++ b/source/magic/index.md
@@ -1,7 +1,5 @@
----
-title: magic
-date: 2024-01-10 00:01:44
 comments: false
+title: magic
 ---

可以想想办法怎么做成一个 hexo 插件

问题

作为独立应用调用 hexo 需要完整照顾 hexo 的运行和环境,有可能出现一些问题,例如:

  • 其他插件的兼容性问题 #39
  • 用户需要自行配置 hexo 的安装路径,这很麻烦
  • 无法使用现有的 hexo 运行时
  • 需要将构建产物 commit 到 git 中,增加 git 负担
  • hexon 配置不方便持久化

期望

在 hexo 目录中一键启动:

# in hexo blog
hexon start

方案

  • 开发 hexo 插件
  • hexon 配置: hexo _config.yml -> hexon
  • release pipeline: npm package

编辑文章得问题

文章过长得时候 旁边没有 滚动条。无法定位当前进度,不能快速拉到底部 只能 滚动操作。
image

建议增加自定义命令调用

为配合css,js,img压缩功能的调用,建议在生成阶段增加自定义命令调用。

我的生成到部署阶段执行的命令顺序为:

hexo clean
hexo g
gulp
hexo d

不知道是否可以实现,定义gulp或其它命令加入其中执行。

使用 aurora 主題時,pages 請求內的各 page 的 __page 屬性不會設定上去

錯誤說明

使用 Hexo 內建的 landscape 主題請求 http://localhost:4000/proxy/hexo/pages 時正常
image

當主題改用 aurora__page 屬性消失
image

網頁顯示的錯誤訊息
20230418_181031_chrome

且在建立新的 page 時 Hexo 會出現錯誤 (這個錯誤不管使用 landscape 或是 aurora 主題都會出現,但使用 landscape 主題的話重整頁面後 page 會出現在網頁上)
image

已知情況

使用 aurora 主題時,src\server\services\hexo-service.ts#L253 中的 docsres 變數已無 __page 屬性
image

不使用 .map(toPage) 直接輸出 hexo.locals.get("pages") 的情況亦同
image

猜測

aurora 主題在 generate 階段時將某個東西給移除掉了,或是沒有把 __page 屬性補上

備註

由於 aurora 主題原作者已停止開發,目前本人有自行 fork 該專案修改,也會追查此問題的導致的原因跟協助處理

使用版本

  • hexo: 6.3.0
  • hexo-cli: 4.3.0
  • os: Windows 10 Pro x64 (但這問題在我實際部屬的伺服器上也會發生,伺服器: Debian GNU/Linux 11 (bullseye) x86_64)
  • node: 16.20.0
  • aurora: 1.5.5 本人修改的版本

[feat]: 建议支持设置不同级别的 git 仓库

hexo ------------------- git repo 1, hexo 级别设置。
+--hexon
+--source
     +--_posts  --------- git repo 2, submodule,post 的博文。
+--themes
     +-- next ----------- git repo 3, submodule,nexT 主题级别自定义设置。

目前如果配置 ssh 的话, 会把 hexon 也提交成一个 submodule 。
个人的想法是:如果可以做到 配置到 _posts 级别, 只更新博文相关, hexo 和 nexT 及 hexon 基本为固定或较少改动。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.