diff --git a/static/enhance-content.js b/static/enhance-content.js index 9cf8c98..4f109ca 100644 --- a/static/enhance-content.js +++ b/static/enhance-content.js @@ -1,8 +1,15 @@ -class EnhanceContent extends HTMLElement { - connectedCallback() { +import { WebComponent } from "web-component-base"; + +class EnhanceContent extends WebComponent { + static props = { + server: "", + tagUrl: "", + }; + + onInit() { const el = this.getElementsByClassName("hashtag"); - const server = this.dataset.server; - const tagUrl = this.dataset.tagUrl; + const server = this.props.server; + const tagUrl = this.props.tagUrl; for (let i = 0; i < el.length; i++) { const tagEl = el.item(i); @@ -31,6 +38,10 @@ class EnhanceContent extends HTMLElement { } } } + + get template() { + return this.innerHtml; + } } customElements.define("enhance-content", EnhanceContent); diff --git a/templates/_home.html b/templates/_home.html index 9a22a2a..b63c1c9 100644 --- a/templates/_home.html +++ b/templates/_home.html @@ -18,9 +18,7 @@ - + {% include "import-map.html" %} diff --git a/templates/_tag.html b/templates/_tag.html index 516e7ae..996c141 100644 --- a/templates/_tag.html +++ b/templates/_tag.html @@ -18,9 +18,7 @@ - + {% include "import-map.html" %} diff --git a/templates/card.html b/templates/card.html index 299571f..61250aa 100644 --- a/templates/card.html +++ b/templates/card.html @@ -187,7 +187,7 @@