Skip to content

Commit 5cd4dba

Browse files
maestroclaude
andcommitted
Migrate from PaperMod to FixIt theme for sidebar ToC
- Removed PaperMod theme submodule - Added FixIt theme (v0.3.X) as Git submodule - Migrated config.toml to FixIt format - Configured sidebar table of contents (position: right) - Added PostHog analytics integration via custom-head block - Enabled search (Fuse.js), syntax highlighting, dark mode - All 35 posts preserved and working Benefits: - Native sidebar ToC for long-form technical articles - Auto-expanding ToC based on scroll position - Better navigation for readers - Modern, feature-rich theme - Built-in search functionality Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e96cad9 commit 5cd4dba

7 files changed

Lines changed: 232 additions & 20 deletions

File tree

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "themes/PaperMod"]
2-
path = themes/PaperMod
3-
url = https://github.com/adityatelange/hugo-PaperMod.git
1+
[submodule "themes/FixIt"]
2+
path = themes/FixIt
3+
url = https://github.com/hugo-fixit/FixIt.git

assets/jsconfig.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": ".",
4+
"paths": {
5+
"*": [
6+
"../themes/FixIt/assets/*"
7+
]
8+
}
9+
}
10+
}

config.toml

Lines changed: 172 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,199 @@
1+
# Hugo FixIt Configuration for Kit's Blog
2+
# https://fixit.lruihao.cn/documentation/getting-started/configuration/
3+
14
baseURL = "https://elcukro.github.io/"
25
languageCode = "en-us"
36
title = "Kit's Blog"
4-
theme = "PaperMod"
7+
theme = "FixIt"
8+
9+
# Enable emoji
10+
enableEmoji = true
11+
# Enable robots.txt
12+
enableRobotsTXT = true
13+
# Enable Git info
14+
enableGitInfo = true
515

616
[params]
17+
# FixIt theme version
18+
version = "0.3.X"
19+
# Site description for SEO
720
description = "AI assistant with a body - building in public"
8-
author = "Kit"
9-
ShowCodeCopyButtons = true
10-
ShowToc = true
11-
TocOpen = false
12-
ShowReadingTime = true
13-
ShowShareButtons = true
14-
ShowPostNavLinks = true
21+
# Site keywords
22+
keywords = ["AI", "automation", "agentic coding", "Claude", "technical blog"]
23+
# Default theme ("light", "dark", "auto")
24+
defaultTheme = "auto"
25+
# Date format
26+
dateFormat = "2006-01-02"
27+
28+
# PostHog Analytics (custom integration)
1529
posthog_key = "phc_A4C6XITRh9jQlIG8F4TH5M0zug8Kul6GOzEJ6kDwEIz"
30+
posthog_host = "https://eu.i.posthog.com"
31+
32+
# Author config
33+
[params.author]
34+
name = "Kit"
35+
email = ""
36+
link = "https://elcukro.github.io"
37+
avatar = ""
38+
39+
# Header config
40+
[params.header]
41+
# Desktop header mode ("sticky", "normal", "auto")
42+
desktopMode = "sticky"
43+
# Mobile header mode ("sticky", "normal", "auto")
44+
mobileMode = "auto"
45+
# Header title config
46+
[params.header.title]
47+
# Logo
48+
logo = ""
49+
# Title name
50+
name = "Kit's Blog"
51+
# You can add extra information before the name (HTML format is supported), such as icons
52+
pre = ""
53+
# You can add extra information after the name (HTML format is supported), such as icons
54+
post = ""
55+
# Whether to use typeit animation for title name
56+
typeit = false
57+
58+
# Footer config
59+
[params.footer]
60+
enable = true
61+
# Custom content (HTML format is supported)
62+
custom = ""
63+
# Whether to show Hugo and theme info
64+
hugo = false
65+
# Whether to show copyright info
66+
copyright = true
67+
# Whether to show the author
68+
author = true
69+
# Site creation year
70+
since = 2024
71+
# Public network security only in China (HTML format is supported)
72+
gov = ""
73+
# ICP info only in China (HTML format is supported)
74+
icp = ""
75+
# License info (HTML format is supported)
76+
license = ""
77+
78+
# Page config
79+
[params.page]
80+
# Whether to enable the author's avatar
81+
authorAvatar = false
82+
# Whether to show the last update time
83+
lastUpdated = true
84+
# Whether to show the reading time
85+
readingTime = true
86+
# Whether to show the word count
87+
wordCount = true
88+
89+
# Table of Contents config
90+
[params.page.toc]
91+
# Whether to enable the table of contents
92+
enable = true
93+
# Whether to keep the static table of contents in front of the post
94+
keepStatic = false
95+
# Whether to make the table of contents automatically collapse
96+
auto = true
97+
# FixIt 0.2.13 | NEW Position of the table of contents ("left" or "right")
98+
position = "right"
99+
100+
# Code config
101+
[params.page.code]
102+
# Whether to show the copy button of the code block
103+
copy = true
104+
# Maximum number of lines of displayed code by default
105+
maxShownLines = 20
106+
107+
# Social share links
108+
[params.share]
109+
enable = true
110+
Twitter = true
111+
Facebook = false
112+
Linkedin = false
113+
Reddit = true
114+
HackerNews = true
16115

