@astrojs/starlight 0.37.0 → 0.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -1
- package/package.json +1 -1
- package/translations/el.json +30 -0
- package/translations/index.ts +2 -0
- package/utils/head.ts +4 -1
- package/utils/navigation.ts +3 -5
- package/utils/url.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @astrojs/starlight
|
|
2
2
|
|
|
3
|
+
## 0.37.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#3647](https://github.com/withastro/starlight/pull/3647) [`9f4efc3`](https://github.com/withastro/starlight/commit/9f4efc3c59ee41038b7c0550230a10bb35ad0e50) Thanks [@gerstenbergit](https://github.com/gerstenbergit)! - Adds Greek language support
|
|
8
|
+
|
|
9
|
+
## 0.37.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#3603](https://github.com/withastro/starlight/pull/3603) [`30f6e7f`](https://github.com/withastro/starlight/commit/30f6e7fa83ca0a248b1b59d616f55a6f933334a2) Thanks [@delucis](https://github.com/delucis)! - Fixes support for providing an absolute URL to Starlight’s `favicon` configuration option
|
|
14
|
+
|
|
3
15
|
## 0.37.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -11,7 +23,14 @@
|
|
|
11
23
|
If you want to preserve the previous styling, you can add the following [custom CSS](https://starlight.astro.build/guides/css-and-tailwind/#custom-css-styles) to your site:
|
|
12
24
|
|
|
13
25
|
```css
|
|
14
|
-
p,
|
|
26
|
+
p,
|
|
27
|
+
h1,
|
|
28
|
+
h2,
|
|
29
|
+
h3,
|
|
30
|
+
h4,
|
|
31
|
+
h5,
|
|
32
|
+
h6,
|
|
33
|
+
code {
|
|
15
34
|
overflow-wrap: anywhere;
|
|
16
35
|
}
|
|
17
36
|
```
|
package/package.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skipLink.label": "Μετάβαση στο περιεχόμενο",
|
|
3
|
+
"search.label": "Αναζήτηση",
|
|
4
|
+
"search.ctrlKey": "Ctrl",
|
|
5
|
+
"search.cancelLabel": "Ακύρωση",
|
|
6
|
+
"search.devWarning": "Η αναζήτηση είναι διαθέσιμη μόνο σε builds παραγωγής.\nΔοκίμασε να κάνεις build τον ιστότοπο και να τον προεπισκοπήσεις για να τον ελέγξεις τοπικά.",
|
|
7
|
+
"themeSelect.accessibleLabel": "Επιλογή χρωματικού θέματος",
|
|
8
|
+
"themeSelect.dark": "Σκοτεινό",
|
|
9
|
+
"themeSelect.light": "Φωτεινό",
|
|
10
|
+
"themeSelect.auto": "Σύστημα",
|
|
11
|
+
"languageSelect.accessibleLabel": "Επιλογή γλώσσας",
|
|
12
|
+
"menuButton.accessibleLabel": "Μενού",
|
|
13
|
+
"sidebarNav.accessibleLabel": "Κύρια πλοήγηση",
|
|
14
|
+
"tableOfContents.onThisPage": "Σε αυτή τη σελίδα",
|
|
15
|
+
"tableOfContents.overview": "Επισκόπηση",
|
|
16
|
+
"i18n.untranslatedContent": "Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.",
|
|
17
|
+
"page.editLink": "Επεξεργασία σελίδας",
|
|
18
|
+
"page.lastUpdated": "Τελευταία ενημέρωση:",
|
|
19
|
+
"page.previousLink": "Προηγούμενη σελίδα",
|
|
20
|
+
"page.nextLink": "Επόμενη σελίδα",
|
|
21
|
+
"page.draft": "Αυτό το περιεχόμενο είναι πρόχειρο και δεν θα περιλαμβάνεται στα builds παραγωγής.",
|
|
22
|
+
"404.text": "Η σελίδα δεν βρέθηκε. Έλεγξε το URL ή χρησιμοποίησε τη γραμμή αναζήτησης.",
|
|
23
|
+
"aside.note": "Σημείωση",
|
|
24
|
+
"aside.tip": "Συμβουλή",
|
|
25
|
+
"aside.caution": "Προσοχή",
|
|
26
|
+
"aside.danger": "Κίνδυνος",
|
|
27
|
+
"fileTree.directory": "Φάκελος",
|
|
28
|
+
"builtWithStarlight.label": "Δημιουργήθηκε με το Starlight",
|
|
29
|
+
"heading.anchorLabel": "Ενότητα με τίτλο «{{title}}»"
|
|
30
|
+
}
|
package/translations/index.ts
CHANGED
|
@@ -31,6 +31,7 @@ import pl from './pl.json';
|
|
|
31
31
|
import sk from './sk.json';
|
|
32
32
|
import lv from './lv.json';
|
|
33
33
|
import hu from './hu.json';
|
|
34
|
+
import el from './el.json';
|
|
34
35
|
|
|
35
36
|
const { parse } = builtinI18nSchema();
|
|
36
37
|
|
|
@@ -68,5 +69,6 @@ export default Object.fromEntries(
|
|
|
68
69
|
sk,
|
|
69
70
|
lv,
|
|
70
71
|
hu,
|
|
72
|
+
el,
|
|
71
73
|
}).map(([key, dict]) => [key, parse(dict)])
|
|
72
74
|
);
|
package/utils/head.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { PageProps, RouteDataContext } from './routing/data';
|
|
|
6
6
|
import { fileWithBase } from './base';
|
|
7
7
|
import { formatCanonical } from './canonical';
|
|
8
8
|
import { localizedUrl } from './localizedUrl';
|
|
9
|
+
import { isAbsoluteUrl } from './url';
|
|
9
10
|
|
|
10
11
|
const HeadSchema = HeadConfigSchema({ source: 'content' });
|
|
11
12
|
|
|
@@ -46,7 +47,9 @@ export function getHead(
|
|
|
46
47
|
tag: 'link',
|
|
47
48
|
attrs: {
|
|
48
49
|
rel: 'shortcut icon',
|
|
49
|
-
href:
|
|
50
|
+
href: isAbsoluteUrl(config.favicon.href)
|
|
51
|
+
? config.favicon.href
|
|
52
|
+
: fileWithBase(config.favicon.href),
|
|
50
53
|
type: config.favicon.type,
|
|
51
54
|
},
|
|
52
55
|
},
|
package/utils/navigation.ts
CHANGED
|
@@ -29,6 +29,7 @@ import type {
|
|
|
29
29
|
SidebarEntry,
|
|
30
30
|
} from './routing/types';
|
|
31
31
|
import { localeToLang, localizedId, slugToPathname } from './slugs';
|
|
32
|
+
import { isAbsoluteUrl } from './url';
|
|
32
33
|
import type { StarlightConfig } from './user-config';
|
|
33
34
|
|
|
34
35
|
const DirKey = Symbol('DirKey');
|
|
@@ -124,13 +125,10 @@ function groupFromAutogenerateConfig(
|
|
|
124
125
|
};
|
|
125
126
|
}
|
|
126
127
|
|
|
127
|
-
/** Check if a string starts with one of `http://` or `https://`. */
|
|
128
|
-
const isAbsolute = (link: string) => /^https?:\/\//.test(link);
|
|
129
|
-
|
|
130
128
|
/** Create a link entry from a manual link item in user config. */
|
|
131
129
|
function linkFromSidebarLinkItem(item: SidebarLinkItem, locale: string | undefined) {
|
|
132
130
|
let href = item.link;
|
|
133
|
-
if (!
|
|
131
|
+
if (!isAbsoluteUrl(href)) {
|
|
134
132
|
href = ensureLeadingSlash(href);
|
|
135
133
|
// Inject current locale into link.
|
|
136
134
|
if (locale) href = '/' + locale + href;
|
|
@@ -186,7 +184,7 @@ function makeSidebarLink(
|
|
|
186
184
|
badge?: Badge,
|
|
187
185
|
attrs?: LinkHTMLAttributes
|
|
188
186
|
): SidebarLink {
|
|
189
|
-
if (!
|
|
187
|
+
if (!isAbsoluteUrl(href)) {
|
|
190
188
|
href = formatPath(href);
|
|
191
189
|
}
|
|
192
190
|
return makeLink({ label, href, badge, attrs });
|
package/utils/url.ts
ADDED