Skip to content

Commit

Permalink
Custom elements now use 'is=' extenders
Browse files Browse the repository at this point in the history
  • Loading branch information
cdp1337 committed Oct 27, 2023
1 parent be3010f commit d4259fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/layouts/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1 class="post-title">
<a itemprop="url" href="<%= data.mastodon %>"><%= data.title %> on Mastodon</a>
<% } %>

<cms-pagelist
<div is="cms-pagelist"
type="posts"
layout="post-list-embed"
sort="datetime-r"
Expand All @@ -28,5 +28,5 @@ <h1 class="post-title">
filter-tags="Configuration"
>
Loading Content...
</cms-pagelist>
</div>
</article>
2 changes: 1 addition & 1 deletion examples/layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ <h1 class="post-title">
</div>

<% if(data.author) { %>
<cms-author author="<%= data.author %>" layout="author-embed">Author: <%= data.author %></cms-author>
<div is="cms-author" author="<%= data.author %>" layout="author-embed">Author: <%= data.author %></div>
<% } %>
</article>
4 changes: 2 additions & 2 deletions src/client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ import remarkable from './addons/loader-remarkable';


// Load custom elements
customElements.define('cms-author', CMSAuthorElement);
customElements.define('cms-pagelist', CMSPagelistElement);
customElements.define('cms-author', CMSAuthorElement, {extends: 'div'});
customElements.define('cms-pagelist', CMSPagelistElement, {extends: 'div'});
customElements.define('cms-search', CMSSearchElement, { extends: 'input' });
customElements.define('cms-button', CMSButtonElement, {extends: 'a'});
customElements.define('cms-icon', CMSIconElement, {extends: 'i'});
Expand Down

0 comments on commit d4259fa

Please sign in to comment.