Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(v2): various markup improvements #3763

Merged
merged 1 commit into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function BlogPostPage(props: Props): JSX.Element {
<div className="col col--2">
<BlogSidebar sidebar={sidebar} />
</div>
<div className="col col--8">
<main className="col col--8">
<BlogPostItem
frontMatter={frontMatter}
metadata={metadata}
Expand Down Expand Up @@ -64,7 +64,7 @@ function BlogPostPage(props: Props): JSX.Element {
<BlogPostPaginator nextItem={nextItem} prevItem={prevItem} />
</div>
)}
</div>
</main>
{!hideTableOfContents && BlogPostContents.rightToc && (
<div className="col col--2">
<TOC headings={BlogPostContents.rightToc} />
Expand Down
4 changes: 2 additions & 2 deletions packages/docusaurus-theme-classic/src/theme/NotFound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Layout from '@theme/Layout';
function NotFound(): JSX.Element {
return (
<Layout title="Page Not Found">
<div className="container margin-vert--xl">
<main className="container margin-vert--xl">
<div className="row">
<div className="col col--6 col--offset-3">
<h1 className="hero__title">Page Not Found</h1>
Expand All @@ -22,7 +22,7 @@ function NotFound(): JSX.Element {
</p>
</div>
</div>
</div>
</main>
</Layout>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,36 +55,34 @@ document.addEventListener('DOMContentLoaded', function () {
padding: 20,
fontSize: 20,
}}>
<span>
<p
style={{
fontWeight: 'bold',
fontSize: 30,
}}>
Your Docusaurus site did not load properly.
</p>
<p>
A very common reason is a wrong site{' '}
<a
href="https://v2.docusaurus.io/docs/docusaurus.config.js/#baseurl"
style={{fontWeight: 'bold'}}>
baseUrl configuration
</a>
.
</p>
<p>
Current configured baseUrl ={' '}
<span style={{fontWeight: 'bold', color: 'red'}}>{baseUrl}</span>{' '}
{baseUrl === '/' ? ' (default value)' : ''}
</p>
<p>
We suggest trying baseUrl ={' '}
<span
style={{fontWeight: 'bold', color: 'green'}}
id={BaseUrlSuggestionContainerId}
/>{' '}
</p>
</span>
<p
style={{
fontWeight: 'bold',
fontSize: 30,
}}>
Your Docusaurus site did not load properly.
</p>
<p>
A very common reason is a wrong site{' '}
<a
href="https://v2.docusaurus.io/docs/docusaurus.config.js/#baseurl"
style={{fontWeight: 'bold'}}>
baseUrl configuration
</a>
.
</p>
<p>
Current configured baseUrl ={' '}
<span style={{fontWeight: 'bold', color: 'red'}}>{baseUrl}</span>{' '}
{baseUrl === '/' ? ' (default value)' : ''}
</p>
<p>
We suggest trying baseUrl ={' '}
<span
style={{fontWeight: 'bold', color: 'green'}}
id={BaseUrlSuggestionContainerId}
/>{' '}
</p>
</div>
</>
);
Expand Down
11 changes: 7 additions & 4 deletions website/docs/markdown-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1000,11 +1000,14 @@ You can use images in Markdown, or by requiring them and using a JSX image tag:
```mdx
# My Markdown page

<img src={require('./assets/docusaurus-asset-example-banner.png').default} />
<img
src={require('./assets/docusaurus-asset-example-banner.png').default}
alt="Example banner"
/>

or

![](./assets/docusaurus-asset-example-banner.png)
![Example banner](./assets/docusaurus-asset-example-banner.png)
```

The ES imports syntax also works:
Expand All @@ -1014,12 +1017,12 @@ The ES imports syntax also works:

import myImageUrl from './assets/docusaurus-asset-example-banner.png';

<img src={myImageUrl)}/>
<img src={myImageUrl)} alt="My image alternative text" />
```

This results in displaying the image:

![](./assets/docusaurus-asset-example-banner.png)
![My image alternative text](./assets/docusaurus-asset-example-banner.png)

:::note

Expand Down
1 change: 1 addition & 0 deletions website/src/components/TeamProfileCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function TeamProfileCard({
<img
className="avatar__photo avatar__photo--xl"
src={githubUrl + '.png'}
alt={`${name}'s avatar`}
/>
<div className="avatar__intro">
<h3 className="avatar__name">{name}</h3>
Expand Down
6 changes: 3 additions & 3 deletions website/src/theme/NotFound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import Feedback from '../pages/feedback';

function NotFound({location}: {location: {pathname: string}}): JSX.Element {
if (/^\/\bfeedback\b/.test(location.pathname)) {
return <Feedback />
return <Feedback />;
} else {
return (
<Layout title="Page Not Found">
<div className="container margin-vert--xl" data-canny>
<main className="container margin-vert--xl" data-canny>
<div className="row">
<div className="col col--6 col--offset-3">
<h1 className="hero__title">Page Not Found</h1>
Expand All @@ -26,7 +26,7 @@ function NotFound({location}: {location: {pathname: string}}): JSX.Element {
</p>
</div>
</div>
</div>
</main>
</Layout>
);
}
Expand Down