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

Define path on own domain as external links #47

Open
tkrunning opened this issue Nov 22, 2019 · 3 comments
Open

Define path on own domain as external links #47

tkrunning opened this issue Nov 22, 2019 · 3 comments
Labels
question Further information is requested

Comments

@tkrunning
Copy link

Hi, your plugin looks like exactly what I've been looking for! However, I (and I know a lot of other people) are using a link structure that looks something like this for external links: mydomain.com/go/whatever or mydomain.com/out/whatever

This is for link tracking purposes.

The issue is that those links look like internal to your plugin, even though in reality they are external. Short of adding a custom class to all the links (which negates the purpose of your plugin) I don't think there's a way to define these as external, currently.

I took a quick look at your code to see if it would be easy to fix myself, but my Ruby skills are unfortunately very basic. Is this something that would be relatively straight forward to add?

@keithmifsud keithmifsud added the question Further information is requested label Nov 23, 2019
@keithmifsud
Copy link
Owner

Hi, thank you for your feedback.

I understand what you need but no, this cannot be added without losing the main purpose of the plugin.

You can choose whether to add a CSS class to these links or code them manually.

Am I missing something? How can any program tell your tracking links from your internal links? Is there anything that distinguishes them?

@tkrunning
Copy link
Author

It should be easy to distinguish them as all the external links start with /go (or whatever path a particular site uses, I think both /go and /out are quite common)

  • yourdomain.com/go/something --> external
  • yourdomain.com/something --> internal

So in the plugin you'd just need the ability to set a path that is used for external redirects.

Do you understand what I mean?

@keithmifsud
Copy link
Owner

I understand. Thank you for clarifying.

This feature can be made possible with using a regexp in Jekyll's config.

I'm sorry that I don't have time to implement this at the moment. However, if you give it a go, I'll review your PR asap.

You can look at my code, the parts that change behaviour depending on CSS class names and work from there.

  1. Describe the feature in the SPEC file.
  2. Write code for the spec to pass.
  3. Nudge the minor version number forward.
  4. Submit PR
  5. Fix and build issues.
  6. I'll approve or comment on the PR.
  7. I'll upload the Gem to RubyGems (asap).

Thank you once again.

PS: this was my first ever ruby code so I'm sure you can also do it 😉

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

No branches or pull requests

2 participants