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

plugin request: jekyll-target-blank #2235

Open
plowsof opened this issue Jan 31, 2024 · 2 comments
Open

plugin request: jekyll-target-blank #2235

plowsof opened this issue Jan 31, 2024 · 2 comments

Comments

@plowsof
Copy link
Collaborator

plowsof commented Jan 31, 2024

#2233 (original #2118) hard codes some external links to open in an external window.

jekyll-target-blank

Automatically adds a target="_blank" rel="noopener noreferrer" attribute to all external links in Jekyll's content plus several other automation features for the external links. Read more here

https://github.com/keithmifsud/jekyll-target-blank
https://rubygems.org/gems/jekyll-target-blank

uncovered some issues while testing:

We have bad URI's. To confirm , enter https://matrix.to/#/#monero:monero.social @ https://0mg.github.io/tools/uri/

It then builds. and after a brief look it seems to work fine.

@plowsof
Copy link
Collaborator Author

plowsof commented Jul 13, 2024

Ignore:
Since 2020, major web browsers have enabled native handling of lazy loading by default.

Adding another which would be useful:
Jekyll-loading-lazy https://github.com/gildesmarais/jekyll-loading-lazy

  • we need to move to building site inside a docker container. both these plugins requires certain versions of gems / ruby and you will run into problems. it would remove alot of the friction for contributors also (when we eventually start bumping ruby versions)

@plowsof
Copy link
Collaborator Author

plowsof commented Jul 15, 2024

Testing with a docker build/run setup (to support plugins/ruby versions easier), and noticed a bug in the header logo:

 <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
   <a href="/%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"><img src="/img/monero-logo.png" width="500" height="135" alt="Monero Logo" class="monero-logo" loading="lazy"></a>
 </div>

after some debugging/head scratching/downgrading ruby / removing plugins i confirmed jekyll-loading-lazy is the main culprit. new lines.. and spaces being escaped?: in header.html i see whats going on:

<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
  <a href="{% if site.lang == 'en' %}
  
  {{ site.baseurl_root }}/
  
  {% else %}
  
  {{ site.baseurl_root }}/{{site.lang}}
  
  {% endif %}"><img src="/img/monero-logo.png" width="500" height="135" alt="Monero Logo" class="monero-logo"></a>
</div>

jekyll-loading-lazy does not handle multiple line liquid scripts in the href. a brief search shows liquid templates can avoid adding whitespace/newlines to the html using whitespace control

not needed as above comment shows most browsers have this enabled since 2020 but this would fix it and seems correct liquid scripting practice:

<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
  <a href="{% if site.lang == 'en' -%}

  {{ site.baseurl_root }}/
  
  {%- else -%}
  
  {{ site.baseurl_root }}/{{site.lang}}
  
  {%- endif %}"><img src="/img/monero-logo.png" width="500" height="135" alt="Monero Logo" class="monero-logo"></a>
</div>

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

1 participant