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

chore(theme/plugin): improve external links behavior and visibility #2054

Merged
merged 5 commits into from
Aug 23, 2023

Conversation

yoshinorin
Copy link
Member

@yoshinorin yoshinorin commented Aug 14, 2023

Check List

  • Others (Update, fix, translation, etc...)

What is for?

Current theme page has some issues.

  1. If we click theme image thumb, we will be transfer to external site.
    • I think this is not not intuitive behavior.
    • Not good for security reasons.
  2. User can not understand which link is external or not.

After this PR (image)

pr

This PR is temporary solution for these issues.

Othres

refs: https://github.com/orgs/hexojs/discussions/5267#discussioncomment-6716225


Thank you :)

@github-actions
Copy link
Contributor

Theme name validation passed.
Theme thumbnails validation completed.

@@ -5,10 +5,15 @@
</noscript>
<img data-src="{{ url_for('themes/screenshots/' + plugin.name + '.png') }}" data-sizes="auto" class="plugin-screenshot-img lazyload" alt="{{ plugin.name }}">
{% if plugin.preview %}
<a href="{{ plugin.preview }}" class="plugin-preview-link" target="_blank"><i class="fa fa-eye"></i></a>
<a href="{{ url_for('themes/screenshots/' + plugin.name + '.png') }}" class="plugin-preview-image" target="_blank"><i class="fa fa-eye"></i></a>
Copy link
Member Author

Choose a reason for hiding this comment

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

Open a new tab instead of transferred to external link when user clicks theme thumb.

Copy link
Member

Choose a reason for hiding this comment

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

We can use components like Fancybox or Medium Zoom to support image zooming and display.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, however, to be honest, it was a little bit tedious, so I implemented it open with new tab 😓
I'll give it a try later.

Copy link
Member Author

Choose a reason for hiding this comment

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

@stevenjoezhang

We can use components like Fancybox or Medium Zoom to support image zooming and display.

Would you please review? @uiolee implement it in caec173
It LGTM :)

But, I can't approve this PR. Because I'm PR author...

{% endif %}
</div>
<a href="{{ plugin.link }}" class="plugin-name" target="_blank">{{ plugin.name }}</a>
<a href="{{ plugin.link }}" class="plugin-name" target="_blank">{{ plugin.name }} <i class="fa fa-external-link"></i></a>
Copy link
Member Author

Choose a reason for hiding this comment

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

add <i class="fa fa-external-link"></i> to mark it as an external link explicitly.

<a href="{{ plugin.link }}" class="plugin-name" target="_blank">{{ plugin.name }} <i class="fa fa-external-link"></i></a>
{% if plugin.preview %}
<div class="plugin-preview-wrap">
<a href="{{ plugin.preview }}" class="plugin-preview-link" target="_blank"> Visit preview site <i class="fa fa-external-link"></i></a>
Copy link
Member Author

Choose a reason for hiding this comment

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

Add preview link site instead of line 8

@uiolee
Copy link
Member

uiolee commented Aug 15, 2023

This is a good idea, maybe it can be applied to plugin page or even all pages

@yoshinorin yoshinorin changed the title chore(theme): improve external links behavior and visibility chore(theme/plugin): improve external links behavior and visibility Aug 18, 2023
@yoshinorin yoshinorin merged commit 902d216 into hexojs:master Aug 23, 2023
5 checks passed
@yoshinorin yoshinorin deleted the chore/update-theme-page branch August 23, 2023 11:15
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.

3 participants