Copy of website (only HTML/CSS/Javascript) from Joomla-website - joomla

I have a simple Joomla-website.
I want to create a copy of my website but it will be composed only from HTML/CSS/Javascript files (no PHP files, database, ...) because I want visit my website without Internet. Only HTML/CSS/Javascript files.
Is it possible? If yes, how?
Thanks

It can be done, using the same logic as generated cache works, saving the html result pages processed by php.
You can find 2 ways to do it:
Coding: Using an web scraper . You can find good Node.js npm packages for it;
Using a 3rd Party software. Google for it.

Related

create-react-app: where do I put dynamically uploaded images?

Hi I'm working with create-react-app, i've setup a file upload that allows images to be sent to the backend and saved locally (to the projects build directory). I'm able to dynamically reference images via localhost:4000/image.png so that already works (ie: i have a blog that lets me upload images that I later access via a blogList).
However i figured this probably isn't the best place to dynamically upload images to. I've read the docs on create-react-app and both the locations that mention images dont seem to work for my use case, i feel like im definitely doing something wrong but im not sure what.
docs im referring to:
Says use "import" however im loading dynamically so i cant see how this would work?
https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-images-fonts-and-files
says use public, however wouldnt that require a rebuild? since im loading dynamically that isnt possible: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#when-to-use-the-public-folder
NOTE: i have a image uploader and backend working fine it works already using the /build directory. i can upload and dynamically reference images. I'm just looking for best practices for doing something like this. Thanks!
(if you mention "just use nginx" could you please elaborate on the implementation a little)
As a learner I struggled with this problem and tried different approaches once a while ago. For rarely used assets, using /public for client could be useful but I have an app where clients upload images and manage them. Like you, I did not like those approaches and ended up with this setup.
Create a /public directory on backend and upload images to /public/images
Serve /public directory with Express statically.
Use dynamic path variable (via a config setup) for image paths. http://localhost:backend_port/public/images for development and /public/images for production.
I don't know this is the best approach but it worked for me. Beside being best approach when I upload images before that setup CRA was refreshing (hot reloading) my app after each image upload.

Is there an automated way to validate all AMP pages in a site?

What am I trying to accomplish?
I am trying to validate all AMP pages in a site (like Google AMP Validator), automatically and store the results. Is there an NPM BULK Validator or something similar out there? I am trying to avoid having to manually go through my sitemaps and test each of thousands of urls.
There is an NPM library and command line tool (https://npmjs.com/package/amphtml-validator), but you will still need to somehow generate the list of documents.
Here is the solution for testing(validate) thousands of URLs in a short time. One website i.e https://www.ampvalidator.com/
This website is secure, accurate, fast and easy to use. And the most interesting thing is you will get the proper beautified email report.

how to serve or force file download located from a different directory in meteor to client browser

A user comes to my site and inputs something, and my site generates a file as an output.
Unfortunately i cannot place the generated file on the public directory - as you all now Meteor watches this and restarts every time the public folder content is changed.
so my generated files lives in .meteor/local/build/programs/server/files
so for example i have document.pdf that lives in that directory, I'd like to serve/force/trigger a file download to my client's browser that lets his browser download this document.pdf file.
In general Its not a very good idea to do this. It makes it very hard to scale your app. Node isn't good at serving chunky static files either.
Then also if you have two servers there is a slight chance that the other one's data is requested (e.g if you use a download manager).
I'm not sure but I think Meteor's live code reload doesn't work/is switched off in when in production mode (when using meteor deploy or meteor bundle)
The best thing to do would be to upload your file to S3 and then redirect the user to the file there.
You can also use Iron Router and server side routes to create a dynamic file download.
See Iron Router Server Side docs. Then you set your content type to application/pdf and send back the file directly without saving it to the filesystem. If you need to you can also save it in some other folder and serve it up yourself.
Then have a peek at this answer for an example of reading in and streaming out a file:
Node JS file downloads using a stream.
Since this is a server side route, using express and Iron Router, you shouldn't have to mess with any of the fibers related async issues.

Making websites available offline

I am using HTML5 offline storage. The goal is to make the whole site available offline. So intuitively, no server requests means all the pages need to be on the client. The only way I know of to accomplish such a task is to make the site into one page then show hide portions with jquery when the user "navigates". Is there a better way?
The html 5 offline spec allows multiple pages to be saved offline so you don't need to put all your content onto one page.
EDIT: link to spec http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html
Be careful that your jquery does not still point to the cloud. You'll need to save the relevant .js files locally.
N.B. If your whole site can be generated and saved as individual .html files then all you need to do is to save these files in the correct (relative) directory structure.

bulk image upload - Rails3

I have a requirement of bulk uploading images. More precisely, I want to upload all the images for a web site (static images like back ground, logo, corner images , images required by css etc..)
As I think uploading these images one after another is not looks like quite practical (As it might have 60-70 images). So my questions are..
What is the standard way of doing these kind of a staff ?
Is it possible to let users to upload a .zip (images) file and
extract it from the server side.
If 2 is possible, can i do it with Rails3 and standard shared host
thanks in advance
cheers
sameera
1) Assuming you are talking about allowing bulk uploads from the website not as a rake task the typical way for handling multiple uploads is to use Uploadify / SWFUpload for the frontend along with a gem such as Paperclip to handle the images on the Rails side.
A google search for "paperclip uploadify" or "paperclip swfupload" should give you some good reference material.
2) It is certainly possible to do this, I've mostly worked with it the other way around to offer zipped archives of files for download but processing zips and working with the included files is definitely do-able
3) The suggested methods I gave for (1) above work just fine on Rails 3 and I can't see any reason they wouldn't work on shared hosting. That approach will however need some additional work for environments such as Heroku which have no or transient direct storage

Resources