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

Force relative URLs #35

Open
GitHub-Mike opened this issue Dec 18, 2024 · 1 comment
Open

Force relative URLs #35

GitHub-Mike opened this issue Dec 18, 2024 · 1 comment

Comments

@GitHub-Mike
Copy link

In my example project, the values for the src and href attributes have unfortunately been assigned inconsistently. This is due to the fact that it is an older Joomla project, which has apparently undergone changes in the meantime due to plugins and components.

Here are a few examples:

 - http://example.com/images/image_1.jpg
 - https://example.com/images/image_2.jpg
 - example.com/images/image_3.jpg
 - www.example.com/images/image_4.jpg
 - /images/image_5.jpg

It affects not only images, but also regular HTML links and results in the directory structure in the target directory becoming redundant.

project_folder\index.html
project_folder\_www.example.com\index.html

Could we introduce a parameter that merges all these URLs and enforces relative paths?

--force-relative-urls

Reference should be made to the domain in the --url parameter and only apply to the following URLs:

^(https?:\/\/)?(www\.)?example\.com\/.*|^\/.*

Of course, you could also allow a regex as a parameter, but these cases should be rare:

--force-relative-urls-regex='^(https?:\/\/)?(www\.)?example\.com\/.*|^\/.*'

What do you think?

@janreges
Copy link
Owner

Hi @GitHub-Mike,

yes, the addition of this functionality is useful and I have thought about something similar during development.

But I want to release a new version of the whole application in a few days and implementing this will not be trivial, so I will implement it after the new year.

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

No branches or pull requests

2 participants