Skip to content

Commit 8c0cf32

Browse files
authored
Add rel attribute to navitem links (#3333)
* NF: Add rel attribute to navitem links * Add link.rel to about links
1 parent 5c555dd commit 8c0cf32

File tree

9 files changed

+43
-14
lines changed

9 files changed

+43
-14
lines changed

news/changelog-1.3.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@
3636
- Work around pandoc strict checking of `number-offset` type. ([#3126](https://github.com/quarto-dev/quarto-cli/issues/3126))
3737
- Warn instead of crash on bad URI ([#3220](https://github.com/quarto-dev/quarto-cli/issues/3220))
3838
- ensure `video` shortcode works with `embed-resources` and `self-contained` ([#3310](https://github.com/quarto-dev/quarto-cli/issues/3310))
39+
- Add optional `rel` attribute to navigation links ([#3212](https://github.com/quarto-dev/quarto-cli/issues/3212))

src/resources/editor/tools/vs-code.mjs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8334,6 +8334,11 @@ var require_yaml_intelligence_resources = __commonJS({
83348334
string: {
83358335
description: "Alias for href\n"
83368336
}
8337+
},
8338+
rel: {
8339+
string: {
8340+
description: "Value for rel attribute. Multiple space-separated values are permitted.\nSee <https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel>\nfor a details.\n"
8341+
}
83378342
}
83388343
}
83398344
}
@@ -17474,6 +17479,7 @@ var require_yaml_intelligence_resources = __commonJS({
1747417479
},
1747517480
"Text to display for item (defaults to the document title if not\nprovided)",
1747617481
"Alias for href",
17482+
'Value for rel attribute. Multiple space-separated values are\npermitted. See <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel" class="uri">https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel</a>\nfor a details.',
1747717483
"The Github repo that will be used to store comments.",
1747817484
"The label that will be assigned to issues created by Utterances.",
1747917485
{
@@ -19019,7 +19025,7 @@ var require_yaml_intelligence_resources = __commonJS({
1901919025
long: "Embed math libraries (e.g.&nbsp;MathJax) within\n<code>self-contained</code> output. Note that math libraries are not\nembedded by default because they are quite large and often time\nconsuming to download."
1902019026
},
1902119027
"Specify executables or Lua scripts to be used as a filter\ntransforming the pandoc AST after the input is parsed and before the\noutput is written.",
19022-
"Speicfy Lua scripts that implement shortcode handlers",
19028+
"Specify Lua scripts that implement shortcode handlers",
1902319029
"Keep the markdown file generated by executing code",
1902419030
"Keep the notebook file generated from executing code.",
1902519031
"Filters to pre-process ipynb files before rendering to markdown",
@@ -20067,12 +20073,12 @@ var require_yaml_intelligence_resources = __commonJS({
2006720073
mermaid: "%%"
2006820074
},
2006920075
"handlers/mermaid/schema.yml": {
20070-
_internalId: 133537,
20076+
_internalId: 133541,
2007120077
type: "object",
2007220078
description: "be an object",
2007320079
properties: {
2007420080
"mermaid-format": {
20075-
_internalId: 133536,
20081+
_internalId: 133540,
2007620082
type: "enum",
2007720083
enum: [
2007820084
"png",

src/resources/editor/tools/yaml/web-worker.js

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/editor/tools/yaml/yaml-intelligence-resources.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,11 @@
13101310
"string": {
13111311
"description": "Alias for href\n"
13121312
}
1313+
},
1314+
"rel": {
1315+
"string": {
1316+
"description": "Value for rel attribute. Multiple space-separated values are permitted.\nSee <https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel>\nfor a details.\n"
1317+
}
13131318
}
13141319
}
13151320
}
@@ -10450,6 +10455,7 @@
1045010455
},
1045110456
"Text to display for item (defaults to the document title if not\nprovided)",
1045210457
"Alias for href",
10458+
"Value for rel attribute. Multiple space-separated values are\npermitted. See <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel\" class=\"uri\">https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel</a>\nfor a details.",
1045310459
"The Github repo that will be used to store comments.",
1045410460
"The label that will be assigned to issues created by Utterances.",
1045510461
{
@@ -11995,7 +12001,7 @@
1199512001
"long": "Embed math libraries (e.g.&nbsp;MathJax) within\n<code>self-contained</code> output. Note that math libraries are not\nembedded by default because they are quite large and often time\nconsuming to download."
1199612002
},
1199712003
"Specify executables or Lua scripts to be used as a filter\ntransforming the pandoc AST after the input is parsed and before the\noutput is written.",
11998-
"Speicfy Lua scripts that implement shortcode handlers",
12004+
"Specify Lua scripts that implement shortcode handlers",
1199912005
"Keep the markdown file generated by executing code",
1200012006
"Keep the notebook file generated from executing code.",
1200112007
"Filters to pre-process ipynb files before rendering to markdown",
@@ -13043,12 +13049,12 @@
1304313049
"mermaid": "%%"
1304413050
},
1304513051
"handlers/mermaid/schema.yml": {
13046-
"_internalId": 133537,
13052+
"_internalId": 133541,
1304713053
"type": "object",
1304813054
"description": "be an object",
1304913055
"properties": {
1305013056
"mermaid-format": {
13051-
"_internalId": 133536,
13057+
"_internalId": 133540,
1305213058
"type": "enum",
1305313059
"enum": [
1305413060
"png",

src/resources/projects/website/about/_links.ejs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<% if (about.links) { %>
22
<div class="about-links">
33
<% for (const link of about.links) { %>
4-
<a href="<%= link.href %>" class="about-link">
4+
<a href="<%= link.href %>" class="about-link" rel="<%= link.rel %>">
55
<% if (link.icon) { %>
66
<i class="bi <%= link.icon %>"></i>
77
<% } %> <span class="about-link-text"><%= link.text %></span>

src/resources/projects/website/templates/navitem-dropdown.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
<% if (item.href) { %>
44
<li>
5-
<a class="dropdown-item" href="<%- item.href %>"><% partial('navicon.ejs', { item }) %> <span class="dropdown-text"><%- item.text %></span></a>
5+
<a class="dropdown-item" href="<%- item.href %>" rel="<%- item.rel %>"><% partial('navicon.ejs', { item }) %> <span class="dropdown-text"><%- item.text %></span></a>
66
</li>
77
<% } else if (item.menu) { %>
88
<li class="dropdown">
9-
<a class="dropdown-toggle" href="#" id="<%- item.id %>" role="button" data-bs-toggle="dropdown" aria-expanded="false">
9+
<a class="dropdown-toggle" href="#" id="<%- item.id %>" role="button" data-bs-toggle="dropdown" aria-expanded="false" rel="<%- item.rel %>">
1010
<% partial('navicon.ejs', { item }) %> <%- item.text %>
1111
</a>
1212
<ul class="dropdown-menu" aria-labelledby="<%- item.id %>">

src/resources/projects/website/templates/navitem.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
<% if (item.href) { %>
44
<li class="nav-item<%- item.text === undefined ? ' compact' : '' %>">
5-
<a class="nav-link" href="<%- item.href %>"><% partial('navicon.ejs', { item }) %> <span class="menu-text"><%- item.text %></span></a>
5+
<a class="nav-link" href="<%- item.href %>" rel="<%- item.rel %>"><% partial('navicon.ejs', { item }) %> <span class="menu-text"><%- item.text %></span></a>
66
</li>
77
<% } else if (item.menu) { %>
88
<li class="nav-item dropdown <%- item.text === undefined ? ' compact' : '' %>">
9-
<a class="nav-link dropdown-toggle" href="#" id="<%- item.id %>" role="button" data-bs-toggle="dropdown" aria-expanded="false">
9+
<a class="nav-link dropdown-toggle" href="#" id="<%- item.id %>" role="button" data-bs-toggle="dropdown" aria-expanded="false" rel="<%- item.rel %>">
1010
<% partial('navicon.ejs', { item }) %> <span class="menu-text"><%- item.text %></span>
1111
</a>
1212
<ul class="dropdown-menu<%- align === 'end' ? ' dropdown-menu-end' : ''%>" aria-labelledby="<%- item.id %>">

src/resources/schema/definitions.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@
126126
string:
127127
description: |
128128
Alias for href
129+
rel:
130+
string:
131+
description: |
132+
Value for rel attribute. Multiple space-separated values are permitted.
133+
See <https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel>
134+
for a details.
129135
130136
- id: comments
131137
anyOf:

src/resources/types/schema-types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ export type NavigationItemObject = {
7171
See <https://icons.getbootstrap.com/> for a list of available icons */;
7272
id?: string;
7373
menu?: (NavigationItem)[];
74+
rel?:
75+
string /* Value for rel attribute. Multiple space-separated values are permitted.
76+
See <https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel>
77+
for a details. */;
7478
text?: string /* Text to display for item (defaults to the
7579
document title if not provided) */;
7680
url?: string; /* Alias for href */

0 commit comments

Comments
 (0)