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

Idea: rewrite using wget #37

Open
ghost opened this issue Dec 19, 2019 · 6 comments
Open

Idea: rewrite using wget #37

ghost opened this issue Dec 19, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Dec 19, 2019

This plugin could be rewritten to use wget. It would then account for things like pagination which Blackhole does not catch right now. Most of the features could be implemented and this would not require nearly as much code upkeep as Grav continues to develop and change. I can't think of any reason why this wouldn't work well, but maybe you can. To me, it seems too easy.

shell_exec("wget ...");

Since there would be user input, it would just need to have all options sanitized.

escapeshellarg($input);
@pixelfabs
Copy link

The good thing about this idea is speed. Second is more possiblities. For example, when you download a Grav skeleton package, things could be in places that doesn't fit your own requirements. Even some themes seem to have pretty weird locations for files. Like, having a CSS file in /folder/folder/folder. This impacts speed. CSS should be at most in 1 folder in relation to the whole website. Same counts for JS files and images. (I think it's called chaining request?)

Downside? Too much possiblities. confusing the user.
Something I would love to have is, choosing a css location, choosing a js location, choosing an image location en with one push, I would have a complete working static site to upload. Regardless of theme, skeleton etc..

@ghost
Copy link
Author

ghost commented Oct 30, 2020

Thanks, I appreciate you taking the take to reflect on this. If I ever do it, it will be a v2 probably.

@testbird
Copy link

There is also an even more tried and proven tool that could do all the work in the background, it's httrack. Its very sophisticated in making sites static, possibly even pagination etc.

@testbird
Copy link

@ghost
Copy link
Author

ghost commented Mar 14, 2021

@testbird I used it once like 15 years ago, although I didn't realize it had a command line version. Neat.

@codeability-ab
Copy link

Hello!
A late input to the wget idea. I have tried it on a newly installed default grav site (quark theme) with two added subpages. It fails totally!

Assets like css, scripts and fonts are not copied. URLs still refer to the original site. Parent pages to subpages are not copied.

I have tried all wget options and I also had long discussions with a new friend of mine (chatGPT).

The blackhole plugin seems to work fine though.

:-)

/Johan

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

3 participants