diff --git a/templates/admin/article-form.php b/templates/admin/article-form.php
new file mode 100644
index 0000000..f8715e0
--- /dev/null
+++ b/templates/admin/article-form.php
@@ -0,0 +1,111 @@
+ID : 0;
+$a_title = $is_edit ? $article->post_title : '';
+$a_content = $is_edit ? $article->post_content : '';
+$a_excerpt = $is_edit ? $article->post_excerpt : '';
+$a_wiki_id = $is_edit ? (int)get_post_meta($article_id,'_wmw_wiki_id',true) : $wiki_id;
+$a_order = $is_edit ? (int)get_post_meta($article_id,'_wmw_order',true) : 0;
+$a_status = $is_edit ? $article->post_status : 'publish';
+$a_cats = $is_edit ? wp_list_pluck((array)get_the_terms($article_id,'wmw_category'),'term_id') : array();
+$a_tags = $is_edit ? implode(', ', wp_list_pluck((array)get_the_terms($article_id,'wmw_tag'),'name')) : '';
+$all_cats = get_terms(array('taxonomy'=>'wmw_category','hide_empty'=>false));
+?>
+
diff --git a/templates/admin/article-list.php b/templates/admin/article-list.php
new file mode 100644
index 0000000..bba178f
--- /dev/null
+++ b/templates/admin/article-list.php
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Titel
+ Wiki
+ Kategorien
+ Status
+ Reihenfolge
+ Aktionen
+
+
+
+ ID);
+ $cats = get_the_terms($article->ID,'wmw_category');
+ $cats_str = $cats && !is_wp_error($cats) ? implode(', ', wp_list_pluck($cats,'name')) : '—';
+ $order = (int)get_post_meta($article->ID,'_wmw_order',true);
+ ?>
+
+
+ post_title); ?>
+
+
+ ID).' '.esc_html($art_wiki->post_title) : '—'; ?>
+
+
+ post_status==='publish'): ?>
+ Veröffentlicht
+
+ Entwurf
+
+
+
+
+ ✏️
+ 🗑️
+
+
+
+
+
+
+
+
diff --git a/templates/admin/categories.php b/templates/admin/categories.php
new file mode 100644
index 0000000..4196ae1
--- /dev/null
+++ b/templates/admin/categories.php
@@ -0,0 +1,45 @@
+'wmw_category','hide_empty'=>false,'orderby'=>'name','order'=>'ASC'));
+?>
+
diff --git a/templates/admin/dashboard.php b/templates/admin/dashboard.php
new file mode 100644
index 0000000..b8a3526
--- /dev/null
+++ b/templates/admin/dashboard.php
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+ Wikis
+
+
+
+ Artikel gesamt
+
+
+
+ Kategorien
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ID;
+ $articles = wmw_get_articles( $wiki_id );
+ $article_count = count( $articles );
+ $icon = wmw_get_wiki_icon( $wiki_id );
+ $color = wmw_get_wiki_color( $wiki_id );
+ $version = get_post_meta( $wiki_id, '_wmw_version', true ) ?: '1.0.0';
+ $edit_url = admin_url( 'admin.php?page=wmw-edit-wiki&id=' . $wiki_id );
+ $new_art_url = admin_url( 'admin.php?page=wmw-new-article&wiki_id=' . $wiki_id );
+ $articles_url = admin_url( 'admin.php?page=wmw-articles&wiki_id=' . $wiki_id );
+ $view_url = get_permalink( $wiki_id );
+ ?>
+
+
+
post_title ); ?>
+ post_excerpt ) : ?>
+
post_excerpt, 12 ) ); ?>
+
+
+ 📄 Artikel
+
+
+
+
+
+
+
+
+
+
+
📋 Shortcode-Referenz
+
+
+ [wmw_wiki_list]
+ Alle Wikis als Karten anzeigen
+
+
+ [wmw_wiki id="1"]
+ Ein Wiki mit allen Artikeln
+
+
+ [wmw_wiki slug="mein-plugin"]
+ Wiki per Slug einbinden
+
+
+ [wmw_search wiki_id="1"]
+ Suchfeld für ein Wiki
+
+
+ [wmw_article id="5"]
+ Einzelnen Artikel einbetten
+
+
+ [wmw_breadcrumb]
+ Breadcrumb-Navigation
+
+
+
+
+
+
+
+
+
🔍 Suchindex
+
Falls die Suche keine Ergebnisse liefert (z.B. nach einem Gitea-Import), den Index neu aufbauen.
+
🔄 Suchindex neu aufbauen
+
+
+
\ No newline at end of file
diff --git a/templates/admin/gitea-importer.php b/templates/admin/gitea-importer.php
new file mode 100644
index 0000000..568db5d
--- /dev/null
+++ b/templates/admin/gitea-importer.php
@@ -0,0 +1,254 @@
+list_pages();
+ }
+}
+
+// ── Handle Import ─────────────────────────────────────────────────────────────
+if ( isset( $_POST['wmw_gitea_import'] ) && wp_verify_nonce( $_POST['wmw_gitea_nonce'] ?? '', 'wmw_gitea_import' ) && current_user_can( 'manage_options' ) ) {
+
+ $gitea_url = esc_url_raw( $_POST['gitea_url'] ?? '' );
+ $owner = sanitize_text_field( $_POST['gitea_owner'] ?? '' );
+ $repo = sanitize_text_field( $_POST['gitea_repo'] ?? '' );
+ $token = sanitize_text_field( $_POST['gitea_token'] ?? '' );
+ $wiki_id = absint( $_POST['wmw_wiki_id'] ?? 0 );
+ $skip_pages = array_map( 'sanitize_text_field', array_filter( explode( "\n", str_replace( "\r", '', $_POST['skip_pages'] ?? '' ) ) ) );
+ $update_exist = isset( $_POST['update_existing'] );
+
+ if ( $gitea_url && $owner && $repo && $wiki_id ) {
+ $importer = new WMW_Gitea_Importer( $gitea_url, $owner, $repo, $token );
+ $result = $importer->import_all( $wiki_id, $skip_pages, $update_exist );
+ } else {
+ $result = array( 'errors' => array( 'Bitte alle Pflichtfelder ausfüllen.' ) );
+ }
+}
+?>
+
+
+
diff --git a/templates/admin/settings.php b/templates/admin/settings.php
new file mode 100644
index 0000000..ff28ec1
--- /dev/null
+++ b/templates/admin/settings.php
@@ -0,0 +1,67 @@
+
+
diff --git a/templates/admin/wiki-form.php b/templates/admin/wiki-form.php
new file mode 100644
index 0000000..85c6d0b
--- /dev/null
+++ b/templates/admin/wiki-form.php
@@ -0,0 +1,102 @@
+ID : 0;
+$wiki_title = $is_edit ? $wiki->post_title : '';
+$wiki_desc = $is_edit ? $wiki->post_content : '';
+$wiki_excerpt= $is_edit ? $wiki->post_excerpt : '';
+$wiki_icon = $is_edit ? get_post_meta($wiki_id,'_wmw_icon',true) : '📖';
+$wiki_color = $is_edit ? get_post_meta($wiki_id,'_wmw_color',true) : '#2271b1';
+$wiki_ver = $is_edit ? get_post_meta($wiki_id,'_wmw_version',true) : '1.0.0';
+$wiki_status = $is_edit ? $wiki->post_status : 'publish';
+?>
+
diff --git a/templates/breadcrumb.php b/templates/breadcrumb.php
new file mode 100644
index 0000000..07f2cc2
--- /dev/null
+++ b/templates/breadcrumb.php
@@ -0,0 +1,15 @@
+
+
+
+ $item): ?>
+
+
+
+ ›
+
+
+
+
+
+
+
diff --git a/templates/search-box.php b/templates/search-box.php
new file mode 100644
index 0000000..7de7d51
--- /dev/null
+++ b/templates/search-box.php
@@ -0,0 +1,16 @@
+
+
diff --git a/templates/sidebar.php b/templates/sidebar.php
new file mode 100644
index 0000000..b25145c
--- /dev/null
+++ b/templates/sidebar.php
@@ -0,0 +1,56 @@
+ID : 0;
+?>
+
diff --git a/templates/single-wmw-article.php b/templates/single-wmw-article.php
new file mode 100644
index 0000000..4e6052c
--- /dev/null
+++ b/templates/single-wmw-article.php
@@ -0,0 +1,132 @@
+ID);
+$side_pos = $settings['sidebar_position'] ?? 'left';
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ID); ?>
+ post_title); ?>
+
+
+ post_title); ?>
+
+ ID, 'wmw_category');
+ if ($cats && !is_wp_error($cats)):
+ foreach($cats as $cat): ?>
+
name); ?>
+
+ ID, 'wmw_tag');
+ if ($tags && !is_wp_error($tags)):
+ foreach($tags as $tag): ?>
+
name); ?>
+
+
Aktualisiert:
+
+
+
+
+ post_content); ?>
+
+
+
+ ID, array('orderby' => 'meta_value_num', 'meta_key' => '_wmw_order', 'order' => 'ASC'));
+ $ids = wp_list_pluck($articles, 'ID');
+ $pos = array_search($article->ID, $ids);
+ $prev = $pos > 0 ? get_post($ids[$pos-1]) : null;
+ $next = $pos !== false && $pos < count($ids)-1 ? get_post($ids[$pos+1]) : null;
+ ?>
+
+
+
+
+
+
+
+
+ ID, 'wmw_category');
+ if ($cats && !is_wp_error($cats)) {
+ $cat_ids = wp_list_pluck($cats, 'term_id');
+ $related = get_posts(array(
+ 'post_type' => 'wmw_article',
+ 'post_status' => 'publish',
+ 'posts_per_page' => 4,
+ 'post__not_in' => array($article->ID),
+ 'meta_query' => array(array('key'=>'_wmw_wiki_id','value'=>wmw_get_article_wiki_id($article->ID))),
+ 'tax_query' => array(array('taxonomy'=>'wmw_category','field'=>'term_id','terms'=>$cat_ids)),
+ ));
+ }
+ }
+ if (!empty($related)):
+ ?>
+
+
+
+
+
+
+
+
diff --git a/templates/single-wmw-wiki.php b/templates/single-wmw-wiki.php
new file mode 100644
index 0000000..a1d10f5
--- /dev/null
+++ b/templates/single-wmw-wiki.php
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/templates/single-wmw_article.php b/templates/single-wmw_article.php
new file mode 100644
index 0000000..21226e3
--- /dev/null
+++ b/templates/single-wmw_article.php
@@ -0,0 +1,112 @@
+ 'wmw_article',
+ 'numberposts' => -1,
+ 'post_status' => 'publish',
+ 'meta_key' => '_wmw_wiki_id',
+ 'meta_value' => $wiki_id,
+ 'orderby' => [ 'meta_value_num' => 'ASC', 'title' => 'ASC' ],
+ ] );
+ }
+ $prev_art = null; $next_art = null;
+ foreach ( $siblings as $i => $s ) {
+ if ( $s->ID === $post_id ) {
+ if ( $i > 0 ) $prev_art = $siblings[ $i - 1 ];
+ if ( $i < count( $siblings ) - 1 ) $next_art = $siblings[ $i + 1 ];
+ break;
+ }
+ }
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Aktualisiert:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Zurueck
+ post_title ); ?>
+
+
+
+
+
+
+ Weiter
+ post_title ); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/templates/single-wmw_wiki.php b/templates/single-wmw_wiki.php
new file mode 100644
index 0000000..a4505ef
--- /dev/null
+++ b/templates/single-wmw_wiki.php
@@ -0,0 +1,37 @@
+
+
+
+
diff --git a/templates/wiki-index.php b/templates/wiki-index.php
new file mode 100644
index 0000000..5bed87b
--- /dev/null
+++ b/templates/wiki-index.php
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+ ID); ?>
+
+
+ post_content): ?>
+
+ post_content); ?>
+
+
+
+
+ $cat_articles):
+ if (empty($cat_articles)) continue;
+ $has_cats = true;
+ $cat_name = $cat_id === 'uncategorized' ? '📄 Allgemein' : (isset($cat_map[$cat_id]) ? $cat_map[$cat_id]->name : 'Sonstige');
+ ?>
+
+
+
+
Noch keine Artikel in diesem Wiki.
+
+
+
+
\ No newline at end of file
diff --git a/templates/wiki-list.php b/templates/wiki-list.php
new file mode 100644
index 0000000..57833ef
--- /dev/null
+++ b/templates/wiki-list.php
@@ -0,0 +1,24 @@
+
+