Skip to content

Commit

Permalink
Allow an individual page to disable repo-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonstyle committed Aug 10, 2023
1 parent 2067602 commit e8d348e
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 14 deletions.
1 change: 1 addition & 0 deletions news/changelog-1.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
- ([#5932](https://github.com/quarto-dev/quarto-cli/issues/5932)): Correct Open Graph metadata key name for `og:site_name`
- Add support for `bread-crumbs: true|false` to control whether bread crumbs are displayed. Add support for display of breadcrumbs on full width (non-mobile) pages when `bread-crumbs` is true. Default value is true.
- ([#6432](https://github.com/quarto-dev/quarto-cli/issues/6432)): Don't decorate navigation tools with external link icon (we generally don't decorate navigation chrome in this way)
- Add support for setting `repo-actions: false` in a document to prevent the display of repository actions on a specific page.

## Books

Expand Down
9 changes: 7 additions & 2 deletions src/project/types/website/website-navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,13 @@ function handleRepoLinks(
language: FormatLanguage,
config?: ProjectConfig,
) {
// Don't process repo-actions if document disables it
if (format.metadata[kSiteRepoActions] === false) {
return;
}

const forceRepoActions = format.metadata[kSiteRepoActions] === true;

const repoActions = websiteConfigActions(
kSiteRepoActions,
kWebsite,
Expand All @@ -595,8 +602,6 @@ function handleRepoLinks(
repoActions.push("issue");
}

const forceRepoActions = format.metadata[kSiteRepoActions] === true;

const elRepoSource = doc.querySelector(
"[" + kDataQuartoSourceUrl + '="repo"]',
);
Expand Down
19 changes: 15 additions & 4 deletions src/resources/editor/tools/vs-code.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17528,6 +17528,16 @@ var require_yaml_intelligence_resources = __commonJS({
default: true,
description: "Setting this to false prevents this document from being included in searches."
},
{
name: "repo-actions",
schema: "boolean",
tags: {
formats: [
"$html-doc"
]
},
description: "Setting this to false prevents the `repo-actions` from appearing on this page."
},
{
name: "aliases",
schema: {
Expand Down Expand Up @@ -21578,7 +21588,8 @@ var require_yaml_intelligence_resources = __commonJS({
},
"Disambiguating year suffix in author-date styles (e.g. \u201Ca\u201D in \u201CDoe,\n1999a\u201D).",
"Manuscript configuration",
"internal-schema-hack"
"internal-schema-hack",
"Setting this to false prevents the <code>repo-actions</code> from\nappearing on this page."
],
"schema/external-schemas.yml": [
{
Expand Down Expand Up @@ -21802,12 +21813,12 @@ var require_yaml_intelligence_resources = __commonJS({
mermaid: "%%"
},
"handlers/mermaid/schema.yml": {
_internalId: 162244,
_internalId: 162382,
type: "object",
description: "be an object",
properties: {
"mermaid-format": {
_internalId: 162236,
_internalId: 162374,
type: "enum",
enum: [
"png",
Expand All @@ -21823,7 +21834,7 @@ var require_yaml_intelligence_resources = __commonJS({
exhaustiveCompletions: true
},
theme: {
_internalId: 162243,
_internalId: 162381,
type: "anyOf",
anyOf: [
{
Expand Down
19 changes: 15 additions & 4 deletions src/resources/editor/tools/yaml/web-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions src/resources/editor/tools/yaml/yaml-intelligence-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -10500,6 +10500,16 @@
"default": true,
"description": "Setting this to false prevents this document from being included in searches."
},
{
"name": "repo-actions",
"schema": "boolean",
"tags": {
"formats": [
"$html-doc"
]
},
"description": "Setting this to false prevents the `repo-actions` from appearing on this page."
},
{
"name": "aliases",
"schema": {
Expand Down Expand Up @@ -14550,7 +14560,8 @@
},
"Disambiguating year suffix in author-date styles (e.g.&nbsp;“a” in “Doe,\n1999a”).",
"Manuscript configuration",
"internal-schema-hack"
"internal-schema-hack",
"Setting this to false prevents the <code>repo-actions</code> from\nappearing on this page."
],
"schema/external-schemas.yml": [
{
Expand Down Expand Up @@ -14774,12 +14785,12 @@
"mermaid": "%%"
},
"handlers/mermaid/schema.yml": {
"_internalId": 162244,
"_internalId": 162382,
"type": "object",
"description": "be an object",
"properties": {
"mermaid-format": {
"_internalId": 162236,
"_internalId": 162374,
"type": "enum",
"enum": [
"png",
Expand All @@ -14795,7 +14806,7 @@
"exhaustiveCompletions": true
},
"theme": {
"_internalId": 162243,
"_internalId": 162381,
"type": "anyOf",
"anyOf": [
{
Expand Down
6 changes: 6 additions & 0 deletions src/resources/schema/document-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
default: true
description: Setting this to false prevents this document from being included in searches.

- name: repo-actions
schema: boolean
tags:
formats: [$html-doc]
description: Setting this to false prevents the `repo-actions` from appearing on this page.

- name: aliases
schema:
arrayOf: string
Expand Down

0 comments on commit e8d348e

Please sign in to comment.