NGU-Web/docs/importing.md
Aidan Dona 56acedf926 Featured event card beside the hero text; Word import: tabs, quotes, callouts, dividers, videos, buttons
From lg up the featured event's photo sits beside its words, so the card
is about as tall as the hero text. Word import turns a 'Tab:' line into a
tab, the Quote and Intense Quote styles into quotes and callouts, '---'
into a divider, a lone video link into a video and 'Button: label' into
a button; Blog posts shows the whole mapping beside Import from Word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 20:43:25 -05:00

76 lines
3 KiB
Markdown

# Importing a Word document as a blog post
Admin → Data → Blog posts → **Import from Word** (editors and up). Pick
a `.docx`; the server turns it into a new blog post, **unpublished**, and
opens it in the editor with a note of what came over. Check it, add the
authors and a cover, then tick Published.
## What becomes what
| In the document | In the post |
| --- | --- |
| The Title, or the first Heading 1 | The post's title (the file name if there's neither) |
| A date line right under the title, eg. "Sep 28, 2026 · @Aidan" | The post's date (the rest of that line is dropped) |
| Heading 1 and Heading 2 | Heading blocks |
| Heading 3 and smaller | Subheading blocks |
| Paragraphs | Paragraph blocks |
| A run of bulleted or numbered paragraphs | One List block, one item each |
| Tables | Table blocks: a row per line, cells split by `\|`, the first row the header |
| Bold, italic, links (http, https, mailto) | `**bold**`, `*italic*`, `[text](url)`, in paragraphs, list items and table cells |
And lines written a certain way, in any style:
| In the document | In the post |
| --- | --- |
| A line starting `Tab:`, eg. `Tab: Overview` | A Tab block: the post is split into tabs from there (the blocks before the first are the intro above the tabs) |
| The Quote style | A Quote block; a dash and a name at the end (`... - Jane Doe`) is who said it |
| The Intense Quote style | A Callout block |
| A line of `---` alone | A Divider |
| A YouTube, Vimeo or Facebook link alone on its line (the link text can be anything) | A Video block |
| `Button: Register`, with "Register" linked | A Button block, its label and link |
The same table is on Blog posts, beside Import from Word (What becomes what).
A post with three headings or more gets **Show contents** turned on. The
URL ID is the title as a slug, with `-2`, `-3` when it's taken.
Not carried over: images and drawings (the note says how many; add them
as Image blocks), text boxes, footnotes, comments, colors and fonts.
Numbered lists come over as bulleted lists.
The conversion is `server/src/docx.js`; the route is
`server/src/routes/import.js`.
## PDFs
A PDF has no headings, lists or tables inside it, only positioned
text, so it can't be converted the same way. Open it in Word (or Google
Docs) and save it as `.docx` first, or have it converted by hand.
## Table blocks
Any page's content blocks can have one (Content blocks → Type → Table):
```
Platform | Monthly cost | Best for
Zeffy | Free | Fee-free giving
[Breeze](https://www.breezechms.com) | $72 | **Small churches**
```
A literal `|` inside a cell is written `\|`. On a phone a wide table
scrolls sideways in its box.
## nginx
nginx caps `/api/` bodies at 64k, so the upload needs its own block
(in the site's `server` block, beside `/api/admin/media`; `nginx-dev`
has it):
```nginx
location = /api/admin/import/docx {
proxy_pass http://127.0.0.1:3001;
# the usual proxy_set_header lines
proxy_read_timeout 60s;
client_max_body_size 11m;
}
```