Security: verwijder hardcoded wachtwoord, voeg random-wachtwoord-generator toe bij eerste installatie
This commit is contained in:
@@ -5,11 +5,21 @@ CodePress uses a **tree view** (`/admin/content`) for content management: a file
|
||||
## Content editor
|
||||
|
||||
### File browser sidebar
|
||||
- Shows the nested file tree of `content/`
|
||||
- Shows the nested file tree of `content/`, with a clickable **content** root at the top
|
||||
- Hidden directories (`.bak`, `.git`) and dotfiles are skipped
|
||||
- Click a file to open it in the CodeMirror editor
|
||||
- Click a **file** to open it in the CodeMirror editor
|
||||
- Click a **folder** (the folder name) to select it — the **folder detail pane** appears on the right
|
||||
- The chevron (▶/▼) next to a folder expands/collapses it without selecting the folder
|
||||
- Folders containing the active file are auto-expanded
|
||||
- Per folder there are action buttons: new file, new folder, rename, delete
|
||||
- Per folder there are action buttons: new file (plus icon), new folder (folder-plus icon) — they operate on the selected folder
|
||||
- Per file there are action buttons: rename/move (pencil), delete (trash) — appear on hover
|
||||
|
||||
### Drag-and-drop
|
||||
- Drag a file or folder onto another folder to move it
|
||||
- Valid drop targets are highlighted during dragging
|
||||
- The move is performed via an AJAX call — the page reloads automatically on success
|
||||
- Security: a folder cannot be dropped into itself or a subfolder
|
||||
- Path-traversal protection: all paths stay within the content directory
|
||||
|
||||
### Editable file types
|
||||
`.md` (Markdown), `.php` (PHP), `.html` (HTML) — consistent with the existing content-edit page.
|
||||
@@ -56,26 +66,32 @@ Existing `{:width=...}` values are shown in the prompts. The size attributes are
|
||||
Images in `content/` are served via the `/-media/` endpoint (content/ lives outside the webroot). Markdown syntax `` with local URLs (relative like `image.jpg`, or absolute like `/content/_images/image.jpg`) is automatically rewritten to `/-media/...`. External URLs (`https://...`) are left untouched.
|
||||
|
||||
### Create a new file
|
||||
- Click **New file** (at the top or per folder in the sidebar)
|
||||
- Select the target folder in the sidebar (click the folder name), or use the root
|
||||
- Click **New file** (in the folder-detail pane or at the top)
|
||||
- Enter a path within content (e.g. `en.page` or `blog/en.post`)
|
||||
- Choose the file type (Markdown/PHP/HTML)
|
||||
- Subfolders are created automatically
|
||||
- Frontmatter with `layout`, `created`, `edited` is auto-generated
|
||||
- The new file is created in the selected folder
|
||||
|
||||
### Upload a file
|
||||
- Click **Upload** to upload files to `content/`
|
||||
- Select the target folder in the sidebar (click the folder name), or use the root
|
||||
- Click **Upload** (in the folder-detail pane or at the top) to upload files to the selected folder
|
||||
- Allowed: images, video, audio, PDF, ZIP, office docs, CSS, SCSS, JS, JSON, HTML, MD
|
||||
- Path-traversal protection: target dir must stay within `content/`
|
||||
- After the upload you return to the selected folder
|
||||
|
||||
### Move / delete a file
|
||||
- In the file tree each file has a move button (arrows icon) and a delete button (trash)
|
||||
- **Move**: choose a target folder from the dropdown listing all folders in content
|
||||
- **Delete**: with confirmation
|
||||
### Rename / delete a file
|
||||
- Open the file in the editor (click the file name in the sidebar)
|
||||
- **Rename**: edit the **Filename** field on the right above the editor and click Save — the file is renamed immediately
|
||||
- **Delete**: click the delete button (trash) next to the file in the sidebar, with confirmation
|
||||
|
||||
### Folder management
|
||||
- **New folder**: per folder in the sidebar or at the top
|
||||
- **Rename folder**: pencil icon per folder
|
||||
- **Delete folder**: trash icon per folder (only empty folders)
|
||||
- Click a folder in the sidebar to open the **folder-detail pane** on the right
|
||||
- **Rename folder**: edit the **Folder name** field in the folder-detail pane and click Save
|
||||
- **New file / new folder / upload into this folder**: use the buttons in the folder-detail pane — they operate on the selected folder
|
||||
- **Delete folder**: delete button in the folder-detail pane (only empty folders)
|
||||
- The content root is also selectable (click "content" at the top of the tree) — shows the folder-detail pane for the root (rename disabled)
|
||||
|
||||
### Layout selection
|
||||
On the editor page you can choose the layout from the layouts defined in `theme.json` (template mapping). The selected layout is stored in the frontmatter `layout:` key.
|
||||
|
||||
Reference in New Issue
Block a user