add script to create links on topic landing page for first doc that use the doc's title
Change-Id: Iec86a5b9fa7dcd9246d6e8958f17e0022e0963a8
This commit is contained in:
@@ -195,11 +195,15 @@ false; // navigate across topic boundaries only in design docs
|
|||||||
|
|
||||||
if ($selListItem.hasClass('nav-section')) {
|
if ($selListItem.hasClass('nav-section')) {
|
||||||
// we're on an index page, jump to the first topic
|
// we're on an index page, jump to the first topic
|
||||||
$nextLink = $selListItem.find('ul').find('a:eq(0)');
|
$nextLink = $selListItem.find('ul:eq(0)').find('a:eq(0)');
|
||||||
|
|
||||||
// if there aren't any children, go to the next section (required for About pages)
|
// if there aren't any children, go to the next section (required for About pages)
|
||||||
if($nextLink.length == 0) {
|
if($nextLink.length == 0) {
|
||||||
$nextLink = $selListItem.next('li').find('a');
|
$nextLink = $selListItem.next('li').find('a');
|
||||||
|
} else if ($('.topic-start-link').length) {
|
||||||
|
// as long as there's a child link and there is a "topic start link" (we're on a landing)
|
||||||
|
// then set the landing page "start link" text to be the first doc title
|
||||||
|
$('.topic-start-link').text($nextLink.text().toUpperCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle some Training specialties
|
// Handle some Training specialties
|
||||||
|
@@ -53,7 +53,7 @@
|
|||||||
<h1 itemprop="name" style="margin-bottom:0;"><?cs var:page.title ?></h1>
|
<h1 itemprop="name" style="margin-bottom:0;"><?cs var:page.title ?></h1>
|
||||||
<p itemprop="description"><?cs var:page.landing.intro ?></p>
|
<p itemprop="description"><?cs var:page.landing.intro ?></p>
|
||||||
|
|
||||||
<p><a href="<?cs var:page.landing.next ?>" class="next-page-link">LEARN MORE</a></p>
|
<p><a class="next-page-link topic-start-link"></a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?cs else ?>
|
<?cs else ?>
|
||||||
|
Reference in New Issue
Block a user