Skip to content

Commit 6bf1054

Browse files
committed
Merge branch 'master' into tsirlucas/master
2 parents b33f24c + a024d23 commit 6bf1054

File tree

36 files changed

+165
-191
lines changed

36 files changed

+165
-191
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Installation
1616
uses: bahmutov/npm-install@v1
1717
with:
18-
install-command: yarn install --immutable # Fails if yarn.lock is modified
18+
install-command: yarn install --frozen-lockfile # Fails if yarn.lock is modified
1919
- name: Lint
2020
run: yarn lint:ci
2121
- name: Prettier Code

packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/generateBlogFeed.test.ts.snap

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`blogFeed atom can show feed without posts 1`] = `
4-
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
5-
<feed xmlns=\\"http://www.w3.org/2005/Atom\\">
6-
<id>https://docusaurus.io/blog</id>
7-
<title>Hello Blog</title>
8-
<updated>2015-10-25T23:29:00.000Z</updated>
9-
<generator>https://github.com/jpmonette/feed</generator>
10-
<link rel=\\"alternate\\" href=\\"https://docusaurus.io/blog\\"/>
11-
<subtitle>Hello Blog</subtitle>
12-
<icon>https://docusaurus.io/image/favicon.ico</icon>
13-
<rights>Copyright</rights>
14-
</feed>"
15-
`;
3+
exports[`blogFeed atom should not show feed without posts 1`] = `null`;
164

175
exports[`blogFeed atom shows feed item for each post 1`] = `
186
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
@@ -49,20 +37,7 @@ exports[`blogFeed atom shows feed item for each post 1`] = `
4937
</feed>"
5038
`;
5139
52-
exports[`blogFeed rss can show feed without posts 1`] = `
53-
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
54-
<rss version=\\"2.0\\">
55-
<channel>
56-
<title>Hello Blog</title>
57-
<link>https://docusaurus.io/blog</link>
58-
<description>Hello Blog</description>
59-
<lastBuildDate>Sun, 25 Oct 2015 23:29:00 GMT</lastBuildDate>
60-
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
61-
<generator>https://github.com/jpmonette/feed</generator>
62-
<copyright>Copyright</copyright>
63-
</channel>
64-
</rss>"
65-
`;
40+
exports[`blogFeed rss should not show feed without posts 1`] = `null`;
6641
6742
exports[`blogFeed rss shows feed item for each post 1`] = `
6843
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>

packages/docusaurus-plugin-content-blog/src/__tests__/generateBlogFeed.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function getBlogContentPaths(siteDir: string): BlogContentPaths {
3232
describe('blogFeed', () => {
3333
(['atom', 'rss'] as const).forEach((feedType) => {
3434
describe(`${feedType}`, () => {
35-
test('can show feed without posts', async () => {
35+
test('should not show feed without posts', async () => {
3636
const siteDir = __dirname;
3737
const siteConfig = {
3838
title: 'Hello',

packages/docusaurus-plugin-content-blog/src/blogUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export async function generateBlogFeed(
6767
}
6868
const {siteConfig} = context;
6969
const blogPosts = await generateBlogPosts(contentPaths, context, options);
70-
if (blogPosts == null) {
70+
if (!blogPosts.length) {
7171
return null;
7272
}
7373

packages/docusaurus-plugin-content-blog/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export default function pluginContentBlog(
117117
const {postsPerPage, routeBasePath} = options;
118118

119119
blogPosts = await generateBlogPosts(contentPaths, context, options);
120+
120121
if (!blogPosts.length) {
121122
return null;
122123
}
@@ -506,9 +507,14 @@ export default function pluginContentBlog(
506507
},
507508

508509
injectHtmlTags() {
510+
if (!blogPosts.length) {
511+
return {};
512+
}
513+
509514
if (!options.feedOptions?.type) {
510515
return {};
511516
}
517+
512518
const feedTypes = options.feedOptions.type;
513519
const {
514520
siteConfig: {title},

packages/docusaurus-plugin-ideal-image/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@docusaurus/responsive-loader": "1.4.0",
2626
"@docusaurus/types": "2.0.0-beta.0",
2727
"@endiliey/react-ideal-image": "^0.0.11",
28-
"react-waypoint": "^9.0.2",
28+
"react-waypoint": "^10.1.0",
2929
"sharp": "^0.28.2",
3030
"tslib": "^2.1.0",
3131
"webpack": "^5.28.0"

packages/docusaurus-theme-classic/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,6 @@ export default function docusaurusThemeClassic(
178178
preBodyTags: [
179179
{
180180
tagName: 'script',
181-
attributes: {
182-
type: 'text/javascript',
183-
},
184181
innerHTML: noFlashColorMode(colorMode),
185182
},
186183
],

packages/docusaurus-theme-classic/src/theme/BlogPostItem/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ function BlogPostItem(props: Props): JSX.Element {
109109
<footer className="row margin-vert--lg">
110110
{tags.length > 0 && (
111111
<div className="col">
112-
<strong>
112+
<b>
113113
<Translate
114114
id="theme.tags.tagsListLabel"
115115
description="The label alongside a tag list">
116116
Tags:
117117
</Translate>
118-
</strong>
118+
</b>
119119
{tags.map(({label, permalink: tagPermalink}) => (
120120
<Link
121121
key={tagPermalink}
@@ -131,13 +131,13 @@ function BlogPostItem(props: Props): JSX.Element {
131131
<Link
132132
to={metadata.permalink}
133133
aria-label={`Read more about ${title}`}>
134-
<strong>
134+
<b>
135135
<Translate
136136
id="theme.blog.post.readMore"
137137
description="The label used in blog post item excerpts to link to full blog posts">
138138
Read More
139139
</Translate>
140-
</strong>
140+
</b>
141141
</Link>
142142
</div>
143143
)}

packages/docusaurus-theme-classic/src/theme/DocPage/styles.module.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
width: 100%;
2020
}
2121

22+
.docItemWrapper {
23+
padding-top: 0.5rem !important;
24+
}
25+
2226
@media (min-width: 997px) {
2327
.docMainContainer {
2428
flex-grow: 1;
@@ -72,7 +76,9 @@
7276
}
7377

7478
.docItemWrapperEnhanced {
75-
max-width: calc(var(--ifm-container-width) + var(--doc-sidebar-width)) !important;
79+
max-width: calc(
80+
var(--ifm-container-width) + var(--doc-sidebar-width)
81+
) !important;
7682
}
7783
}
7884

packages/docusaurus-theme-classic/src/theme/DocSidebar/index.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import type {Props} from '@theme/DocSidebar';
1818
import Logo from '@theme/Logo';
1919
import IconArrow from '@theme/IconArrow';
2020
import IconMenu from '@theme/IconMenu';
21+
import IconExternalLink from '@theme/IconExternalLink';
2122
import {translate} from '@docusaurus/Translate';
2223

2324
import styles from './styles.module.css';
@@ -179,7 +180,6 @@ function DocSidebarItemLink({
179180
<Link
180181
className={clsx('menu__link', {
181182
'menu__link--active': isActive,
182-
[styles.menuLinkExternal]: !isInternalUrl(href),
183183
})}
184184
to={href}
185185
{...(isInternalUrl(href) && {
@@ -188,7 +188,14 @@ function DocSidebarItemLink({
188188
onClick: onItemClick,
189189
})}
190190
{...props}>
191-
{label}
191+
{isInternalUrl(href) ? (
192+
label
193+
) : (
194+
<span>
195+
{label}
196+
<IconExternalLink />
197+
</span>
198+
)}
192199
</Link>
193200
</li>
194201
);

0 commit comments

Comments
 (0)