mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 10:17:55 +02:00
fix(create-docusaurus): improve init template misleading doc + add Docuaurus social card (#8279)
This commit is contained in:
parent
7387aabbdc
commit
7a023a2c41
10 changed files with 29 additions and 12 deletions
|
@ -8,17 +8,22 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
|
|||
const config = {
|
||||
title: 'My Site',
|
||||
tagline: 'Dinosaurs are cool',
|
||||
url: 'https://your-docusaurus-test-site.com',
|
||||
baseUrl: '/',
|
||||
onBrokenLinks: 'throw',
|
||||
onBrokenMarkdownLinks: 'warn',
|
||||
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: '/',
|
||||
|
||||
// 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".
|
||||
|
@ -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: {
|
||||
|
|
|
@ -13,17 +13,22 @@
|
|||
const config = {
|
||||
title: 'My Site',
|
||||
tagline: 'The tagline of my site',
|
||||
url: 'https://your-docusaurus-test-site.com',
|
||||
baseUrl: '/',
|
||||
onBrokenLinks: 'throw',
|
||||
onBrokenMarkdownLinks: 'warn',
|
||||
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: '/',
|
||||
|
||||
// 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',
|
||||
|
@ -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: {
|
||||
|
|
|
@ -51,7 +51,11 @@ You can use absolute paths to reference images in the static directory (`static/
|
|||
|
||||

|
||||
|
||||
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
|
||||

|
||||
```
|
||||
|
||||
## Code Blocks
|
||||
|
||||
|
|
BIN
packages/create-docusaurus/templates/shared/static/img/docusaurus-social-card.jpg
vendored
Normal file
BIN
packages/create-docusaurus/templates/shared/static/img/docusaurus-social-card.jpg
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
|
@ -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,
|
||||
|
|
|
@ -41,7 +41,7 @@ module.exports = {
|
|||
],
|
||||
],
|
||||
themeConfig: {
|
||||
image: 'img/docusaurus-soc.png',
|
||||
image: 'img/docusaurus-social-card.jpg',
|
||||
algolia: {
|
||||
appId: 'X1Z85QJPUV',
|
||||
apiKey: 'bf7211c161e8205da2f933a02534105a',
|
||||
|
|
|
@ -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',
|
||||
|
|
BIN
website/static/docusaurus-social-card.jpg
Normal file
BIN
website/static/docusaurus-social-card.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
BIN
website/static/docusaurus-social-card.png
Normal file
BIN
website/static/docusaurus-social-card.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 419 KiB |
Binary file not shown.
Before Width: | Height: | Size: 16 KiB |
Loading…
Add table
Reference in a new issue