Skip to content

Commit

Permalink
Upgrade to WebC v0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Mar 31, 2023
1 parent f730b28 commit 23a51ac
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@11ty/eleventy-navigation": "^0.3.5",
"@11ty/eleventy-plugin-rss": "^1.2.0",
"@11ty/eleventy-plugin-syntaxhighlight": "^4.2.0",
"@11ty/eleventy-plugin-webc": "^0.10.1",
"@11ty/eleventy-plugin-webc": "^0.11.0",
"@netlify/functions": "^1.4.0",
"@netlify/plugin-lighthouse": "^4.0.7",
"@tweetback/canonical": "^2.0.29",
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/components/cli-eleventy-output.webc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}
</style>
<script webc:type="js">
let version = latestVersion(versions, config);
let version = latestVersion($data.versions, $data.config);
let versionSuffix = showVersion === "" ? ` (${version})` : "";
this.helpers.highlight("bash", `${this.slots.text.default.trim()}${versionSuffix}`, "/", "-"); // `"/", "-"` enables line wrapping
</script>
2 changes: 1 addition & 1 deletion src/_includes/components/eleventy-version.webc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<span webc:nokeep @text="latestVersion(versions, config, prefix)"></span>
<span webc:nokeep @text="latestVersion($data.versions, $data.config)"></span>
2 changes: 1 addition & 1 deletion src/_includes/components/node-minimum.webc
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ function latestVersionNodeMinimum(versions, config) {
}
</script>

<span webc:nokeep @text="latestVersionNodeMinimum(versions, config)"></span>
<span webc:nokeep @text="latestVersionNodeMinimum($data.versions, $data.config)"></span>
41 changes: 20 additions & 21 deletions src/index.webc
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@ let searchTitle = "Eleventy, a simpler static site generator";
let skipAuth = true;

let eleventyImport = {
collections: ["blog"]
collections: ["blog"]
};

let eleventyComputed = {
social: {
description: () => "Eleventy, a simpler static site generator."
},
social: {
description: () => "Eleventy, a simpler static site generator."
},
};
// </script>
---
<script webc:setup>
function getHighlightedBlogPostContent(collection) {
let posts = findBy(collection, 'data.homePageHighlight', true);
if(!posts.length) {
return "";
}
let posts = findBy(collection, 'data.homePageHighlight', true);
if(!posts.length) {
return "";
}

let content = [];
for(let post of posts) {
content.push(`<strong><a href="${post.data.page.url}">${post.data.newstitle}</a></strong>`);
}
let content = [];
for(let post of posts) {
content.push(`<strong><a href="${post.data.page.url}">${post.data.newstitle}</a></strong>`);
}

return `Read ${content.join(" and ")} <em>(and more!)</em> on the <a href="/blog/">Eleventy Blog</a>.`;
return `Read ${content.join(" and ")} <em>(and more!)</em> on the <a href="/blog/">Eleventy Blog</a>.`;
}
</script>

Expand All @@ -59,11 +59,10 @@ function getHighlightedBlogPostContent(collection) {
<p>From a <a href="https://www.zachleat.com/web/build-benchmark/#benchmark-results">benchmark of ×4000 markdown files</a>. Learn more about <a href="/docs/performance/">Eleventy’s site and build performance</a>.</p>

<quick-start></quick-start>

<hr>

<div class="fullwidth-module">
<logo-cloud></logo-cloud>
<logo-cloud></logo-cloud>
</div>

<giant-docs-button></giant-docs-button>
Expand All @@ -88,11 +87,11 @@ function getHighlightedBlogPostContent(collection) {
<sites-list-njk :sites="builtwith"></sites-list-njk>

<div class="fullwidth-module">
<is-land on:visible on:save-data="false">
<facepile>
<html-fetch src="/imports/facepile.html"></html-fetch>
</facepile>
</is-land>
<is-land on:visible on:save-data="false">
<facepile>
<html-fetch src="/imports/facepile.html"></html-fetch>
</facepile>
</is-land>
</div>

<p>View <a href="/speedlify/">all <span @text="getsize(objectFilterNot(builtwith, 'disabled'))" webc:nokeep></span> sites</a>.</p>
Expand All @@ -101,7 +100,7 @@ function getHighlightedBlogPostContent(collection) {

<p>Listen to what these <a href="/docs/testimonials/">happy developers</a> are saying about Eleventy:</p>

<testimonials-list></testimonials-list>
<testimonials-list :testimonials="testimonials"></testimonials-list>

<p><a href="/docs/testimonials/">…and many more!</a></p>
</div>

0 comments on commit 23a51ac

Please sign in to comment.