Advanced Image Insertion and Scripting
Uploads and Scripts
This section covers uploading assets to the site and automating tasks with scripts.
Uploading Assets
To upload images or other assets:
- Navigate to the Asset manager on the page you are creating. 
when you replace the imagename with the uploaded file name. Note for this to work you must upload 2 images, one for the thumbnail one for the bigger image.
This way is easier to remember but you can do either in markdown. [](https://www.thewhitearchive.org/categories.jpg))
This renders as
If you're having trouble with it showing up, the important part is the [] then just put the larger image next to it (fulllinkagain)
To ensure images meet quality and usability standards, test resizing and clarity before uploading. Suggested tools include:
- ReduceImages for single-image resizing.
- image magick for batch images. I've even put together scripts that you can save which will take all the images from one folder, resize and rename them, and output them in 2 separate folders
Linking PDFs
You can link to uploaded PDFs in both Markdown and HTML formats:
- Markdown: [PDF Title](/pdfs/disinformation-study.pdf)
Ensure PDFs are named appropriately and stored in the correct /uploads folder. Test links after uploading to confirm functionality.
Version Control
All edits are tracked in the wiki's version control system. If you make a mistake, you can revert to a previous version of the page.
Scripts
I've put together a short guide on streamlining your upload process if you have a large amount of images to upload or you just are lazy like me and dont want to manually resize and rename each image.
Setting Up ImageMagick and Preparing Your Environment
This guide walks you through installing ImageMagick and setting up your system to run the provided image processing scripts effectively.
Step 1: Install ImageMagick
- Download ImageMagick:
- Visit the official ImageMagick download page.
- Choose the version compatible with your operating system (Windows, macOS, or Linux).
- For Windows users, download the Windows Executable (with legacy utilities if possible).
- Install ImageMagick:
- Run the installer and follow the on-screen instructions.
- During installation:
- Enable "Add application directory to your system PATH": This allows you to run the magick command from any directory in your terminal or scripts.
- Ensure the Legacy Utilities option is checked for backward compatibility (optional but recommended).
- Verify Installation:
- Open a terminal or PowerShell window.
- Run:
Step 2: Prepare Directories for Scripts
- Organize Your Workspace:
- Create directories to store your images and outputs. For example:
├── toberesized # Source directory for images to process
├── resized images # Output directory for resized images
└── thumbnails # Output directory for thumbnails
Step 3: Set Up PowerShell for Scripts
Ai wrote this out as really complicated but its not. Once you have your folders, just create a text document, save it as whatever you want ex. imageresizer and save or rename it as a .ps1 file. Alternatively, here is the script for you to just download. testscript.ps1
$sourceDir = "C:\path\to\toberesized"
$resizedDir = "C:\path\to\resized images"
$thumbsDir = "C:\path\to\thumbnails"
# Ensure output directories exist
if (!(Test-Path $resizedDir)) { New-Item -ItemType Directory -Path $resizedDir | Out-Null }
if (!(Test-Path $thumbsDir)) { New-Item -ItemType Directory -Path $thumbsDir | Out-Null }
# Get all image files
$imageFiles = Get-ChildItem -Path $sourceDir -File | Where-Object { $_.Extension -in ".jpg", ".jpeg", ".png", ".bmp", ".webp" }
# Process each image
foreach ($image in $imageFiles) {
$originalPath = $image.FullName
$originalName = $image.BaseName
$extension = $image.Extension
# Define output paths
$resizedPath = Join-Path $resizedDir "$originalName$extension"
$thumbPath = Join-Path $thumbsDir "$originalName`_thumb$extension"
# Generate resized image
magick "$originalPath" -resize 1920x1080 "$resizedPath"
# Generate thumbnail
magick "$originalPath" -resize 300x300 "$thumbPath"
# Check if outputs were created
if (Test-Path $resizedPath -and Test-Path $thumbPath) {
Write-Output "Successfully processed: $originalPath"
} else {
Write-Output "Failed to process: $originalPath"
}
}
Write-Output "All images processed successfully!"
- [Your Sandbox](/en/sandbox): Experiment and draft content.
- [Formatting Guide](/en/admin/contribute/formatting-the-basics): Detailed rules for structuring your pages.
- [All Pages](/en/all-pages): Browse existing content for inspiration.