Skip to content

Commit 0cfc847

Browse files
authored
Merge pull request #19090 from github/add-anchors-to-landing-layouts
Add anchors to product landing and sublanding sections
2 parents 141c638 + e1fd471 commit 0cfc847

11 files changed

Lines changed: 20 additions & 16 deletions

includes/all-articles-category.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% assign maxArticles = 10 %}
44

55
<div class="py-6 all-articles-list">
6-
<h2 class="font-mktg mb-4">{{ category.title }} docs</h2>
6+
<h2 class="font-mktg mb-4" id="all-docs"><a href="#all-docs">{{ category.title }} docs</a></h2>
77

88
<div class="d-flex gutter flex-wrap">
99
{% for xmaptopic in category.maptopics %}

includes/all-articles-product.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% assign maxArticles = 10 %}
33

44
<div class="py-6 all-articles-list">
5-
<h2 class="font-mktg mb-4">All {{ product.title }} docs</h2>
5+
<h2 class="font-mktg mb-4" id="all-docs"><a href="#all-docs">All {{ product.title }} docs</a></h2>
66

77
<div class="d-flex gutter flex-wrap">
88
{% for category in product.categories %}

includes/article-cards.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="container-xl px-3 px-md-6 pt-3 pb-2">
44
<!-- When learning tracks aren't present, only guides exist and this heading duplicates the article's title -->
55
{% if page.learningTracks %}
6-
<h2 class="mb-3 font-mktg">{% data ui.product_sublanding.all_guides %}</h2>
6+
<h2 class="mb-3 font-mktg" id="all-guides"><a href="#all-guides">{% data ui.product_sublanding.all_guides %}</a></h2>
77
{% endif %}
88

99
<form class="mt-2 mb-5 d-flex d-flex">

includes/category-articles-list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{% assign maxArticles = 10 %}
88

99
<div class="py-6 all-articles-list">
10-
<h2 class="font-mktg mb-4">{{ currentCategoryTitle }} docs</h2>
10+
<h2 class="font-mktg mb-4" id="all-docs"><a href="#all-docs">{{ currentCategoryTitle }} docs</a></h2>
1111

1212
<div class="d-flex gutter flex-wrap">
1313
{% for childPage in currentCategory.childPages %}

includes/code-examples.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="my-6 pt-6">
2-
<h2 class="mb-2 font-mktg h1">{% data ui.product_landing.code_examples %}</h2>
2+
<h2 class="mb-2 font-mktg h1" id="code-examples"><a href="#code-examples">{% data ui.product_landing.code_examples %}</a></h2>
33

44
<div class="pr-lg-3 mb-5 mt-3">
55
<input class="js-filter-card-filter input-lg py-2 px-3 col-12 col-lg-8 form-control" placeholder="{% data ui.product_landing.search_code_examples %}" type="search" autocomplete="off" aria-label="Search code examples"/>

includes/community-examples.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="my-6 pt-6">
2-
<h2 class="mb-2 font-mktg h1">{% data ui.product_landing.communities_using_discussions %}</h2>
2+
<h2 class="mb-2 font-mktg h1" id="community-examples"><a href="#community-examples">{% data ui.product_landing.communities_using_discussions %}</a></h2>
33

44
<div class="d-flex flex-wrap gutter">
55
{% render discussions-community-card for productCommunityExamples as example %}
@@ -13,4 +13,4 @@ <h3 class="text-normal">{% data ui.product_landing.sorry %} <strong class="js-fi
1313
<p class="my-3 f4">{% data ui.product_landing.no_example %} <br>{% data ui.product_landing.try_another %}</p>
1414
<a href="https://github.com/github/docs/blob/main/data/variables/discussions_community_examples.yml">{% data ui.product_landing.add_your_community %} {% octicon "arrow-right" %}</a>
1515
</div>
16-
</div>
16+
</div>

includes/product-articles-list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% if currentProductTree.page.shortTitle and currentProductTree.page.shortTitle != '' %}{% assign productTitle = currentProductTree.page.shortTitle %}{% else %}{% assign productTitle = currentProductTree.page.title %}{% endif %}
44

55
<div class="py-6 all-articles-list">
6-
<h2 class="font-mktg mb-4">All {{ productTitle }} docs</h2>
6+
<h2 class="font-mktg mb-4" id="all-docs"><a href="#all-docs">All {{ productTitle }} docs</a></h2>
77

88
<div class="d-flex gutter flex-wrap">
99
{% for childPage in currentProductTree.childPages %}

includes/sponsor-examples.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="my-6 pt-6">
2-
<h2 class="mb-2 font-mktg h1">{% data ui.product_landing.sponsor_community %}</h2>
2+
<h2 class="mb-2 font-mktg h1" id="community-examples"><a href="#community-examples">{% data ui.product_landing.sponsor_community %}</a></h2>
33

