Skip to content
JoffooPublic

About

Hacker is a minimalist and elegant Hexo theme focused on optimizing writing and reading experiences, featuring responsive design, dark mode, code highlighting, article directory, and multi-comment system support.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

Repository files navigation

Hexo Theme Hacker

This theme is based on CodeDaraW/Hacker

中文说明

A simple, elegant Hexo theme focused on writing and reading experience. Demo: fengyukongzhou.github.io

Preview

Hacker Theme Preview

Features

  • 🎨 Minimalist design, content-focused
  • 📱 Responsive layout with dark mode support for mobile devices
  • 💡 Code highlighting support
  • 📑 Article table of contents
  • ❤️ Article like button
  • 💬 Multiple comment systems support
  • 📊 Google Analytics and Baidu Statistics support
  • 📝 MathJax support
  • 📈 Integrated hexo-graph data visualization
  • 🖋 Elegant typography with special handling for Chinese/English italics
  • 📌 Beautiful blockquote design with different citation styles for Chinese and English
  • ⬆️ Convenient back-to-top button for enhanced browsing experience

Quick Start

Prerequisites

Install required plugins:

# Install hexo-graph plugin for data visualization
npm install hexo-graph

# Or using yarn
yarn add hexo-graph

# Or using pnpm
pnpm add hexo-graph

Installation

git clone https://github.com/fengyukongzhou/Hacker.git themes/hacker

Configuration

  1. Modify _config.yml in your Hexo root directory:
theme: hacker
  1. Create and edit the theme configuration file by referring to _config.example.yml:
cp themes/hacker/_config.example.yml themes/hacker/_config.yml
  1. Modify the theme configuration file themes/hacker/_config.yml as needed

Update Theme

cd themes/hacker
git pull

Configuration Guide

Basic Configuration

Navigation Menu

Configure the website navigation menu items. You can customize and add the links you need.

menu:
  Home: /
  Archives: /archives
  Categories: /categories
  Tags: /tags

Website Favicon

The theme supports comprehensive favicon configuration for various devices. You can use favicon.io to generate the required icon files online. After generation, place all files in the source/favicon_io directory.

Supported icon files include:

  • android-chrome-192x192.png
  • android-chrome-512x512.png
  • apple-touch-icon.png
  • favicon-16x16.png
  • favicon-32x32.png
  • favicon.ico
  • site.webmanifest

Configuration example:

favicon:
  enable: true
  icon: /favicon_io/favicon.ico
  apple_touch_icon: /favicon_io/apple-touch-icon.png
  android_chrome_icon: /favicon_io/android-chrome-192x192.png
  manifest: /favicon_io/site.webmanifest

Read More Button

Control whether to display the "Read More" button in the article list.

read_more_btn: false

MathJax Support

Enable MathJax to support mathematical formula rendering.

mathjax:
  enable: true
  cdn: https://cdn.jsdelivr.net/npm/mathjax@2.7.8/MathJax.js?config=TeX-AMS-MML_HTMLorMML

Table of Contents

Configure whether to display article table of contents and numbering.

toc:
  enable: true
  number: true

Comment Systems

Supports multiple comment systems:

  • Gitalk
  • Gitment
  • Valine
  • Disqus
  • Utterances
  • Livere
  • Giscus

Analytics

Supports Google Analytics and Baidu Statistics. Just fill in the corresponding tracking ID in the configuration file.

Like Button

Article like button feature based on LeanCloud, requires configuration:

like_button:
  enable: true
  appId: your-app-id
  appKey: your-app-key
  serverURL: your-server-url

Back to Top Button

The theme includes a convenient back-to-top button that automatically appears when the page is scrolled beyond a certain distance. Clicking it smoothly scrolls back to the top of the page. The button design is consistent with the dark mode toggle button, providing a cohesive visual experience.

  • Auto show/hide: Appears when the page is scrolled beyond 300 pixels
  • Smooth scrolling: Smoothly returns to the top of the page when clicked
  • Responsive design: Adapts to various device screens
  • Dark mode compatible: Automatically adapts to dark/light themes

Blockquotes

The theme provides beautifully designed blockquotes with support for different citation styles in Chinese and English environments.

Basic Usage

> This is a quoted text.
> 
> This is the second paragraph of the quote.

Adding Citation Sources

Blockquotes support adding citation sources, which will be displayed at the bottom right of the blockquote. The dash style will automatically adapt based on the language:

English Environment (using single em dash):

> This is an English quote.
> 
> <footer lang="en">Source</footer>

Chinese Environment (using double em dash):

> 这是一段中文引用。
> 
> <footer lang="zh">引用来源</footer>

You can also use the <cite> tag instead of the <footer> tag:

> This is a quoted text.
> 
> <cite lang="en">Source</cite>

Blockquote Style Features

  • Beautiful visual design, including quotation mark decoration and gradient bottom border
  • Hover effect, where the blockquote slightly rises and increases shadow
  • Dark mode compatible, with excellent display in different themes
  • Automatically adjusts dash style based on language environment: English uses single em dash (—), Chinese uses double em dash (——)

Contributing

Issues and Pull Requests are welcome.

License

MIT License

About

Hacker is a minimalist and elegant Hexo theme focused on optimizing writing and reading experiences, featuring responsive design, dark mode, code highlighting, article directory, and multi-comment system support.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages