Notes on How to set up and maintain Web pages
Where to put your Web pages
On your Linux/UNIX account on something like:
student.computing.dcu.ie
in a directory called public_html:
cd
mkdir public_html
edit public_html/index.html
edit public_html/file.html
to make the files:
http://host/~user/
http://host/~user/file.html
The URL will be something like:
http://student.computing.dcu.ie/~username/
Web hosting in DCU:
Protections
The hierarchy of directories above the files
needs to be executable by "others". See
Notes on directory protections
cd
chmod o+x .
chmod o+x public_html
All files need to be readable by "others". See
Notes on file protections
cd
chmod o+r public_html/index.html
chmod o+r public_html/file.html
chmod o+r public_html/image.jpg
- Raw HTML in a text editor
- Raw HTML in an assisted text editor
-
WYSIWYG Web editors
- Browser editors
- Word Save As
- May generate very complex, spaghetti, machine-generated HTML code
that breaks oddly in different browsers, or mobile browsers.
- It might be OK for writing 1 or 2 pages,
but can it scale up to hundreds of pages
organised in directories and subdirectories
and massively interlinked?
My experience with these editors, and the complexity
of simply trying to implement
relative links instead of absolute links, suggests often no.
As you scale up, you need to be able to understand HTML,
so that you can make adjustments by hand and in scripts and programs,
as well as whatever assisted tools you use.
- Note WYSIWYG editors are misleading on the Web
because the Web is not WYSIWYG.
Your users are looking at your pages on mobiles, PDAs, netbooks,
old systems, tiny screens, wide screens,
with custom colours, fonts not installed,
ad blockers on
and windows resized.
WYSIWYG editors delude you into thinking that what you are looking at
is how the page will look to the user.
- Web content management system
<html>
<head>
<title> My web page </title>
</head>
<body>
<h1> My web page </h1>
<p> I am a very interesting person
and here are my poems. </p>
<p> Here is a link to my favourite artist,
<a href="http://www.daniel-site.com/"> Daniel O'Donnell</a>.
I hope to marry him some day. </p>
</body>
</html>
|
-
Browsers are forgiving:
- Case of tags doesn't matter.
Blank space and new lines are all compressed.
-
You can probably leave out the <html> tags,
and also the closing
</body>
and
</html>
- all browsers can display partial downloads.
-
Also
<p>
starts a new paragraph no matter what,
so you can leave out the
</p>
tags.
- However see
XHTML
Read
HTML Reference.
"View .. Source"
on other people's pages round the Web
to scavenge them for ideas
(be careful not to scavenge actual content (text or image) though!)
Some HTML tags.
- Plain text
- Just link to it, and browser should display it automatically.
- If problems, maybe change extension to .txt, or just scrap extension.
- Word docs, PDF, rtf
- Unfriendly to your UNIX users?
- PostScript
- Unfriendly to your Windows users?
- Latex
- How to read other formats
HTML plus images (browse-and-move-on)
HTML plus images is the most portable format,
readable everywhere and on anything.
Think of your users not just on PCs
but on netbooks, tablets, smartphones,
and
on old machines and old software and slow phone lines.
Why make them unable to read your work for no good reason.
Use the lowest common denominator.
pdf, doc, ppt, xls, ps, rtf
(and in general anything that requires plug-ins and separate applications)
often break the clean Web model of browse-and-move-on.
- Searching for and searching in:
If it is in HTML,
the content can be picked up in search engines
(whereas content of ps, doc, pdf, etc. may be hidden)
and content on a page can be easily searched.
- Linking in and out:
If it is in HTML,
people can link to it,
can link to sub-sections within it,
can link to labels within those sub-sections,
and those sections in turn can link back out
to everything else on the Web.
- Don't need them online to browse them:
- http://computing.dcu.ie/~USER/
- Can browse offline work direct from disk:
- file:///users/USER/public_html/index.html
- (this is also useful when server is down)
- Under Windows, use various tools
to make UNIX look like a drive, and browse:
- file:///X:/public_html/index.html
- Or even edit them completely elsewhere, e.g. on laptop, and upload later:
- file:///C:/My Documents/My Web pages/index.html
- For this to work we need relative links:
- <a href="subdir/file.html">
- <img src="../picture.gif">
- rather than absolute links:
- <a href="/~USER/subdir/file.html">
- <a href="http://computing.dcu.ie/~USER/subdir/file.html">
- <img src="/picture.gif">
- <img src="http://computing.dcu.ie/picture.gif">
so that the link will work whether we are browsing in "http mode"
or "file mode"
- Edit them directly off disk in UNIX, or:
- Edit them in Windows. Make UNIX account look like a drive:
- In CA lab, use SAMBA.
Then drag and drop (or edit direct off disk).
- From home/remote, use
WebDrive
(uses read-write ftp to make remote UNIX computer look like just another drive).
Then drag and drop (or edit direct off disk).
See
Accessing UNIX remotely and from Windows.