Skip to content

ac1965/ac1965.github.io

Repository files navigation

No Good Father

Hugo + Blowfish テーマで構築された個人ブログ

Emacs の Org-modeox-hugo により記事を作成

目次

Requirements

ツールバージョン備考
Hugo≥ 0.141.0 extendedbrew install hugo
Git任意submodule 管理用
Emacs≥ 29記事執筆用
ox-hugo最新Org → Hugo Markdown
mmdc任意Mermaid 図の生成

Installation

1. Hugo サイトの作成

hugo new site mysite
cd mysite
git init

2. Blowfish テーマを submodule として追加

git submodule add -b main https://github.com/nunocoracao/blowfish.git themes/blowfish

3. テーマ設定ファイルのコピー

cp themes/blowfish/config/_default/* config/_default/

4. Emacs パッケージのインストール

straight.el を利用(~orgx/orgx-export.el~ で設定済み)

M-x straight-pull-all

ox-hugo がロードされていることを確認

M-: (featurep 'ox-hugo)  ; => t

Submodule 管理

Blowfish テーマは Git submodule として管理されています。 リポジトリを clone した直後や、テーマ更新時は以下を実行します。

初回 clone 時(submodule を含める)

git clone --recursive https://github.com/<your-repo>.git
cd <your-repo>

すでに clone 済みの場合:

git submodule update --init --recursive

Submodule を最新に更新

Blowfish テーマを upstream の最新に更新する場合:

git submodule update --remote --merge themes/blowfish

更新後は必ずコミットします:

git add themes/blowfish
git commit -m "chore: update blowfish theme"

すべての submodule を更新

git submodule update --remote --recursive

Submodule 状態確認

git submodule status

Submodule を強制的に同期

リモートURL変更などがあった場合:

git submodule sync --recursive
git submodule update --init --recursive

よくあるトラブル対処

submodule が壊れた場合:

git submodule deinit -f themes/blowfish
rm -rf .git/modules/themes/blowfish
git submodule update --init --recursive

Writing Workflow

すべての記事は Org-mode で作成し、ox-hugo により Markdown へ変換されます。

ディレクトリ構成

content-org/
├── about.org
└── posts/
    └── my-post.org

content/ (ox-hugo により生成・手動編集しない)
├── about/
│   └── index.md
└── post/
    └── my-post/
        └── index.md

Org ファイル Front Matter 例

#+TITLE: My Post Title
#+DATE: <2026-03-15>
#+HUGO_BASE_DIR: <HUGO_BASE_DIR>
#+HUGO_SECTION: post
#+HUGO_TAGS: hugo emacs
#+HUGO_CATEGORIES: tech

Export コマンド

操作キーバインド説明
新規投稿作成C-c c borg-capture で投稿作成
サブツリー exportC-c C-e H H現在 subtree を export
全体 exportC-c C-e H AOrg ファイル全体 export

Local Development

開発サーバ起動(draft 含む)

hugo server --buildDrafts --disableFastRender

Open: http://localhost:1313

Blowfish テーマ更新

git submodule update --remote --merge themes/blowfish
git add themes/blowfish
git commit -m "chore: update blowfish theme"

よく使う Hugo コマンド

# 本番ビルド
hugo

# リンクチェック
hugo --gc --minify

# バージョン確認
hugo version

Configuration

設定ファイルは config/_default/ に配置

ファイル用途
hugo.tomlサイト全体設定
params.tomlBlowfish テーマ設定
languages.en.toml言語・著者情報
menus.en.tomlナビゲーション
markup.tomlMarkdown / syntax highlight
module.tomlHugo module

Deploy

GitHub Actions

# .github/workflows/deploy.yml
- uses: actions/checkout@v4
  with:
    submodules: true
    fetch-depth: 0

- name: Setup Hugo
  uses: peaceiris/actions-hugo@v3
  with:
    hugo-version: '0.157.0'
    extended: true

- name: Build
  run: hugo --minify

手動ビルド

hugo --minify
# 出力先: ./public/

License

Content © YAMASHITA, Takao. All rights reserved. Theme: Blowfish — MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors