Giter Club home page Giter Club logo

Comments (6)

h-enk avatar h-enk commented on August 22, 2024 1

@timtorres, thanks for this. I think there's no valid reason for using shortcodes in stead of render hooks. Will be looking into this ... soonish.

Input: bep/portable-hugo-links

from hyas.

h-enk avatar h-enk commented on August 22, 2024 1

Implemented the image render hook (really nice, thanks for triggering this), but dropped the link render hook β€” see also #188

from hyas.

h-enk avatar h-enk commented on August 22, 2024 1

To split things (and keep better track), I've created two discussions: Opening links in a new tab or window? + Add email obfuscation?

from hyas.

timtorres avatar timtorres commented on August 22, 2024

Just noting this affects the blog archetype (removing shortcode reference)

from hyas.

h-enk avatar h-enk commented on August 22, 2024

document.write("<a href='mailto:{{ $address }}'>" + "{{ with .emailTitle }}{{ . | safeHTML }}{{else}}{{ $address }}{{end}}" + "</a>");

This way, an email address ($address) will still be scrapable when viewing the page source.

from hyas.

timtorres avatar timtorres commented on August 22, 2024

Great, nice one πŸ‘

This way, an email address ($address) will still be scrapable when viewing the page source.

Ha yeah, this was still WIP as I explored some methods. Nothing's perfect but I found a good (but old) breakdown of some different methods and your original and noscript fallback worked well enough for me as a balance between simplicity and effectiveness.

Replying to some of your notes from #188 here just to keep in context:

Dropped link render hook containing "target="_blank" rel="noopener" logic (G200: Opening new windows and tabs from a link only when necessary)

This makes sense when linking within the same or related domains, noting the exceptions provided, but isn't the general practice to open links leading to a new website in a new tab? If my users click on an external link then I'm losing them by directing them away from my site. I've rarely seen it done and I would rarely recommend it.

Dropped link render hook containing email obfuscation (looks like it's not really possible). Kept email shortcode (for now, as an option, but better to avoid using email links)

I don't understand this one - the link render hook would do the same thing as the shortcode, whether or not obfuscation is effective, without having to use the shortcode. So better and easier workflow for editors. And markdown supports email links whether or not you're using a render hook, also making the shortcode unnecessary: [[email protected]](mailto:[email protected]) or <[email protected]>

from hyas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.