cSh4rk/cSh4rk.github.io
GitHub: cSh4rk/cSh4rk.github.io
一个面向网络安全从业者的开源 Jekyll 博客主题,采用赛博朋克美学设计,具备完整的自动化构建流程和隐私优先理念。
Stars: 2 | Forks: 0
本仓库托管我的个人网站 **https://nima.ninja**,这是一个用于分享实用网络安全、技术和个人成长的数字日记和知识中心。
该网站分为三个主要部分:
- 博客:关于技术、网络安全、个人成长等的实用见解、教程和笔记。
- 书籍:精心策划的书籍推荐,涵盖技术、网络安全、科学、个人成长和其他实用学习主题。
- 链接:精心策划的关于技术、网络安全、生产力和生活的网络资源,旨在帮助你学习、成长并保持灵感。
该网站具有以下特点:
- 完全开源 —— 主题可重复使用
- 注重隐私 —— 默认不跟踪
- 极速加载 —— 优化的构建和关键 CSS
- 响应式设计 —— 兼容移动端和桌面端
- SEO 友好 —— 结构化设计便于发现
它由 CyberShark Edition(Jekyll Hacker Theme 的自定义增强版本)提供支持,将极简黑客美学与现代功能、赛博朋克霓虹风格和对开发者友好的优化相结合。
## 技术概述
- Jekyll —— 快速的静态站点生成器
- Ruby —— Jekyll 的编程语言
- GitHub Pages —— 托管平台
- Cloudflare —— 用于性能和保护的 CDN 及安全层
- 现代赛博朋克/霓虹美学
- 对开发者友好的功能:分页、目录、自动 RSS、智能图片处理
该网站使用了 `jekyll-seo-tag`、`jekyll-paginate`、`jekyll-sitemap`、`jekyll-toc` 等 Jekyll 插件以优化功能。
## 使用方法 / 本地构建与部署说明
你可以在本地预览更改、运行完整的自动化构建管道,并将站点部署到 `gh-pages`。该站点使用 Jekyll 进行静态站点生成,使用 PostCSS 和 PurgeCSS 优化 CSS,内联关键 CSS,并通过 npm 脚本进行 JS 压缩。
### 0. 克隆仓库
```
git clone https://github.com/cSh4rk/cSh4rk.github.io.git
#### cd nima.ninja
### 1. 安装依赖
```bash
bundle install # Install Ruby gems (including Jekyll)
#### npm install # 安装 Node 依赖
### 2. 本地预览更改
To see your changes live before final build:
```bash
#### bundle exec jekyll serve
- Access the site at `http://127.0.0.1:4000`.
- Make edits, then refresh the page to preview updates.
Note: Local preview rewrites URLs to `127.0.0.1`, so do not use this version for final deployment.
### 3. 构建网站
Run the full automated build pipeline:
```bash
#### npm run build
This will:
- Generate `README.md` from `README.template.md` by replacing placeholders like `LAST_UPDATED`, `RUBY_VERSION`, `JEKYLL_VERSION`, `NODE_VERSION`, and `NPM_VERSION` with real values. Do not edit `README.md` directly — only edit `README.template.md`.
- Build the site with Jekyll (first pass).
- Remove unused CSS via PostCSS + PurgeCSS.
- Save a temp copy of minified PurgeCSS-generated CSS so it can be restored later.
- Generate critical CSS for home, posts, and pages (mobile, tablet, desktop).
- Minify inline JS scripts.
- Rebuild Jekyll site (second pass) to inject critical CSS and inline JS.
- Minify JS files.
- Restore the full PurgeCSS-generated CSS to the `_site` folder.
After the build completes, the fully optimized site is ready in `_site` and can be deployed.
### 4. 部署到 `gh-pages` 分支
```powershell
# 切换到 gh-pages 分支
git checkout gh-pages
# 确保 .gitignore 仅包含:
# _site/, CNAME, node_modules/, .jekyll-cache/
git add .gitignore
git commit -m "Fix .gitignore for gh-pages"
# 清理分支根目录,同时保留 .git, .gitignore, node_modules 和 _site
Get-ChildItem -Force | Where-Object {
$_.Name -notin @('.git', '.gitignore', 'node_modules', '_site')
} | Remove-Item -Recurse -Force
# 可选:移除临时 Jekyll 缓存(如果存在)
if (Test-Path ".jekyll-cache") { Remove-Item -Recurse -Force .jekyll-cache }
# 将全新构建的 _site 内容复制到仓库根目录
robocopy "_site" "." /E
# 暂存所有更改
git add .
# 可选:显示已暂存的更改
git status
# 如果有更改,自动提交并推送
if (-not (git diff --cached --quiet)) {
git commit -m "Update site from _site"
git push origin gh-pages
} else {
Write-Output "No changes to commit. Nothing to push."
#### }
# 关于主题:The Hacker Theme, CyberShark Edition 🦈 CyberShark Edition is a fully open-source, enhanced version of [the Hacker theme](https://github.com/pages-themes/hacker) and [the Hacker-Blog theme](https://github.com/tocttou/hacker-blog). It introduces multiple improvements while preserving the minimalistic, hacker-friendly design: ## 主要特性 - ✔ Multiple post categories (Blog, Books, Links, or more). - ✔ Post tags with counts display. - ✔ Site footer with social media links: Discord, GitHub, X, Mastodon, and optional TryHackMe and HackTheBox profile badges, configurable via `_config.yml`. - ✔ Show updated date in posts in addition to published date. - ✔ Smart image format selector plugin: AVIF → WebP → original format, with customizable attributes (`width`, `height`, `alt`, `loading`, `fetchpriority`, `first_format`, `decoding`, `classname`). - ✔ Expanded page styles: hover effects, fragment highlight animations, responsive classes, and more. - ✔ Fully automated local build pipeline: PurgeCSS for CSS, Terser for JS, custom PostCSS for pre-Critical CSS sanitizing, Critical CSS inlining for multiple layouts/viewports. - ✔ Favicon automatically chosen based on device. - ✔ Fixed and completed RSS feed. - ✔ Modern Cyberpunk neon navigation buttons. - ✔ security.txt file with automated expire date update. - ✔ SEO and accessibility improvements: ARIA attributes, robots rules, pagination, smooth fragment scroll. - ✔ Jekyll plugin to remove deprecated ARIA roles from footnotes. - ✔ Back to Top button for scrolled pages. - ✔ Particles effect with customizable color palettes. - ✔ Automatic Table of Contents with selectable placement per post. - ✔ Accessible, responsive pagination with uniform buttons and neon glow. All changes are made with ❤. Feel free to use this theme for your own projects.
# 许可证 [](https://creativecommons.org/publicdomain/zero/1.0/) [](https://creativecommons.org/licenses/by/4.0/) - **Templates & website code (including modifications to CC0-based Hacker Theme derivatives):** [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/) — free to use, modify, and redistribute with no obligations. - **Posts, Articles & Tutorials (all topics):** [CC BY 4.0 International](https://creativecommons.org/licenses/by/4.0/) — free to use, modify, and redistribute **with attribution to Nima**. - **Third-party resources:** retain their original licenses; see references in posts, pages, or code files. ```
# 关于主题:The Hacker Theme, CyberShark Edition 🦈 CyberShark Edition is a fully open-source, enhanced version of [the Hacker theme](https://github.com/pages-themes/hacker) and [the Hacker-Blog theme](https://github.com/tocttou/hacker-blog). It introduces multiple improvements while preserving the minimalistic, hacker-friendly design: ## 主要特性 - ✔ Multiple post categories (Blog, Books, Links, or more). - ✔ Post tags with counts display. - ✔ Site footer with social media links: Discord, GitHub, X, Mastodon, and optional TryHackMe and HackTheBox profile badges, configurable via `_config.yml`. - ✔ Show updated date in posts in addition to published date. - ✔ Smart image format selector plugin: AVIF → WebP → original format, with customizable attributes (`width`, `height`, `alt`, `loading`, `fetchpriority`, `first_format`, `decoding`, `classname`). - ✔ Expanded page styles: hover effects, fragment highlight animations, responsive classes, and more. - ✔ Fully automated local build pipeline: PurgeCSS for CSS, Terser for JS, custom PostCSS for pre-Critical CSS sanitizing, Critical CSS inlining for multiple layouts/viewports. - ✔ Favicon automatically chosen based on device. - ✔ Fixed and completed RSS feed. - ✔ Modern Cyberpunk neon navigation buttons. - ✔ security.txt file with automated expire date update. - ✔ SEO and accessibility improvements: ARIA attributes, robots rules, pagination, smooth fragment scroll. - ✔ Jekyll plugin to remove deprecated ARIA roles from footnotes. - ✔ Back to Top button for scrolled pages. - ✔ Particles effect with customizable color palettes. - ✔ Automatic Table of Contents with selectable placement per post. - ✔ Accessible, responsive pagination with uniform buttons and neon glow. All changes are made with ❤. Feel free to use this theme for your own projects.
# 许可证 [](https://creativecommons.org/publicdomain/zero/1.0/) [](https://creativecommons.org/licenses/by/4.0/) - **Templates & website code (including modifications to CC0-based Hacker Theme derivatives):** [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/) — free to use, modify, and redistribute with no obligations. - **Posts, Articles & Tutorials (all topics):** [CC BY 4.0 International](https://creativecommons.org/licenses/by/4.0/) — free to use, modify, and redistribute **with attribution to Nima**. - **Third-party resources:** retain their original licenses; see references in posts, pages, or code files. ```
标签:CyberShark, GitHub Pages, Jekyll, MITM代理, Ruby, SEO优化, 个人品牌, 个人网站, 博客系统, 响应式设计, 开发者日记, 开源主题, 暗色界面, 现代忍者, 知识库, 网站模板, 网络安全, 网络安全, 赛博朋克, 隐私保护, 隐私保护, 静态网站生成器, 黑客美学