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

fix(create-docusaurus): improve init template misleading doc + add Docuaurus social card #8279

Merged
merged 4 commits into from Nov 2, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -8,17 +8,22 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const config = {
title: 'My Site',
tagline: 'Dinosaurs are cool',
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'https://your-docusaurus-test-site.com',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'facebook', // Usually your GitHub org/user name.
projectName: 'docusaurus', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
Expand Down Expand Up @@ -56,6 +61,8 @@ const config = {
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'My Site',
logo: {
Expand Down
Expand Up @@ -13,17 +13,22 @@
const config = {
title: 'My Site',
tagline: 'The tagline of my site',
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'https://your-docusaurus-test-site.com',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'facebook', // Usually your GitHub org/user name.
projectName: 'docusaurus', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

presets: [
[
'classic',
Expand Down Expand Up @@ -53,6 +58,7 @@ const config = {
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'My Meta Project',
logo: {
Expand Down
Expand Up @@ -51,7 +51,11 @@ You can use absolute paths to reference images in the static directory (`static/

![Docusaurus logo](/img/docusaurus.png)

You can reference images relative to the current file as well, as shown in [the extra guides](../tutorial-extras/manage-docs-versions.md).
You can reference images relative to the current file as well. This is particularly useful to colocate images close to the Markdown files using them:

```md
![Docusaurus logo](./img/docusaurus.png)
```

## Code Blocks

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -62,7 +62,7 @@ describe('themeConfig', () => {
textColor: '#000',
isCloseable: true,
},
image: 'img/docusaurus-soc.png',
image: 'img/docusaurus-social-card.jpg',
navbar: {
style: 'primary',
hideOnScroll: true,
Expand Down
2 changes: 1 addition & 1 deletion website/docusaurus.config-blog-only.js
Expand Up @@ -41,7 +41,7 @@ module.exports = {
],
],
themeConfig: {
image: 'img/docusaurus-soc.png',
image: 'img/docusaurus-social-card.jpg',
algolia: {
appId: 'X1Z85QJPUV',
apiKey: 'bf7211c161e8205da2f933a02534105a',
Expand Down
2 changes: 1 addition & 1 deletion website/docusaurus.config.js
Expand Up @@ -403,7 +403,7 @@ const config = {
},
],
},
image: 'img/docusaurus-soc.png',
image: 'img/docusaurus-social-card.jpg',
// metadata: [{name: 'twitter:card', content: 'summary'}],
algolia: {
appId: 'X1Z85QJPUV',
Expand Down
Binary file added website/static/docusaurus-social-card.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/static/docusaurus-social-card.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed website/static/img/docusaurus-soc.png
Binary file not shown.