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(utils): add logic for image links #288

Closed
wants to merge 1 commit into from

Conversation

Nodreame
Copy link

Description:

$withBase make 'base' before my img link
截屏2021-04-18_下午3_31_15

Solution

use VuePress Logic:
截屏2021-04-18_下午4_00_50

Result

截屏2021-04-18 下午4 03 40

@antfu
Copy link
Member

antfu commented May 27, 2021

Probably better to handle here

function withBase(path: string): string {

@Nodreame
Copy link
Author

Probably better to handle here

function withBase(path: string): string {

Thank you for your reply~

I met this problem when I writing Homepage for my post blog. The sample code is shown below:

---
home: true
heroImage: http://img.nodreame.cn/2020-3-23-21-27-49
heroAlt: Logo image
heroText: Hero Title
---

Then I found the template of HomePage and found "$withBase",so I modify "joinPath" below it.

image-20210529000817970

I read the code for Vitepress to follow your advice, then found that "withBase" was only called by "useNavLink".

Then I added console.log(path) for two files,"withBase" was not called.

image-20210529001452657

So I think its should be handle in "joinPath",or just in "$withBase".

Looking forward to your reply~ THX~

@yyx990803
Copy link
Member

This should've been fixed by #328

@yyx990803 yyx990803 closed this Oct 7, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants