Skip to content

Commit 8804193

Browse files
Merge pull request #4 from JaneliaSciComp/updates_external_links
updates external links
2 parents 350d8e6 + e05ad7d commit 8804193

File tree

5 files changed

+81
-2
lines changed

5 files changed

+81
-2
lines changed

astro.config.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
// @ts-check
22
import { defineConfig } from 'astro/config';
33
import starlight from '@astrojs/starlight';
4+
import rehypeExternalLinks from 'rehype-external-links';
5+
import { externalLinkIcon } from './external-link-icon.js';
46

57
// https://astro.build/config
68
export default defineConfig({
79
site: 'https://JaneliaSciComp.github.io',
810
base: '/fileglancer-user-docs',
11+
markdown: {
12+
rehypePlugins: [
13+
[rehypeExternalLinks, {
14+
target: '_blank',
15+
rel: ['noopener', 'noreferrer'],
16+
content: externalLinkIcon
17+
}]
18+
]
19+
},
920
integrations: [
1021
starlight({
1122
title: 'Fileglancer User Guide',

external-link-icon.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* External link icon for rehype-external-links plugin.
3+
*
4+
* This SVG is defined using the hast (Hypertext Abstract Syntax Tree) format,
5+
* which is the AST format used by rehype plugins. The rehype-external-links
6+
* plugin expects content to be provided as a hast node, not as raw HTML/SVG markup.
7+
*
8+
* The icon uses Starlight's built-in "external" icon design.
9+
*/
10+
export const externalLinkIcon = {
11+
type: 'element',
12+
tagName: 'svg',
13+
properties: {
14+
width: '1em',
15+
height: '1em',
16+
viewBox: '0 0 24 24',
17+
fill: 'currentColor',
18+
style: 'display: inline-block; vertical-align: text-bottom; margin-left: 0.25em;'
19+
},
20+
children: [
21+
{
22+
type: 'element',
23+
tagName: 'path',
24+
properties: {
25+
d: 'M19.33 10.18a1 1 0 0 1-.77 0 1 1 0 0 1-.62-.93l.01-1.83-8.2 8.2a1 1 0 0 1-1.41-1.42l8.2-8.2H14.7a1 1 0 0 1 0-2h4.25a1 1 0 0 1 1 1v4.25a1 1 0 0 1-.62.93Z'
26+
}
27+
},
28+
{
29+
type: 'element',
30+
tagName: 'path',
31+
properties: {
32+
d: 'M11 4a1 1 0 1 1 0 2H7a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h4Z'
33+
}
34+
}
35+
]
36+
};

package-lock.json

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"dependencies": {
1313
"@astrojs/starlight": "^0.36.0",
1414
"astro": "^5.6.1",
15+
"rehype-external-links": "^3.0.0",
1516
"sharp": "^0.34.2"
1617
}
17-
}
18+
}

src/content/docs/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ If you encounter issues or need assistance, chat with us in the [#fileglancer-su
6464

6565
## Interested in using Fileglancer outside of Janelia?
6666

67-
We welcome interest from other institutions and are excited to collaborate on making Fileglancer more broadly accessible! While the application was initially developed for use at Janelia, were eager to help adapt it for different environments. If youd like to use Fileglancer at your organization, or have ideas for improvements, we encourage you to [open an issue](https://github.com/JaneliaSciComp/fileglancer/issues) or [submit a pull request](https://github.com/JaneliaSciComp/fileglancer/pulls). Your feedback and contributions are greatly appreciated and will help to make Fileglancer even better for the scientific community!
67+
We welcome interest from other institutions and are excited to collaborate on making Fileglancer more broadly accessible! While the application was initially developed for use at Janelia, we're eager to help adapt it for different environments. If you'd like to use Fileglancer at your organization, or have ideas for improvements, we encourage you to [open an issue](https://github.com/JaneliaSciComp/fileglancer/issues) or [submit a pull request](https://github.com/JaneliaSciComp/fileglancer/pulls). Your feedback and contributions are greatly appreciated and will help to make Fileglancer even better for the scientific community!

0 commit comments

Comments
 (0)