Skip to content

Commit

Permalink
Theme: Implement docsearch:amethyst_pagetype_navigation=1
Browse files Browse the repository at this point in the history
This aids docsearch-scraper (e.g. for Typesense, Melisearch,
or Algolia) by offering a way to exclude these navigation overview
pages.

The current qunitjs.com site gets around this by luck.
It uses jekyll-algolia to index the site proactively during deployment
before the final pages are built, and the content that jekyll sees
on "group" and other overview pages is the empty string, since the
"content" there is effectively generated by the layout template in
the next phase.
  • Loading branch information
Krinkle committed Apr 7, 2023
1 parent c01ecce commit 61c08f8
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions _includes/opengraph.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,11 @@
{% endif %}
<meta name="twitter:card" content="summary_large_image">


{% if layout.amethyst.pagetype == "navigation" %}
<meta name="robots" content="{{ layout.amethyst.robots | default: 'noindex,follow' }}">
<meta name="docsearch:amethyst_pagetype_navigation" content="1">
{% endif %}

{% endcapture -%}
{{ opengraph | strip_newlines }}
1 change: 1 addition & 0 deletions _layouts/group.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
amethyst:
toc: false
prepend_description_heading: false
pagetype: navigation

# Parameters:
#
Expand Down
2 changes: 2 additions & 0 deletions _layouts/posts-archive.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
layout: wrapper
amethyst:
pagetype: navigation
---

<div class="main main--columns wrapper">
Expand Down
2 changes: 2 additions & 0 deletions _layouts/posts-author.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
layout: wrapper
amethyst:
pagetype: navigation
---

<div class="main main--columns wrapper">
Expand Down
2 changes: 2 additions & 0 deletions _layouts/posts-tag.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
layout: wrapper
amethyst:
pagetype: navigation
---

<div class="main main--columns wrapper">
Expand Down
2 changes: 2 additions & 0 deletions _layouts/posts-year.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
layout: wrapper
amethyst:
pagetype: navigation
---

<div class="main main--columns wrapper">
Expand Down
3 changes: 3 additions & 0 deletions _layouts/posts.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
layout: wrapper
amethyst:
pagetype: navigation
robots: index
---

<div class="main main--columns wrapper">
Expand Down

0 comments on commit 61c08f8

Please sign in to comment.