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

No outline generated after docs:build (Yes it is there when docs:dev) since alpha52 #2072

Closed
3 tasks done
arcqiufeng opened this issue Mar 12, 2023 · 11 comments
Closed
3 tasks done
Labels
need more info Further information is requested

Comments

@arcqiufeng
Copy link

Describe the bug

I upgrade to alpha52 then docs:build. Outline in page missing.

I tried docs:dev, it goes well.

Is it a bug?

Reproduction

I upgrade to alpha52 then docs:build. Outline in page missing.

I tried docs:dev, it is goes well.

Is it a bug?

Expected behavior

docs:dev and docs:build should be the same.

System Info

Windows 11

Additional context

No response

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@arcqiufeng arcqiufeng added the bug: pending triage Maybe a bug, waiting for confirmation label Mar 12, 2023
@arcqiufeng arcqiufeng changed the title Now outline generated after docs:build (Yes it is there when docs:dev) since alpha52 No outline generated after docs:build (Yes it is there when docs:dev) since alpha52 Mar 12, 2023
@arcqiufeng
Copy link
Author

More:

Then I rollback to v1.0.0-alpha.51:

 yarn add -D vitepress@1.0.0-alpha.51

It works, outline is back after build.

@brc-dd
Copy link
Member

brc-dd commented Mar 12, 2023

Can you share your code? Our site is also using the latest version, but we are able to see the outline:

image

@brc-dd brc-dd added need more info Further information is requested and removed bug: pending triage Maybe a bug, waiting for confirmation labels Mar 12, 2023
@arcqiufeng
Copy link
Author

Maybe it is caused by badge.

I notice there is a break change in alpha52.

It really affected me. I have badges in headlines.

Can you add badges in headlines and tried it again?

My code is in LAN, and size is Large.

@brc-dd
Copy link
Member

brc-dd commented Mar 12, 2023

You mean having just the badge in whole heading? In that case, yeah that heading will be skipped 👀

Also not asking for the whole code, just a dummy file with 2-3 headings that demonstrates the problem will work.

@arcqiufeng
Copy link
Author

I will try to reproduce it later.

In the third level of the title, the second level of the title, and there are badges like “to do” and so on.

@arcqiufeng
Copy link
Author

It works well in dev mode.

@brc-dd
Copy link
Member

brc-dd commented Mar 12, 2023

It works well in dev mode.

Ah, ok. Then we need some code to reproduce the problem at our end. Can't suggest a fix without that 👀

@arcqiufeng
Copy link
Author

In dev mode, the outline is there. And the badge was perfectly omitted. But it remains in the [[toc]]. Perfect is exactly what I was hoping for.

@arcqiufeng
Copy link
Author

Now I can reproduce the bug:

Following:

W:\work\2023>md test & cd test  

W:\work\2023\test>yarn add -D vitepress

W:\work\2023\test>npx vitepress init

  vitepress v1.0.0-alpha.52

┌   Welcome to VitePress! 
│
◇  Where should VitePress initialize the config?
│  ./docs
│
◇  Site title:
│  My Awesome Project
│
◇  Site description:
│  A VitePress Site
│
◇  Theme:
│  Default Theme
│
◇  Use TypeScript for config and theme files?
│  Yes
│
◇  Add VitePress npm scripts to package.json?
│  Yes
│
└  Done! Now run npm run docs:dev and start writing.

Now edit the file "markdown-examples.md" that automatically generated. Just add a badge into the title, as following:

## Syntax Highlighting<Badge type="danger" text="caution" />

Now we can test the file:

W:\work\2023\test>yarn docs:dev
yarn run v1.22.19
warning package.json: No license field
$ vitepress dev docs

  vitepress v1.0.0-alpha.52

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose

It works fine in http://localhost:5173/markdown-examples.html

Then I try to build it:

W:\work\2023\test>yarn docs:build
yarn run v1.22.19
warning package.json: No license field
$ vitepress build docs

  vitepress v1.0.0-alpha.52

✓ building client + server bundles...
✓ rendering pages...
build complete in 19.05s.
Done in 19.83s.

I copied all the stuffs into iis root. (C:\inetpub\wwwroot)

Now: http://127.0.0.1/markdown-examples.html
The Page can be displayed but the outline is missing.

@gvenusleo
Copy link

I have a similar problem. In v1.0.0-alpha.52, Appearance switch button and custom css work with dev, but fail with preview. #2075

@yyx990803
Copy link
Member

Looks like alpha.53 didn't fix this, looking into it further...

@yyx990803 yyx990803 reopened this Mar 13, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need more info Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants