astro-accelerator 0.0.21 → 0.0.23
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/package.json +1 -1
- package/src/pages/index.md +1 -1
- package/src/pages/report/missing-banner.astro +0 -6
- package/src/pages/report/missing-meta.astro +0 -6
- package/src/pages/report/missing-pubdate.astro +0 -7
- package/src/pages/report/oldest-content.astro +0 -6
- package/src/pages/report/taxonomy.astro +0 -1
- package/src/themes/accelerator/components/HtmlHead.astro +3 -1
- package/src/themes/accelerator/utilities/Markdown.ts +5 -0
package/package.json
CHANGED
package/src/pages/index.md
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
import t from '@util/language.json';
|
|
3
|
-
import { Lang } from '@util/Languages';
|
|
4
|
-
|
|
5
|
-
import type { Page, MarkdownInstance } from 'astro';
|
|
6
|
-
|
|
7
|
-
import type { Frontmatter } from '@config';
|
|
8
2
|
import { sortByPubDateDesc } from '@util/PageTypeFilters';
|
|
9
3
|
import { getPages } from '@util/PageQueries';
|
|
10
4
|
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
import t from '@util/language.json';
|
|
3
|
-
import { Lang } from '@util/Languages';
|
|
4
|
-
|
|
5
|
-
import type { Page, MarkdownInstance } from 'astro';
|
|
6
|
-
|
|
7
|
-
import type { Frontmatter } from '@config';
|
|
8
2
|
import { sortByPubDateDesc } from '@util/PageTypeFilters';
|
|
9
3
|
import { getPages } from '@util/PageQueries';
|
|
10
4
|
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
import t from '@util/language.json';
|
|
3
|
-
import { Lang } from '@util/Languages';
|
|
4
|
-
|
|
5
|
-
import type { Page, MarkdownInstance } from 'astro';
|
|
6
|
-
|
|
7
|
-
import type { Frontmatter } from '@config';
|
|
8
|
-
import { sortByPubDateDesc } from '@util/PageTypeFilters';
|
|
9
2
|
import { getPages } from '@util/PageQueries';
|
|
10
3
|
|
|
11
4
|
// Logic
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
import t from '@util/language.json';
|
|
3
|
-
import { Lang } from '@util/Languages';
|
|
4
|
-
|
|
5
|
-
import type { Page, MarkdownInstance } from 'astro';
|
|
6
|
-
|
|
7
|
-
import type { Frontmatter } from '@config';
|
|
8
2
|
import { sortByModDate } from '@util/PageTypeFilters';
|
|
9
3
|
import { getPages } from '@util/PageQueries';
|
|
10
4
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { SITE, OPEN_GRAPH, HEADER_SCRIPTS, Frontmatter } from '@config';
|
|
3
3
|
import { addSlashToUrl } from '@util/Url';
|
|
4
|
+
import { getTextFrom } from '@util/Markdown';
|
|
4
5
|
|
|
5
6
|
// Properties
|
|
6
7
|
type Props = {
|
|
@@ -16,10 +17,11 @@ const imageAlt = frontmatter.bannerImage?.alt ?? OPEN_GRAPH.image.alt;
|
|
|
16
17
|
const robots = frontmatter.robots ?? 'index, follow';
|
|
17
18
|
const canonicalImageSrc = new URL(imageSrc, Astro.site);
|
|
18
19
|
const canonicalURL = addSlashToUrl(new URL(Astro.url.pathname, Astro.site + SITE.subfolder));
|
|
20
|
+
const title = await getTextFrom( frontmatter.title ? `${ frontmatter.title } | ${ SITE.title }` : SITE.title);
|
|
19
21
|
---
|
|
20
22
|
<head>
|
|
21
23
|
<meta charset="utf-8" />
|
|
22
|
-
<title>{
|
|
24
|
+
<title>{ title }</title>
|
|
23
25
|
<meta name="robots" content={ 'max-image-preview:large, ' + robots }>
|
|
24
26
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
25
27
|
<meta name="keywords" content={ frontmatter.keywords }>
|
|
@@ -23,3 +23,8 @@ export async function getHtmlFrom(markdown: string): Promise<string> {
|
|
|
23
23
|
|
|
24
24
|
return String(vfile);
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
export async function getTextFrom(markdown: string): Promise<string> {
|
|
28
|
+
const html = await getInlineHtmlFrom(markdown);
|
|
29
|
+
return html.replace(/<.*?>/g, '');
|
|
30
|
+
}
|