Skip to content

Commit 83e8443

Browse files
authored
Merge pull request #1708 from quarto-dev/sync-1706-to-prerelease
[Sync to prerelease] Add linkate
2 parents 88e37c6 + cf76cba commit 83e8443

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

.github/workflows/preview.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,26 @@ jobs:
155155
if (changedFiles.length > 0) {
156156
commentBody += `### 🔄 Modified Documents\n\n`;
157157
changedFiles.forEach(file => {
158-
if (file.endsWith('.qmd') || file.endsWith('.md')) {
158+
let fileUrlPath;
159+
160+
// Define a mapping for special files to their corresponding URLs
161+
const specialFileMapping = {
162+
'docs/extensions/listings/shortcodes-and-filters.yml': 'docs/extensions/index.html',
163+
'docs/extensions/listings/journal-articles.yml': 'docs/extensions/index.html',
164+
'docs/extensions/listings/custom-formats.yml': 'docs/extensions/index.html',
165+
'docs/extensions/listings/revealjs-formats.yml': 'docs/extensions/index.html',
166+
'docs/extensions/listings/revealjs.yml': 'docs/extensions/index.html'
167+
};
168+
169+
// Check if the file is in the special mapping
170+
if (specialFileMapping[file]) {
171+
fileUrlPath = specialFileMapping[file];
172+
} else if (file.endsWith('.qmd') || file.endsWith('.md')) {
159173
// Convert path to URL (removing file extension and adding appropriate path)
160-
const fileUrlPath = file
161-
.replace(/\.(qmd|md)$/, '.html');
174+
fileUrlPath = file.replace(/\.(qmd|md)$/, '.html');
175+
}
176+
177+
if (fileUrlPath) {
162178
const fileUrl = `${deployUrl}/${fileUrlPath}`;
163179
commentBody += `- [${file}](${fileUrl})\n`;
164180
}

docs/extensions/listings/shortcodes-and-filters.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,12 @@
374374
documents (`format: html`) similar as how [`code-line-numbers`](https://quarto.org/docs/reference/formats/html.html#code)
375375
works for RevealJs.
376376
377+
- name: linkate
378+
path: https://github.com/coatless-quarto/linkate
379+
author: '[James Joseph Balamuta](https://github.com/coatless/)'
380+
description: >
381+
Automatically collect all URLs in a document and place them at the end under a "Links" section.
382+
377383
- name: lordicon
378384
path: https://github.com/jmgirard/lordicon
379385
author: '[Jeffrey Girard](https://github.com/jmgirard)'

0 commit comments

Comments
 (0)