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

feat($theme-default): external links in prev/next (close #1962) #1984

Merged
merged 7 commits into from
Dec 3, 2019
Merged

feat($theme-default): external links in prev/next (close #1962) #1984

merged 7 commits into from
Dec 3, 2019

Conversation

haoranpb
Copy link
Contributor

@haoranpb haoranpb commented Oct 26, 2019

Summary

fix #1962

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of default theme, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated
  • Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

Copy link
Collaborator

@kefranabg kefranabg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ludanxer, just a few changes to make and it will be ok

packages/@vuepress/theme-default/components/PageNav.vue Outdated Show resolved Hide resolved
packages/@vuepress/theme-default/components/PageNav.vue Outdated Show resolved Hide resolved
packages/@vuepress/theme-default/components/PageNav.vue Outdated Show resolved Hide resolved
packages/@vuepress/theme-default/components/PageNav.vue Outdated Show resolved Hide resolved
@haoranpb
Copy link
Contributor Author

Hi @kefranabg ,

Thanks for your tips, really learned a lot since I participated in Vuepress.

When it is an external link, prev.title and next.title will always be undifne, that's why I remove them in the initial PR. Do you think adding prevTitle and nextTitle in the frontmatter would be a good idea?

@kefranabg
Copy link
Collaborator

kefranabg commented Oct 27, 2019

@ludanxer I just made a test and next.title is not undefined if you override the external link name in the config

For example:

[
    'cli',
    'node',
    ['https://vuepress.vuejs.org/', 'External link test']
  ]

Capture d’écran 2019-10-27 à 09 59 28

@haoranpb
Copy link
Contributor Author

Oh, right! Sorry, forget to take this scenario into consideration.

@ulivz
Copy link
Member

ulivz commented Nov 29, 2019

@meteorlxy Could you help review again?

BTW, I felt that it's difficult to maintain continuously since we don't have unit tests for UI components.

Copy link
Member

@meteorlxy meteorlxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about adding a <OutboundLink /> ?

packages/@vuepress/theme-default/components/PageNav.vue Outdated Show resolved Hide resolved
packages/@vuepress/theme-default/components/PageNav.vue Outdated Show resolved Hide resolved
Sun Haoran and others added 2 commits December 3, 2019 17:25
Co-Authored-By: meteorlxy <[email protected]>
Co-Authored-By: meteorlxy <[email protected]>
@haoranpb
Copy link
Contributor Author

haoranpb commented Dec 3, 2019

@meteorlxy Thanks for the review.

I didn't add OutboundLink at first because it doesn't look so great.

Capture

But you are right, they need to be consistent.

@meteorlxy meteorlxy changed the title feat($theme-default): support external link in prev/next(close #1962) feat($theme-default): external links in prev/next (close #1962) Dec 3, 2019
@meteorlxy meteorlxy merged commit 9f28814 into vuejs:master Dec 3, 2019
@vue-bot
Copy link

vue-bot commented Dec 3, 2019

Hey @ludanxer, thank you for your time and effort spent on this PR, contributions like yours help make Vue better for everyone. Cheers! 💚

@haoranpb haoranpb deleted the feat/allow-external-link-in-prev-next branch December 4, 2019 01:40
@mbana
Copy link

mbana commented Dec 10, 2019

Howdy, is there a version with this available? Many thanks.

@meteorlxy
Copy link
Member

@mbana Not yet. It will be available in version 1.3.0

@mbana
Copy link

mbana commented Dec 10, 2019

@meteorlxy, I am afraid I can't see that on https://www.npmjs.com/package/vuepress?activeTab=versions.

@meteorlxy
Copy link
Member

@mbana

😅 It "will" be. Has not released yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

external url can use in sidebar and nav bar but it's broken at bottom nav bar(prev ,next)
6 participants