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

Conditional page content for viewing modes #8685

Open
Sheila111 opened this issue Jan 30, 2022 · 4 comments
Open

Conditional page content for viewing modes #8685

Sheila111 opened this issue Jan 30, 2022 · 4 comments

Comments

@Sheila111
Copy link

Describe the bug
A useless link in Docs page

Steps to reproduce the behavior
1.Navigate to https://arcade.makecode.com/beta#editor
2.Help--->Docs--->Game Design Concepts--->Walking Hero
3.Click the link "Open this tutorial in the editor!"

Actual behavior
A useless link in Docs page. There shows a blank page after clicking the link "Open this tutorial in the editor!"
1

Additional context
1.OS: Windows10
2.arcade version: 1.8.12
3.Microsoft MakeCode version: 7.4.18

@ganicke
Copy link
Collaborator

ganicke commented Jan 31, 2022

This "useless link" works when the page is served as document: https://arcade.makecode.com/concepts/walking-hero. The sidedoc view needs to open the linked page in a _blank target or just strip the link whilst in sidedocs.

@ganicke
Copy link
Collaborator

ganicke commented Feb 1, 2022

@shakao - sorry to bother, but do you have any ideas about linkouts in sidedocs?

@shakao
Copy link
Contributor

shakao commented Feb 3, 2022

hmmm ok so it looks like we're using /#tutorial:/concepts/walking-hero which is fine when the base URL is arcade.makecode.com/docs but when we load our sidedocs, the base url is something like https://arcade.makecode.com/---docs which makes the relative URL wrong. and also yeah, it's not opening in a new window so even if the URL was correct it wouldn't work

i THINK there's no content-only solution for this since these links are all generated from markdown; longer term either stripping the link or adding target=_blank would work, but probably not super urgent since this bug also repros on live?

@ganicke
Copy link
Collaborator

ganicke commented Feb 3, 2022

Block it out for rendering somehow when in not in document view?:

### ~ docview

[Open this tutorial in the editor!](/#tutorial:/concepts/walking-hero)

### ~

-- or --

some kind of conditional rendering:

### $if @docs

[Open this tutorial in the editor!](/#tutorial:/concepts/walking-hero)

### $elseif @sidedocs

**Run this as a tutorial from the Home Screen**

### $else 

@ganicke ganicke changed the title A useless link in Docs page Conditional page content for viewing modes Feb 3, 2022
@ganicke ganicke transferred this issue from microsoft/pxt-arcade Feb 3, 2022
@ganicke ganicke removed their assignment Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants