从头开始安装

从头开始使用 HB 卡主题构建快速、响应式和模块化静态网站。

我们提供了一个示例站点以方便你快速入门该主题。

环境要求§

  • Go
  • Hugo 扩展版
  • Node.js 16 或更高版本

了解更多关于先决条件的内容。

克隆仓库§

1git clone --depth 1 https://github.com/hbstack/theme-cards
sh

复制示例站点§

1cp -r theme-cards/exampleSite mysite
sh

更改工作目录§

1cd mysite
sh

调整 go.mod§

替换模块路径§

模块路径是站点的标识,其一般为仓库 URL,这里以 github.com/user/repo 为例,则需要将 module github.com/hbstack/theme-cards/exampleSite 替换为 module github.com/user/repo

1sed -i '1s/.*/module github.com\/user\/repo/' go.mod
sh

删除 replace 指令§

为了成功地构建站点,需要删除该内部使用的 replace 指令行:replace github.com/hbstack/theme-cards => ../

1sed -i '/^replace/d' go.mod
sh

安装依赖§

1npm ci
sh

Hugo 模块代理(可选)§

当你的所在地区(比如国内)无法访问默认的代理时,则需要设置Hugo 模块代理

本地预览§

1npm run dev
sh

接下来做什么?§

  1. 调整配置,如 baseURLgiscus.* 等。
  2. 删除测试内容。
  3. 阅读文档
  4. 找寻更多模块
  • 全部
  • English
  • 한국어
  • 简体中文
  • 最佳匹配
  • 最旧的
  • 最新的
  • Big Data
  • DevOps
  • JAVA
  • Mac
  • NoSQL
  • RDB
  • Shell
  • Web
  • 주절주절
  • Content
  • 内容
  • Java Collections
  • Docs
  • Examples
  • Notes
  • Releases
  • 发布
  • 文档
  • 示例
  • 笔记
  • Apache Spark
  • AZURE
  • Bash
  • CodeIgniter
  • Command Line Tools
  • CSV
  • Docker
  • Git
  • Github pages
  • Homebrew
  • Humor
  • IDE
  • IntelliJ IDEA
  • JAVA String
  • JAVA17
  • List
  • macOS
  • MySQL
  • PHP
  • Redis
  • Script
  • SDKMAN
  • Set
  • Shell
  • Spring Boot
  • Terminal
  • TRY-CATCH
  • Windows
  • Charts
  • Diagrams
  • Images
  • Installation
  • KaTeX
  • Layouts
  • Math
  • Mermaid
  • Migration
  • 图片
  • 图表
  • 安装
  • 布局
  • 数学
  • 迁移