Files
simpleblog/templates/admin/import_export.html
T
2026-11-14 17:05:01 +00:00

32 lines
1.8 KiB
HTML

{% extends "admin/base.html" %}
{% block admin_content %}
<div class="admin-panel">
<h1>Import / Export</h1>
<p class="muted">Move content to and from a WordPress site using the standard WXR (XML) format.</p>
</div>
<div class="admin-panel">
<h2>Export this blog</h2>
<p>Download everything as a <strong>.xml</strong> file that you can upload into a fresh WordPress site via its "Tools → Import → WordPress" screen. Posts, categories and comments are included; images are left as-is (see the note below).</p>
<form id="export-form" method="post" action="{{ url_for('admin.import_export') }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<input type="hidden" name="export" value="1">
<button type="submit" class="btn-primary">Download simple-blog-export.xml</button>
</form>
<p class="muted small">Note: images in the post HTML keep their original URLs, so re-upload them through WordPress's Media Library after importing, or pick the image-reupload option if you want this tool to pull them for you.</p>
</div>
<div class="admin-panel">
<h2>Import from WordPress</h2>
<p>Choose a WXR <strong>.xml</strong> file exported from a WordPress site. Published posts, their categories/tags, and comments are imported into Posts. Existing rows are never overwritten.</p>
<form id="import-form" method="post" action="{{ url_for('admin.import_wxr_route') }}" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<div class="form-group">
<label for="file">WXR file (.xml)</label>
<input type="file" id="file" name="file" accept=".xml,application/xml">
</div>
<button type="submit" class="btn-primary">Import</button>
</form>
</div>
{% endblock %}