# How to insert footnotes: The Org website\[1\] now looks a lot better than it used to. # Resources: # Extra snippets of code: ``` commonlisp ;; Commented out things: ;; (defvar z-head ;; " ;; ") ;; (setq org-html-validation-link nil ;; org-html-head-include-scripts nil ;; org-html-head-include-default-style nil ;; org-html-head z-head) ;; (type-of (car '(rose violet daisy buttercup))) ;; (cadr (assoc "FILETAGS" (org-collect-keywords '("FILETAGS")))) ;; (let ((list '(("post1.org") ("post2.org")))) ;; (mapconcat (lambda (entry) ;; (format "- [[file:%s]]" (car entry))) ;; list ;; "\n")) ;; ("website" ;; :components ("org-main" "org-categories-sitemap" "org-assets" "org-posts" "org-blogs" "org-static")) ;; :html-head " ;; ;; ;; ;; " (defun z/write-tag-pages () "Generate tags/*.org pages listing posts for each tag." (let* ((site-root (expand-file-name "~/master-folder/org_files/org_web/")) (tags-dir (expand-file-name "tags" site-root))) (unless (file-directory-p tags-dir) (make-directory tags-dir t)) (let ((idx (z/gather-tag-index))) (maphash (lambda (tag items) (let* ((slug (z/tag-slug tag)) (outfile (expand-file-name (format "%s.org" slug) tags-dir))) (with-temp-file outfile (insert (format "#+TITLE: Tag: %s\n#+OPTIONS: toc:nil num:nil title:nil \n\n* Posts tagged %s\n" tag tag)) ;; sort newest first if DATE present (setq items (sort items (lambda (a b) (string> (nth 2 a) (nth 2 b))))) (dolist (it items) (let* ((file (nth 0 it)) (title (nth 1 it)) (rel (file-relative-name file tags-dir))) ;; link to the source .org; org-publish will rewrite to the .html (insert (format "- [[file:%s][%s]]\n" rel title))))))) idx) ;; Also write an index page listing all tag pages ;; (let* ((all ())) ;; (maphash (lambda (tag _items) (push tag all)) (z/gather-tag-index)) ;; (with-temp-file (expand-file-name "index.org" (expand-file-name "tags" site-root)) ;; (insert "#+TITLE: All Tags\n#+OPTIONS: toc:nil num:nil\n\n* Tags\n") ;; (dolist (tag (sort all #'string-lessp)) ;; (insert (format "- [[file:%s.org][%s]]\n" (z/tag-slug tag) tag))))) ))) ``` # Options stuff: In Org mode, you can control per-file publishing behavior using special keywords (known as ****file-local metadata****) at the top of the file. These are written like: \`\`\`org \`\`\` — Here are ****useful options**** you can set ****per file****: | | | | -------------------------------- | --------------------------------------------------------- | | Keyword | Purpose | | ——————– | —————————————————– | | \`\#+TITLE:\` | Title of the document | | \`\#+AUTHOR:\` | Author name | | \`\#+EMAIL:\` | Email address | | \`\#+DATE:\` | Date | | \`\#+OPTIONS:\` | Control export behavior (e.g. toc, num, author, etc.) | | \`\#+HTMLHEAD:\` | Custom HTML for \`\\` (like styles or scripts) | | \`\#+HTMLHEADEXTRA:\` | Extra HTML inserted in \`\\` | | \`\#+HTMLPREAMBLE:\` | Whether to include the preamble (\`t\`, \`nil\`, or HTML) | | \`\#+HTMLPOSTAMBLE:\` | Same but for postamble | | \`\#+LANGUAGE:\` | Language used for export | | \`\#+DESCRIPTION:\` | Adds a \`\\` tag | | \`\#+KEYWORDS:\` | Adds a \`\\` tag | — \#\#\# ✅ Example: Disable TOC and Section Numbers **for one file** You can use the \`\#+OPTIONS:\` line like so: \`\`\`org \`\`\` This disables the Table of Contents and section numbers ****just for that file****. Your updated file might look like this: ``` commonlisp #+TITLE: Welcome to My Org Website #+OPTIONS: toc:nil num:nil #+HTML_HEAD: #+HTML_HEAD: ``` Here's a reference for some values you can tweak via \`\#+OPTIONS:\`: | | | | | --------------- | ------------------------------------ | ------------------ | | Option | Meaning | Example | | ————- | ——————————– | —————- | | \`toc:\` | Table of contents (\`t\` or \`nil\`) | \`toc:nil\` | | \`num:\` | Section numbering | \`num:nil\` | | \`author:\` | Show author name | \`author:nil\` | | \`creator:\` | Show Emacs/Org creator info | \`creator:nil\` | | \`date:\` | Show date | \`date:nil\` | | \`html-style:\` | Disable default style | \`html-style:nil\` | 1. The link is: