diff --git a/otterwiki/renderer_embeddings.py b/otterwiki/renderer_embeddings.py
index 913976e6..c2bb2422 100644
--- a/otterwiki/renderer_embeddings.py
+++ b/otterwiki/renderer_embeddings.py
@@ -1196,7 +1196,7 @@ def embedding_render(
+ ''
)
- togglediv = f"""
+ togglediv = f"""
"""
diff --git a/otterwiki/static/css/elements/page.css b/otterwiki/static/css/elements/page.css
index b700cdb0..79c03b96 100644
--- a/otterwiki/static/css/elements/page.css
+++ b/otterwiki/static/css/elements/page.css
@@ -147,3 +147,35 @@
margin: 0;
background-color: transparent;
}
+
+.page .pageindex-header {
+ font-size: var(--content-title-font-size);
+}
+
+/* Embedded PageIndex: move heading toggle into the title row */
+.pageindex-embedding {
+ position: relative;
+}
+
+/* The toggle immediately before an embedded index */
+.pageindex-embedding:before {
+ content: "";
+ display: block;
+}
+
+/* Parent page title + toggle alignment */
+article.page > h1 + .custom-switch {
+ float: right;
+ margin-top: -4.4rem;
+ margin-bottom: 0;
+}
+
+/* Recover the vertical space used by the old toggle position */
+article.page > h1 + .custom-switch + .pageindex-embedding {
+ clear: both;
+ margin-top: -2.75rem;
+}
+
+article.page .pageindex-embedding {
+ padding-top: 0.1rem;
+}
diff --git a/otterwiki/templates/pageindex.html b/otterwiki/templates/pageindex.html
index a0a6018d..b9c85a79 100644
--- a/otterwiki/templates/pageindex.html
+++ b/otterwiki/templates/pageindex.html
@@ -13,7 +13,7 @@
{% block body_attrs %}data-index-path="{{ pagepath | slugify(keep_slashes=True) }}"{% endblock %}
{% block content %}
-
{{ title }}
+
{{ title }}