Enhance article import functionality: Add author selection and preserve attribution during imports; update metadata version to 1.1.2.
This commit is contained in:
1 parent
41e623d5d1
commit
c56ae0ced2
5 files changed
+73
-15
No files matched your search
@@ -65,12 +65,13 @@ For example, to import the article stored as `load-balancing-my-homelab/content/
|
||||
|
||||
1. Push the article and its referenced assets to the configured GitHub branch.
|
||||
2. Open the plugin settings and enter `load-balancing-my-homelab` under **Import one article from GitHub**. With a path prefix, still enter only the article folder name.
|
||||
3. Choose the status behavior **before previewing**:
|
||||
3. Choose **Article author** before previewing. Select an existing Bludit account to override the author, or leave the default to use repository `author`, otherwise preserve the existing page author (new pages: logged-in account). To repair an earlier import attributed to `admin`, select the intended account and reimport the same article folder.
|
||||
4. Choose the status behavior **before previewing**:
|
||||
- **Import as draft** is checked by default, including for an existing published article. Confirming with this option changes the page to a draft.
|
||||
- Uncheck it to use a nonempty repository `status`. A blank or omitted status preserves an existing page's type; a new page remains a draft. Future published dates are scheduled by Bludit.
|
||||
4. Click **Preview import**. Review create versus replace, commit, metadata, resulting status, incoming source text and the assets to download. Existing content can be expanded for comparison. The incoming HTML is escaped in the preview, not executed.
|
||||
5. Click **Confirm this import**. The plugin downloads and verifies the assets, saves a protected backup when replacing a page, then uses Bludit's `createPage()` or `editPage()` functions to save the article and rebuild category/tag indexes.
|
||||
6. Check the imported draft or live page in Bludit, including its images and attachment links.
|
||||
5. Click **Preview import**. Review create versus replace, commit, metadata, resulting status, incoming source text and the assets to download. Existing content can be expanded for comparison. The incoming HTML is escaped in the preview, not executed.
|
||||
6. Click **Confirm this import**. The plugin downloads and verifies the assets, saves a protected backup when replacing a page, then uses Bludit's `createPage()` or `editPage()` functions to save the article and rebuild category/tag indexes.
|
||||
7. Check the imported draft or live page in Bludit, including its images and attachment links.
|
||||
|
||||
The preview is pinned to the Git commit it displayed; newer GitHub commits require another preview. It belongs to the current administrator session, expires after 30 minutes and can only be confirmed once. **Cancel preview** discards it without editing an article.
|
||||
|
||||
@@ -78,13 +79,14 @@ Confirmation checks the persisted local page metadata and body again, including
|
||||
|
||||
### Metadata and content
|
||||
|
||||
- Supported fields: `title`, `date`, `slug`, `status`, `tags`, `description`, `category`, `cover`.
|
||||
- Supported fields: `title`, `date`, `slug`, `author`, `status`, `tags`, `description`, `category`, `cover`.
|
||||
- A title and nonempty body are required. If present, `slug` must match the selected folder. Only a single top-level page key is supported, not nested pages or renames; Bludit slug normalization/collisions are refused.
|
||||
- Dates use `YYYY-MM-DD`. An unchanged date preserves the existing time; a changed date uses midnight in the site's timezone.
|
||||
- Supported statuses: `draft`, `published`, `static`, `sticky`, `scheduled`, or blank for legacy exports. Normal Bludit scheduling applies.
|
||||
- Tags use `tags: []` or an indented ` - tag` list. Omitted metadata is preserved on update, apart from the explicit draft option and required title. Blank fields clear their corresponding values.
|
||||
- A nonempty category key must already exist in Bludit; create it in the administration interface first. Tags are rebuilt through Bludit after save.
|
||||
- Existing author, UUID and unrelated metadata are retained. New articles belong to the logged-in administrator.
|
||||
- `author` is a Bludit username, not a display nickname. It must refer to an existing account. Explicit selection in the import form takes priority over repository metadata. Without either, an existing author is preserved and a new page belongs to the logged-in administrator. The preview shows the resulting author; no account is created or impersonated. New pages needing a different author are created through `createPage()` and then adjusted through `editPage()`, with this plugin's export hooks suppressed for both operations.
|
||||
- Existing UUID and unrelated metadata are retained.
|
||||
- Front matter supports the small scalar/list format emitted by this plugin, not general YAML. Nested objects, aliases, tags, multiline scalars, unknown fields and duplicate fields are rejected. Quote strings containing YAML punctuation with JSON-style double quotes.
|
||||
- A `cover` may be a repository `../img/…` reference or an HTTP(S) URL. A repository cover image is imported with the other assets.
|
||||
- The body is stored as supplied, with asset destinations rewritten to Bludit uploads. The site's usual Markdown configuration controls Markdown rendering. Confirmed HTML is trusted author content, just like content saved in Bludit's editor; previewing it does not sanitize the eventual article.
|
||||
@@ -112,6 +114,7 @@ Backups and asset mapping files remain in the workspace across plugin upgrades.
|
||||
- Saving a page exports it when its auto-export setting is enabled.
|
||||
- **Export everything** exports drafts and published articles; **Export published only** exports the published selection.
|
||||
- Bludit upload URLs become relative `../img/` or `../files/` references. Imported asset mappings retain their original paths.
|
||||
- Exports include the page's actual `author` username so later imports can preserve attribution.
|
||||
- Exported `status` comes from Bludit's actual page `type`. Earlier plugin versions exported an empty `status` field; imports accept that legacy format.
|
||||
- Contents API reads use the configured branch, so export SHA lookups do not accidentally use the repository's default branch.
|
||||
- Deleting a Bludit page retains the existing automatic GitHub deletion behavior: its document and direct files in `img/` and `files/` are removed. This is unrelated to importing: missing repository pages never trigger local deletion. Nested repository asset directories are not recursively deleted.
|
||||
|
||||
Reference in new issue
Block a user