mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 20:19:13 +00:00
11ty for webawesome + app
This commit is contained in:
@@ -67,6 +67,11 @@ export default function (eleventyConfig) {
|
||||
return `https://early.webawesome.com/webawesome@${packageData.version}/dist/` + (location || "").replace(/^\//, '');
|
||||
});
|
||||
|
||||
// Turns `{% server_variable "foo" %} into `{{ server.foo | safe }}`
|
||||
eleventyConfig.addShortcode('server', function (property) {
|
||||
return `{{ server.${property} | safe }}`;
|
||||
});
|
||||
|
||||
// Paired shortcodes - {% shortCode %}content{% endShortCode %}
|
||||
eleventyConfig.addPairedShortcode('markdown', content => markdown.render(content || ''));
|
||||
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
|
||||
{# Docs styles #}
|
||||
<link rel="stylesheet" href="/assets/styles/docs.css" />
|
||||
|
||||
{# Used by Web Awesome App to inject other assets into the head. #}
|
||||
{% raw %} {{ server.head | safe }} {% endraw %}
|
||||
</head>
|
||||
<body class="layout-{{ layout | stripExtension }}{{ ' page-wide' if wide }}">
|
||||
<!-- use view="desktop" as default to reduce layout jank on desktop site. -->
|
||||
@@ -53,7 +50,7 @@
|
||||
</wa-button>
|
||||
|
||||
{# Login #}
|
||||
{{ server.loginOrAvatar | safe }}
|
||||
{% server "loginOrAvatar" %}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
@@ -50,4 +50,4 @@
|
||||
|
||||
|
||||
{# Used by Web Awesome App to inject other assets into the head. #}
|
||||
{% raw %} {{ server.head | safe }} {% endraw %}
|
||||
{% server "head" %}
|
||||
|
||||
@@ -4,8 +4,6 @@ description: Build better with Web Awesome, the open source library of web compo
|
||||
layout: page
|
||||
---
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
.title,
|
||||
.anchor-heading a,
|
||||
@@ -387,4 +385,4 @@ layout: page
|
||||
© Fonticons, Inc.
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
@@ -167,7 +167,7 @@ export default class WaButton extends WebAwesomeFormAssociatedElement {
|
||||
}
|
||||
button.value = this.value || '';
|
||||
|
||||
['form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget'].forEach(attr => {
|
||||
;['form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget'].forEach(attr => {
|
||||
if (this.hasAttribute(attr)) {
|
||||
button.setAttribute(attr, this.getAttribute(attr)!);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user