Skip to content

Commit c402089

Browse files
authored
Show feature explainers on main (v8#600)
* Show feature explainers on main This should improve discoverability of feature explainers and make main feed a bit more lively. * Update index.njk
1 parent 0ccef75 commit c402089

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.eleventy.js

+6
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ module.exports = (eleventyConfig) => {
147147
.sort((a, b) => b.date - a.date);
148148
});
149149

150+
// Create a collection with merged blogs and feature explainers.
151+
eleventyConfig.addCollection('allPosts', (collection) => {
152+
return collection.getFilteredByGlob('src/{blog,features}/*.md')
153+
.sort((a, b) => b.date - a.date);
154+
});
155+
150156
// Patch the Markdown renderer to recognize <feature-support>.
151157
const oldRender = md.render.bind(md);
152158
md.render = (input) => {

src/index.njk

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ description: 'V8 is Google’s open source high-performance JavaScript and WebAs
77

88
<p>V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements <a href="https://tc39.es/ecma262/">ECMAScript</a> and <a href="https://webassembly.github.io/spec/core/">WebAssembly</a>, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.</p>
99

10-
<h2>Latest blog posts</h2>
10+
<h2>Latest posts and feature explainers</h2>
1111

12-
{% set posts = collections.posts | head(10) %}
13-
{% set start = collections.posts | length %}
12+
{% set posts = collections.allPosts | head(10) %}
13+
{% set start = collections.allPosts | length %}
1414
{% include "posts.njk" %}
1515

16-
<p>More articles can be found in <a href="/blog">the blog archive</a>.</p>
16+
<p>More articles can be found in <a href="/blog">the blog archive</a> and <a href="/features">the features section</a>.</p>
1717

1818
<h2>Latest <a href="https://twitter.com/v8js" rel="me nofollow">@v8js</a> tweets</h2>
1919
<a class="twitter-link" href="https://twitter.com/v8js" rel="me nofollow">View tweets by @v8js</a>

0 commit comments

Comments
 (0)