diff --git a/src/main/kotlin/fr/username404/website/subpages/Subpage.kt b/src/main/kotlin/fr/username404/website/subpages/Subpage.kt index 8e14057..60d9126 100644 --- a/src/main/kotlin/fr/username404/website/subpages/Subpage.kt +++ b/src/main/kotlin/fr/username404/website/subpages/Subpage.kt @@ -1,5 +1,7 @@ package fr.username404.website.subpages +import kotlinx.browser.window +import org.w3c.dom.Document import org.w3c.dom.HTMLElement import org.w3c.dom.HTMLHeadElement import org.w3c.dom.HTMLMetaElement @@ -9,4 +11,6 @@ data class Subpage( val head: Set, val meta: Set?, val content: HTMLElement -) +) { + fun open(): Document = window.document.open(type = "text/html", replace = content.innerHTML) +}