Skip to content

Commit

Permalink
Build and Deploy from Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
h4m5t committed Sep 24, 2024
0 parents commit 5daf1b5
Show file tree
Hide file tree
Showing 27 changed files with 8,629 additions and 0 deletions.
189 changes: 189 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>页面没有找到 | h4m5t's Blog</title><meta name="author" content="h4m5t"><meta name="copyright" content="h4m5t"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="人生得意需尽欢">
<meta property="og:type" content="website">
<meta property="og:title" content="h4m5t&#39;s Blog">
<meta property="og:url" content="http://h4m5t.github.io/404.html">
<meta property="og:site_name" content="h4m5t&#39;s Blog">
<meta property="og:description" content="人生得意需尽欢">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://h4m5t.github.io/img/touxiang.jpg">
<meta property="article:author" content="h4m5t">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://h4m5t.github.io/img/touxiang.jpg"><link rel="shortcut icon" href="/img/icon-H.png"><link rel="canonical" href="http://h4m5t.github.io/404.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
root: '/',
algolia: undefined,
localSearch: {"path":"/search.xml","preload":false,"top_n_per_article":1,"unescape":false,"languages":{"hits_empty":"找不到您查询的内容:${query}","hits_stats":"共找到 ${hits} 篇文章"}},
translate: undefined,
noticeOutdate: undefined,
highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
copy: {
success: '复制成功',
error: '复制错误',
noSupport: '浏览器不支持'
},
relativeDate: {
homepage: false,
post: false
},
runtime: '天',
dateSuffix: {
just: '刚刚',
min: '分钟前',
hour: '小时前',
day: '天前',
month: '个月前'
},
copyright: undefined,
lightbox: 'fancybox',
Snackbar: undefined,
infinitegrid: {
js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid/dist/infinitegrid.min.js',
buttonText: '加载更多'
},
isPhotoFigcaption: false,
islazyload: true,
isAnchor: false,
percent: {
toc: true,
rightside: false,
},
autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
title: '页面没有找到',
isPost: false,
isHome: false,
isHighlightShrink: false,
isToc: false,
postUpdate: '2024-09-24 15:00:47'
}</script><script>(win=>{
win.saveToLocal = {
set: (key, value, ttl) => {
if (ttl === 0) return
const now = Date.now()
const expiry = now + ttl * 86400000
const item = {
value,
expiry
}
localStorage.setItem(key, JSON.stringify(item))
},

get: key => {
const itemStr = localStorage.getItem(key)

if (!itemStr) {
return undefined
}
const item = JSON.parse(itemStr)
const now = Date.now()

if (now > item.expiry) {
localStorage.removeItem(key)
return undefined
}
return item.value
}
}

win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
const script = document.createElement('script')
script.src = url
script.async = true
script.onerror = reject
script.onload = script.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
script.onload = script.onreadystatechange = null
resolve()
}

Object.keys(attr).forEach(key => {
script.setAttribute(key, attr[key])
})

document.head.appendChild(script)
})

win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = url
if (id) link.id = id
link.onerror = reject
link.onload = link.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
link.onload = link.onreadystatechange = null
resolve()
}
document.head.appendChild(link)
})

win.activateDarkMode = () => {
document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
}
}
win.activateLightMode = () => {
document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
}
}
const t = saveToLocal.get('theme')

if (t === 'dark') activateDarkMode()
else if (t === 'light') activateLightMode()

const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
if (asideStatus === 'hide') {
document.documentElement.classList.add('hide-aside')
} else {
document.documentElement.classList.remove('hide-aside')
}
}

const detectApple = () => {
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
document.documentElement.classList.add('apple')
}
}
detectApple()
})(window)</script><link rel="stylesheet" href="/css/background.css"><meta name="generator" content="Hexo 6.3.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src= "/img/loading.gif" data-lazy-src="/img/touxiang.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">0</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="error404" id="body-wrap"><header class="not-top-img" id="page-header"><nav id="nav"><span id="blog-info"><a href="/" title="h4m5t's Blog"><span class="site-name">h4m5t's Blog</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav></header><div id="error-wrap"><div class="error-content"><div class="error-img"><img src= "/img/loading.gif" data-lazy-src="https://i.loli.net/2020/05/19/aKOcLiyPl2JQdFD.png" alt="Page not found"></div><div class="error-info"><h1 class="error_title">404</h1><div class="error_subtitle">Page Not Found</div></div></div></div></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><div class="js-pjax"><script>(() => {
const $mermaid = document.querySelectorAll('#article-container .mermaid-wrap')
if ($mermaid.length === 0) return
const runMermaid = () => {
window.loadMermaid = true
const theme = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'default'

Array.from($mermaid).forEach((item, index) => {
const mermaidSrc = item.firstElementChild
const mermaidThemeConfig = '%%{init:{ \'theme\':\'' + theme + '\'}}%%\n'
const mermaidID = 'mermaid-' + index
const mermaidDefinition = mermaidThemeConfig + mermaidSrc.textContent

const renderFn = mermaid.render(mermaidID, mermaidDefinition)

const renderV10 = () => {
renderFn.then(({svg}) => {
mermaidSrc.insertAdjacentHTML('afterend', svg)
})
}

const renderV9 = svg => {
mermaidSrc.insertAdjacentHTML('afterend', svg)
}

typeof renderFn === 'string' ? renderV9(renderFn) : renderV10()
})
}

const loadMermaid = () => {
window.loadMermaid ? runMermaid() : getScript('https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js').then(runMermaid)
}

btf.addGlobalFn('themeChange', runMermaid, 'mermaid')

window.pjax ? loadMermaid() : document.addEventListener('DOMContentLoaded', loadMermaid)
})()</script></div><script id="canvas_nest" defer="defer" color="0,0,255" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-nest.min.js"></script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/click-heart.min.js" async="async" mobile="false"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> 数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js"></script></div></div></body></html>
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h4m5t.top
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# My Blog

