Skip to content

Commit 4b248bf

Browse files
DavidLiedleclaude
andcommitted
Fix: use file: prefix for inter-chapter org links
Bare [[chapter.org][text]] links are treated as fuzzy internal references by org-export, failing with "Unable to resolve link". Prefix with file: so org-html converts them to .html hrefs. Also explicitly set org-html-link-org-files-as-html t in publish.el, and simplify the workflow to a single clean emacs --batch invocation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 305f1e5 commit 4b248bf

File tree

3 files changed

+19
-37
lines changed

3 files changed

+19
-37
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,37 +22,17 @@ jobs:
2222
- name: Checkout repository
2323
uses: actions/checkout@v4
2424

25-
- name: Install Emacs and dependencies
25+
- name: Install Emacs
2626
run: |
2727
sudo apt-get update -qq
2828
sudo apt-get install -y --no-install-recommends \
2929
emacs-nox \
3030
elpa-htmlize
3131
32-
- name: Install Emacs packages (org, htmlize)
33-
run: |
34-
emacs --batch --eval "
35-
(require 'package)
36-
(add-to-list 'package-archives
37-
'(\"melpa\" . \"https://melpa.org/packages/\") t)
38-
(add-to-list 'package-archives
39-
'(\"gnu\" . \"https://elpa.gnu.org/packages/\") t)
40-
(package-initialize)
41-
(package-refresh-contents)
42-
(unless (package-installed-p 'htmlize)
43-
(package-install 'htmlize))
44-
(unless (package-installed-p 'org)
45-
(package-install 'org))"
46-
4732
- name: Build HTML book
4833
run: |
4934
mkdir -p public
50-
emacs --batch \
51-
--eval "(setq package-user-dir (expand-file-name \"~/.emacs.d/elpa\"))" \
52-
--eval "(require 'package)" \
53-
--eval "(package-initialize)" \
54-
-l publish.el \
55-
--funcall org-publish-all
35+
emacs --batch -l publish.el --funcall org-publish-all
5636
5737
- name: Setup GitHub Pages
5838
uses: actions/configure-pages@v4

index.org

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,43 +28,43 @@ This book takes you from complete beginner to confident Org-Mode user, covering:
2828

2929
* Table of Contents
3030

31-
** [[01-introduction.org][Chapter 1: Introduction]]
31+
** [[file:01-introduction.org][Chapter 1: Introduction]]
3232
Welcome to the Org-Mode rabbit hole. Learn what Org-Mode is, why plain text matters, and what makes this system different from every productivity app you've tried.
3333

34-
** [[02-getting-started.org][Chapter 2: Getting Started]]
34+
** [[file:02-getting-started.org][Chapter 2: Getting Started]]
3535
Install Emacs, create your first org file, and learn the five essential keybindings that will transform how you work with documents.
3636

37-
** [[03-document-structure.org][Chapter 3: Document Structure]]
37+
** [[file:03-document-structure.org][Chapter 3: Document Structure]]
3838
Master the art of the outline. Learn headings, lists, formatting, blocks, drawers, and the structural editing commands that make reorganization effortless.
3939

40-
** [[04-tables.org][Chapter 4: Tables]]
40+
** [[file:04-tables.org][Chapter 4: Tables]]
4141
Discover spreadsheets in plain text. Create tables with automatic formatting, write formulas, perform calculations, and generate reports—all without leaving your text file.
4242

43-
** [[05-links-and-images.org][Chapter 5: Links and Images]]
43+
** [[file:05-links-and-images.org][Chapter 5: Links and Images]]
4444
Connect your knowledge. Link to files, headings, URLs, emails, and custom destinations. Build an interconnected knowledge graph in plain text.
4545

46-
** [[06-todo-items.org][Chapter 6: TODO Items and Workflow]]
46+
** [[file:06-todo-items.org][Chapter 6: TODO Items and Workflow]]
4747
Transform headings into actionable tasks. Learn custom TODO states, priorities, scheduling, deadlines, repeating tasks, and effort estimation.
4848

49-
** [[07-tags-and-properties.org][Chapter 7: Tags and Properties]]
49+
** [[file:07-tags-and-properties.org][Chapter 7: Tags and Properties]]
5050
Add the metadata layer. Tag and categorize your tasks, attach structured properties, and make everything searchable and filterable.
5151

52-
** [[08-agenda-views.org][Chapter 8: Agenda Views]]
52+
** [[file:08-agenda-views.org][Chapter 8: Agenda Views]]
5353
Build mission control for your life. Aggregate tasks across files, create custom views, filter dynamically, and act on items without leaving the agenda.
5454

55-
** [[09-clocking-time-tracking.org][Chapter 9: Clocking and Time Tracking]]
55+
** [[file:09-clocking-time-tracking.org][Chapter 9: Clocking and Time Tracking]]
5656
Track where your time actually goes. Clock in and out of tasks, generate reports, compare estimates to actuals, and turn time logs into invoices.
5757

58-
** [[10-capture-templates.org][Chapter 10: Capture Templates]]
58+
** [[file:10-capture-templates.org][Chapter 10: Capture Templates]]
5959
Implement frictionless note-taking. Create templates for common patterns, capture from anywhere, and ensure no thought is ever lost.
6060

61-
** [[11-code-blocks-literate-programming.org][Chapter 11: Code Blocks and Literate Programming]]
61+
** [[file:11-code-blocks-literate-programming.org][Chapter 11: Code Blocks and Literate Programming]]
6262
Make your documents executable. Run code in dozens of languages, pass data between blocks, generate graphics, and practice true literate programming.
6363

64-
** [[12-export-publishing.org][Chapter 12: Export and Publishing]]
64+
** [[file:12-export-publishing.org][Chapter 12: Export and Publishing]]
6565
Share your work with the world. Export to HTML, PDF, Markdown, ODT, and more. Publish websites from org files. One source, infinite presentations.
6666

67-
** [[13-advanced-features.org][Chapter 13: Advanced Features]]
67+
** [[file:13-advanced-features.org][Chapter 13: Advanced Features]]
6868
Explore the depths. Learn advanced agenda techniques, encryption, attachments, the Org ecosystem, integrations, and the features that make Org-Mode inexhaustible.
6969

7070
* Who This Book Is For
@@ -146,7 +146,7 @@ Your first week will feel awkward. Your first month will feel productive. Your f
146146

147147
Ready?
148148

149-
Start with [[01-introduction.org][Chapter 1: Introduction]].
149+
Start with [[file:01-introduction.org][Chapter 1: Introduction]].
150150

151151
-----
152152

publish.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
org-export-with-sub-superscripts nil
2020
;; Never evaluate code blocks during export — this is a book,
2121
;; not a notebook. Blocks are displayed verbatim.
22-
org-export-use-babel nil)
22+
org-export-use-babel nil
23+
;; Convert file:chapter.org links → chapter.html in HTML export
24+
org-html-link-org-files-as-html t)
2325

2426
;; Use htmlize for syntax highlighting when available
2527
(when (require 'htmlize nil t)

0 commit comments

Comments
 (0)