diff --git a/content/README.md b/content/README.md index c0afd17097..195881afdb 100644 --- a/content/README.md +++ b/content/README.md @@ -155,6 +155,8 @@ For a layout named `layouts/article.html`, the value would be `article`. - Type: `Object`. - Optional. +The list of popular links are the links displayed on the landing page under the title "Popular." Alternately, you can customize the title "Popular" by setting the `featuredLinks.popularHeading` property to a new string. + Example: ```yaml @@ -163,6 +165,10 @@ featuredLinks: - /path/to/page guides: - /guides/example + popular: + - /path/to/popular/article1 + - /path/to/popular/article2 + popularHeading: An alternate heading to Popular ``` ### `showMiniToc` diff --git a/includes/code-examples.html b/includes/code-examples.html index e3d816dcde..4355aeb954 100644 --- a/includes/code-examples.html +++ b/includes/code-examples.html @@ -9,7 +9,9 @@ {% render code-example-card for productCodeExamples as example %} - + {% if productCodeExamples.length > 6 %} + + {% endif %}
{% octicon "search" width="24" %}
diff --git a/layouts/product-landing.html b/layouts/product-landing.html index b430a475b1..f2a9f00194 100644 --- a/layouts/product-landing.html +++ b/layouts/product-landing.html @@ -71,9 +71,10 @@
+ {% if featuredLinks.popular %}
+ {% endif %} {% if page.changelog %}
diff --git a/lib/frontmatter.js b/lib/frontmatter.js index 4462eb3628..22979440d5 100644 --- a/lib/frontmatter.js +++ b/lib/frontmatter.js @@ -74,11 +74,26 @@ const schema = { }, featuredLinks: { type: 'object', - additionalProperties: false, - patternProperties: { - '^[a-zA-Z-_]+$': { + properties: { + gettingStarted: { type: 'array', items: { type: 'string' } + }, + guides: { + type: 'array', + items: { type: 'string' } + }, + guideCards: { + type: 'array', + items: { type: 'string' } + }, + popular: { + type: 'array', + items: { type: 'string' } + }, + // allows you to use an alternate heading for the popular column + popularHeading: { + type: 'string' } } },