Includes without local server? - html

I'm making a website, and I like testing everything offline instead of having to upload files with every change I make. The problem is I can't use includes, so when I do upload, I'm going to have to change a lot of the file structure.
I'm not looking to install a local server like WAMP when I just want to use includes. Is there any way?

Not really.
You could process includes statically (e.g., write yourself a Makefile to create the actual HTML files you view locally). There are plenty of template languages out there that could do this. You could, I suppose, even write your templates in JavaScript and let the web browser assemble them.
But really, why wouldn't you want your test environment to match your production environment? This seems silly—if there is something wrong with your includes, you want to find out before you make it live. If you accidentally get a local path to an image (C:\Documents and Settings\…\image.png) in a file, you want to find out. The best way to do this is really to run a webserver locally.

Related

How to store webpage?

I want to save the following webpage (https://cs231n.github.io/) such that I can easily view it offline. Is there a way to do this without copying each page by hand?
I already downloaded some software but they are not working properly.
I see that there is a GitHub repository, can this be used to offline view the content of the page?
The simplest way is to use third party program as HTTrack. Your linked web-site is relatively simple and this program should handle it.
The hardest yet most correct way is to, yes, clone web-site from git repository and serve it on your local computer. It can be not easy depending on how site is built, does it use database and so on.

How to work with gulp via FTP?

First of all, I'm sorry if this is pretty stupid question for you, I was searching the web for the answer, but unfortunately couldn't find complex one.
Recently I discovered not so new, but still cool stuff like SCSS, Pug, LiveReload, Gulp and all that automation stuff. I was really blown away, cause I've been like in a cave for past 2-3 years. So, the development for me is pretty easy and fast now, but I've got problem with production of this.
So, for example, I have to develop WordPress site. One year ago, I'd just run local server, install WordPress there, then I create a new template and customize it for customer needs. After that, I'd upload all of that on web-server (for FTP stuff I use Filezilla, if there's better tools - point me, please) and than, if needed, I'd open desired files from "Edit" menu in Filezilla, customize them, save - and that it's done, I can see the result in browser. I don't need local copy of the web-site on my computer (since some web-sites nowadays are pretty 'heavy').
Now, I don't know what to do with that automation stuff, cause it's all running with console and has to be compiled. So, in order to develop complex CMS-driven web-sites using automation tools, I need to always have latest copy on my local machine, and that send it again on web-server? What if customer, for example, decides to change the article or something on the web-site, when I sync my local copy with web-server, it'll be lost.
So, my main question, is there a way for me to create WordPress website using Gulp & Co and then easily update it later, via FTP client?

Going from webpage to website

I have been coding html/css for some time now, and I've gotten to be proficient at coding single webpages, but I can't figure out how to code a website. Some questions I have are:
Do I need to buy a domain if I want to build a website (for practice)
Are their special things I need to know (such as special tags) that I wouldn't have learned from coding just a single page?
Should I learn how to use a grid if I am coding multiple pages?
You may want to first decide what kind of back end you want (the server side code that builds and delivers the pages) I strongly recommend rails, and a react.rb.
You do not need a domain name.
A great way to start is to use a service like cloud9 which is free, and will get you going in no time. Cloud9 will do a one button setup of a rails environment and get you going.
Another approach is to begin using react.rb and just expand your skill set from the front end towards the server. The react.rb tutorial creates a simple chat application and you can do this all with the tools your already have. Once you have mastered that you can set up a simple rails server and start adding server side persistance (saving data on the server.) This is the approach I recommend, but full discloure: I am one of the leads on the react.rb project so I am very biased.
Well, you can build simple to wonderful STATIC websites from HTML/CSS but if you are talking about some serious web development then you will need to learn a server side scripting language. Most of the websites these days are database driven serverside webpages. There are many serverside programming languages and tutorials for the same out there.
I suggest you start with PHP (for scripting language) and MySql (for database)
Again, the choice of language is totally upto you.
Then you would need to learn about setting up a server on your local computer. For this you will need to learn about (x)-AMP. This would be WAMP, XAMP, MAMP depending on what OS you are using.
If you are only needing to develop a simple CMS website, then there are alot of CMS framework which you can go for, which will not require much of coding.
It seems as if you are looking to connect multiple pages to the same website, so you can navigate between pages. And it seems that you want to practice with local files. If that is the case, you need to first create a local folder for your website and use the a tag in your html files. Inside the a tag, you will need to include an href with the url to your other page. A link to another html page that is saved in the same folder as your original will look like this:
New Page
You will want to use external CSS and JavaScript files to keep all of your pages in the same format.
http://www.w3schools.com/html/html_links.asp
http://www.w3schools.com/tags/tag_link.asp

Easiest way to deploy an html page on a web server

I have an html file that I use to extract a locally stored sqlite database file's informtaion, using some easy javascript.
Now I want to access this web page through http protocol (not file:/// scheme).
What configuration do you recommend to easily realize this manoeuvre ?
Thank you in advance.
Your question is lacking, but in general you want a webhost or setup your own computer for external connections.
I recommend finding a simple hosting site and learning the procedure from there.
From the command line, navigate into your project folder, and run:
python -m SimpleHTTPServer
You can then open http://localhost:8000 in your browser, to view your page using the http:// protocol.
(I don't think this will work if your HTML file is actually PHP, which given that your description includes databases, it sounds like it might be. In that case, I would download something like MAMP.)
This answer assumes you're just trying to use the http:// protocol to test your page locally - like the other solution says, if you want to deploy your page so other people can see it, you'll need to find web hosting.

Creating HTML according to files existence in the file system

I am writing a web application (I am a newbie), where the markup is created by XSL and XML transformations and the style is declared by css files and also some use of JavaScript. I need to create a web page that part of its content is the information on files in a specific directory in the file system.
Any ideas?
Are you talking about the client's file system, or the server's?
If the client's, what you are asking is basically impossible for security reasons without some specific browser plugins/extensions (like a java applet with the right access) - you probably don't want to get into that.
If you are talking about the server file system, you will need some sort of server side language to read the file(s) and return them to browser requests. The sort of things that do that are PHP, ASP.NET, Ruby on Rails, etc...also look into Server Side Includes - that may be sufficient for your needs.
Do you mean the client's filesystem or the server's filesystem? If it's the client's, these tools are inadequate (as access to the client's OS is severely restricted for security purposes). I think most people go with a Java applet for stuff like that.