⏱️ 2 min read
Table of Contents
Office Plugin
The Office Plugin allows you to use Microsoft Word (.docx) and OpenDocument Text (.odt) files as source content for your static site.
How it works
The plugin intercepts files with .odt or .docx extensions:
- It unzips the document (Office files are essentially ZIP archives).
- It extracts the core XML content (
content.xmlfor ODT,word/document.xmlfor DOCX). - It parses the XML using
pugixmland translates it into standard HTML. - The generated HTML is then processed like any other page content.
Supported Features
- Headers: Translates ODT/DOCX headings to
<h1>through<h6>. - Paragraphs: Standard text blocks.
- Lists: Ordered and unordered lists (ODT).
- Tables: Basic table structures (DOCX).
- Links: Hyperlinks are preserved.
Configuration
Enable in your theme's .cfg file (e.g., fluid.cfg):
[plugins]
enabled=..., office
Template Usage
Since the plugin converts the document directly to the main content, you use the standard [ content ] variable in your template:
<article class="site-main">
<h1>[ title ]</h1>
[ content ]
</article>
Note: In the examples above, [] is used instead of the usual double-curly braces to avoid parsing issues in some environments.