116+
# Search config
117+
[params.search]
118+
enable = true
119+
# Type of search engine ("lunr", "algolia", "fuse")
120+
type = "fuse"
121+
# Max index length of the chunked content
122+
contentLength = 4000
123+
# Placeholder of the search bar
124+
placeholder = ""
125+
# Max number of results length
126+
maxResultLength = 10
127+
# Snippet length of the result
128+
snippetLength = 30
129+
# HTML tag name of the highlight part in results
130+
highlightTag = "em"
131+
# Whether to use the absolute URL based on the baseURL in search index
132+
absoluteURL = false
133+
[params.search.fuse]
134+
# FixIt 0.2.17 | NEW https://fusejs.io/api/options.html
135+
isCaseSensitive = false
136+
minMatchCharLength = 2
137+
findAllMatches = false
138+
location = 0
139+
threshold = 0.3
140+
distance = 100
141+
ignoreLocation = false
142+
useExtendedSearch = false
143+
ignoreFieldNorm = false
144+
145+
# Menu config
17146
[menu]
18147
[[menu.main]]
148+
identifier = "posts"
19149
name = "Posts"
20150
url = "/posts/"
21151
weight = 1
152+
[menu.main.params]
153+
icon = "fa-solid fa-file-lines"
154+
22155
[[menu.main]]
156+
identifier = "archives"
23157
name = "Archive"
24158
url = "/archives/"
25159
weight = 2
160+
[menu.main.params]
161+
icon = "fa-solid fa-archive"
162+
26163
[[menu.main]]
164+
identifier = "search"
27165
name = "Search"
28166
url = "/search/"
29167
weight = 3
168+
[menu.main.params]
169+
icon = "fa-solid fa-magnifying-glass"
30170

31-
[outputs]
32-
home = ["HTML", "RSS", "JSON"]
33-
171+
# Markup config
34172
[markup]
173+
# Syntax highlighting config
35174
[markup.highlight]
36175
style = "monokai"
37176
lineNos = true
38177
lineNumbersInTable = false
178+
noClasses = false
179+
# Goldmark is from Hugo 0.60 the default library used for Markdown
180+
[markup.goldmark]
181+
[markup.goldmark.extensions]
182+
definitionList = true
183+
footnote = true
184+
linkify = true
185+
strikethrough = true
186+
table = true
187+
taskList = true
188+
typographer = true
189+
[markup.goldmark.renderer]
190+
# Whether to use HTML tags directly in the document
191+
unsafe = true
192+
# Table of contents settings
193+
[markup.tableOfContents]
194+
startLevel = 2
195+
endLevel = 6
196+
197+
# Output formats
198+
[outputs]
199+
home = ["HTML", "RSS", "JSON"]

layouts/_default/baseof.html

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{{- partial "init/index.html" . -}}
2+
3+
<!DOCTYPE html>
4+
<html itemscope itemtype="http://schema.org/WebPage" lang="{{ .Site.LanguageCode }}">
5+
<head>
6+
{{- if .IsHome | and (ne .Site.Params.disableThemeInject true) }}
7+
<meta name="theme" content='FixIt {{ hugo.Store.Get "version" }}'>
8+
{{- end }}
9+
<meta charset="utf-8">
10+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
11+
<meta name="robots" content="noodp" />
12+
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
13+
14+
{{- partial "head/meta.html" . -}}
15+
{{- partial "head/link.html" . -}}
16+
{{- partial "head/seo.html" . -}}
17+
{{- partial "head/script.html" . -}}
18+
{{- /* TODO preload script https://developer.mozilla.org/zh-CN/docs/Web/HTML/Attributes/rel/preload */ -}}
19+
{{- /* Custom head */ -}}
20+
{{- block "custom-head" . }}
21+
<!-- PostHog Analytics -->
22+
<script>
23+
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys onSessionId".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
24+
posthog.init('{{ .Site.Params.posthog_key }}', {api_host: '{{ .Site.Params.posthog_host }}'})
25+
</script>
26+
{{ end -}}
27+
</head>
28+
<body data-instant-intensity="viewport" data-header-desktop="{{ .Site.Params.header.desktopMode }}" data-header-mobile="{{ .Site.Params.header.mobileMode }}">
29+
{{- /* Body wrapper */ -}}
30+
<div class="wrapper" data-page-style="{{ (partial `function/params.html`).pageStyle | default `normal` }}">
31+
{{- partial "header.html" . -}}
32+
{{- partial "breadcrumb.html" . -}}
33+
{{- $toc := .Store.Get "toc" -}}
34+
<main class="fi-container"{{ if (eq $toc.enable true) | and (eq $toc.position `left`) }} data-reverse{{ end }}>
35+
{{- block "content" . }}{{ end -}}
36+
</main>
37+
{{- partialCached "footer.html" . -}}
38+
</div>
39+
40+
{{- /* Theme widgets */ -}}
41+
{{- partial "widgets.html" . -}}
42+
43+
{{- /* Load JavaScript scripts and CSS */ -}}
44+
{{- partial "assets.html" . -}}
45+
</body>
46+
</html>

layouts/partials/extend_head.html

Lines changed: 0 additions & 5 deletions
This file was deleted.

themes/FixIt

Submodule FixIt added at 9e946c6

themes/PaperMod

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)