> 记录一些博客配置和使用方面的问题。
生成和推送

```
hexo clean && hexo g && hexo d
```

提交的文件没有README.md

```
skip_render: README.md # 不把README.md解析为html
```

图片引用问题
```
最简单的是引用/img下的图片文件,但是如果图片太多,不方便管理。
为方便管理和引用,开启资源文件管理功能:当资源文件管理功能打开后,Hexo将会在你每一次通过 hexo new [layout] <title> 命令创建新文章时自动创建一个文件夹。这个资源文件夹将会有与这个文章文件一样的名字。将所有与你的文章有关的资源放在这个关联文件夹中之后,你可以通过相对路径来引用它们,这样你就得到了一个更简单而且方便得多的工作流。
方法一(没用):
网上都说安装这个插件,但是没用,最后卸载了。
npm install -g cnpm --registry=https://registry.npm.taobao.org
安装插件:cnpm install hexo-asset-image --save
参考:https://guguge.top/blog/butterfly/#%E6%9C%AC%E5%9C%B0%E5%9B%BE%E7%89%87%E5%BC%95%E7%94%A8%E9%97%AE%E9%A2%98
方法二(能用):
安装另外一个插件:npm install hexo-renderer-marked --save
启用后,资源图片将会被自动解析为其对应文章的路径。
例如: image.jpg 位置为 /2020/01/02/foo/image.jpg ,这表示它是 /2020/01/02/foo/ 文章的一张资源图片, ![](image.jpg) 将会被解析为 <img src="/2020/01/02/foo/image.jpg"> 。
参考:https://zhuanlan.zhihu.com/p/265077468
官方说法:https://hexo.io/docs/asset-folders.html
即最终结论:
安装hexo-renderer-marked
开启相关功能(_config.yml):
post_asset_folder: true #文章资源文件夹
marked:
prependRoot: true
postAsset: true
在md文章中,用以下两种方法引用图片:
![pic](1.jpg)
另一种方法有冲突,暂时删除。
```

域名访问问题

```
发现每次hexo g && hexo d之后,Custom domain会消失,导致404。
解决方法:在Source下创建CNAME文件可解决此问题。
```

多终端同步问题。

```
可使用两个不同的仓库或分支,比如main保存源文件,gh-pages保存生成后的文件。用Actions构建流。
```

16 changes: 16 additions & 0 deletions about/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: 个人介绍
date: 2022-11-30 22:43:51
top_img: /img/weini.jpg
---

### 关于我

+ 🌱 I’m a cyber-security student.
+ ⚡ I'm learning penetration testing.
+ ❤️ [My Blog](https://h4m5t.github.io/)

### 与我联系

Mail: [email protected]

6 changes: 6 additions & 0 deletions categories/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: categories
date: 2022-11-26 22:13:30
type: "categories"
top_img: /img/hello.png
---
25 changes: 25 additions & 0 deletions css/background.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* 文章页背景 */
.layout > div:first-child:not(.recent-posts) {
/* 以下代表白色透明度为0.3 */
background: rgba(255, 255, 255, 0.5);
}
/* 所有背景(包括首页卡片、文章页、页面页等) */
#recent-posts > .recent-post-item,
.layout > div:first-child:not(.recent-posts),
.layout_post > #page,
.layout_post > #post,
.read-mode .layout_post > #post {
/* 以下代表白色透明度为0.3 */
background: rgba(255, 255, 255, 0.5);
}

/* 背景渐变 */
#web_bg{
/*紫粉渐变*/
/*background-image: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);*/
/*粉白蓝*/
/*background-image: linear-gradient(-225deg, #dfbacd 0%, #B8DCFF 48%, #58abf3 100%);*/
/*background-image: linear-gradient(120deg, #89f7fe 0%, #66a6ff 100%);*/
/*background-image: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);*/
background-image: linear-gradient(to top, #fff1eb 0%, #ace0f9 100%);
}
Loading

0 comments on commit 5daf1b5

Please sign in to comment.