This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.customElements.define("elm-portal", class extends HTMLElement { | |
// Base custom element stuff | |
constructor() { | |
super(); | |
this._targetNode = document.createElement('div'); | |
} | |
connectedCallback() { | |
document.querySelector(this.getAttribute("data-target-selector")).appendChild(this._targetNode); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initially based on https://github.com/sonnym/jekyll_elm | |
# | |
# USAGE: | |
# Copy/paste this file into the `_plugins` directory of your Jekyll project. | |
# For every .elm file in your project, it will generate a .js file in your site | |
# using the same name and relative path. | |
# | |
# As-is, the converter expects the following directory structure: | |
# | |
# your-jekyll-project/ |