44
<div class="d-flex flex-wrap gutter">
55
{% render sponsors-community-card for productUserExamples as example %}

layouts/product-landing.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% include header %}
1010
{% include deprecation-banner %}
1111

12-
<div class="container-xl px-3 px-md-6 pt-3 pb-2">
12+
<div class="container-xl px-3 px-md-6 pt-3 pb-2 product-landing">
1313
<header class="d-lg-flex gutter-lg mb-6">
1414
<div class="{% if page.product_video and page.product_video != '' %}col-12 col-lg-6 mb-3 mb-lg-0{% endif %}">
1515
<span class="text-mono color-text-secondary">Product</span>
@@ -54,7 +54,7 @@ <h1 class="mb-3 font-mktg">
5454
<div class="d-lg-flex gutter my-6 py-6">
5555
<div class="col-12 col-lg-{% if page.changelog %}4{% else %}6{% endif %} mb-4 mb-lg-0">
5656
<div class="featured-links-heading mb-4 d-flex flex-items-baseline">
57-
<h3 class="f4 text-normal text-mono text-uppercase color-text-secondary">{% data ui.toc.guides %}</h3>
57+
<h3 class="f4 text-normal text-mono text-uppercase color-text-secondary" id="guides"><a href="#guides">{% data ui.toc.guides %}</a></h3>
5858
{% unless currentCategory %}
5959
<a href="{{ currentPath }}/guides" class="ml-4">View all {% octicon "arrow-right" height="14" class="v-align-middle" %}</a>
6060
{% endunless %}
@@ -73,7 +73,7 @@ <h4 class="link-with-intro-title mb-1">{{ link.title }}<span class="Bump-link-sy
7373

7474
<div class="col-12 col-lg-{% if page.changelog %}4{% else %}6{% endif %} mb-4 mb-lg-0">
7575
<div class="featured-links-heading mb-4 d-flex flex-items-baseline">
76-
<h3 class="f4 text-normal text-mono text-uppercase color-text-secondary">{% data ui.toc.popular_articles %}</h3>
76+
<h3 class="f4 text-normal text-mono text-uppercase color-text-secondary" id="popular"><a href="#popular">{% data ui.toc.popular_articles %}</a></h3>
7777
</div>
7878
<ul class="list-style-none">
7979
{% for link in featuredLinks.popular %}
@@ -89,7 +89,7 @@ <h2 class="link-with-intro-title f5">{{ link.title }}<span class="Bump-link-symb
8989
{% if page.changelog %}
9090
<div class="col-12 col-lg-4 mb-4 mb-lg-0">
9191
<div class="featured-links-heading mb-4 d-flex flex-items-baseline">
92-
<h3 class="f4 text-normal text-mono text-uppercase color-text-secondary">{% data ui.toc.whats_new %}</h3>
92+
<h3 class="f4 text-normal text-mono text-uppercase color-text-secondary" id="whats-new"><a href="#whats-new">{% data ui.toc.whats_new %}</a></h3>
9393
<a href="{{ changelogUrl }}" class="ml-4">View all {% octicon "arrow-right" height="14" class="v-align-middle" %}</a>
9494
</div>
9595
<ul class="list-style-none">
@@ -127,7 +127,7 @@ <h4>{{ link.title }} <span class="Bump-link-symbol">→</span></h4>
127127
{% if featuredLinks.guideCards %}
128128
<div class="bg-guides-gradient py-6">
129129
<div class="container-xl px-3 px-md-6 my-6">
130-
<h2 class="font-mktg h1 mb-2">Guides</h2>
130+
<h2 class="font-mktg h1 mb-2" id="guides-2"><a href="#guides-2">Guides</a></h2>
131131

132132
<div class="d-lg-flex gutter-lg flex-items-stretch">
133133
{% assign guideCards = featuredLinks.guideCards %}

layouts/product-sublanding.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ <h3 class="font-mktg h3-mktg my-4 color-text-primary">{{ guide.title }}</h3>
6060
{% assign learningTracks = page.learningTracks %}
6161
{% if learningTracks and learningTracks.size > 0 %}
6262
<div class="border-top py-6">
63-
<h2 class="mb-3 font-mktg">{% data ui.product_sublanding.learning_paths %}</h2>
63+
<h2 class="mb-3 font-mktg" id="learning-paths"><a href="#learning-paths">{% data ui.product_sublanding.learning_paths %}</a></h2>
6464
<div class="lead-mktg color-text-secondary f4 description-text">{% data ui.product_sublanding.learning_paths_desc %}</div>
6565

6666
<!-- Learning tracks -->

0 commit comments

Comments
 (0)