Mittnett Relume Sitemap Importer
The Mittnett Relume Import is a WordPress plugin designed to automate the creation of pages and structured sections within a WordPress block theme by parsing CSV files generated by the Relume.io sitemap/wireframe AI builder. This plugin leverages WordPress core functions and Gutenberg blocks to ensure seamless integration.
by Bjørn Kristiansen - Mittnett · github.com/jaidevel/mittnett-relume-import
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/jaidevel/mittnett-relume-import/archive/refs/heads/main.zipA WordPress plugin that automates page and section creation from a CSV file, ideal for generating structured site layouts using Gutenberg blocks. The primary purpose of this plugin is to import a sitemap from a Relume project (generated using Relume.io) into WordPress, creating corresponding pages and blocks automatically.
Features
- CSV Parsing: Reads a CSV file to generate pages with structured sections.
- Page Creation: Automatically creates pages based on CSV entries.
- Section Generation: Adds sections to each page using
Group,Heading, andParagraphblocks. - Alternating Background Colors: Adds alternating gray backgrounds to sections for a clean, readable layout.
- Navigation Menu: Creates a navigation menu from generated pages.
Example CSV Structure
| Page Name | Section | Section Description |
|---|---|---|
| Home | Hero | Welcome to our site! |
| Features | Key features of our product. | |
| About | Our Story | Information about our journey. |
| Team | Meet our dedicated team. |
- Rows with a "Page Name" specify a new page.
- Rows with an empty "Page Name" continue adding sections to the last defined page.
Installation
- Download or clone this repository into your
wp-content/pluginsdirectory. - Run
composer installin the plugin's root directory to set up autoloading and dependencies. - Activate the plugin through the Plugins menu in WordPress.
- Go to Sitemap Importer in the WordPress admin sidebar to upload your CSV file.
Usage
- Prepare Your CSV: Ensure the CSV matches the expected structure.
- Upload CSV: In the Sitemap Importer admin page, upload your CSV file.
- View Generated Pages: The plugin will create pages and sections with alternating gray backgrounds in the Gutenberg editor.
Development
Prerequisites
- PHP 7.4+
- WordPress 5.0+ (supports Gutenberg blocks)
Folder Structure
mittnett-relume-import/
├── mittnett-relume.php
├── src/
│ ├── Admin/
│ ├── Import/
│ ├── Logs/
│ ├── Utilities/
│ └── assets/
├── vendor/
└── templates/
Core Files
- ``: Main plugin file, initializes the plugin.
- ``: Manages dependencies and sets up autoloading using Composer.
- ``: Contains Composer dependencies and autoload files.
- ``: Handles page and section creation.
- ``: Manages CSV upload and import functionality.
Future Work/Functionality
- Better Block Theme Support: Add global patterns such as a navigation bar and footer for better integration with block themes.
- Advanced Section Handling: Add logic to select appropriate blocks/patterns for each section, instead of using a single simple pattern for all sections.
- Template Creation: Support the creation of complete page templates for better reuse and design consistency.
- Wireframe Import: Extend functionality to import and generate pages and blocks from Relume wireframes rather than just sitemaps.
Contributing
- Fork the repo.
- Create a new branch (
feature/new-feature). - Commit changes.
- Push to the branch.
- Create a Pull Request.
License
MIT License.