FlyZhy.Org logo Projects - touchhtml

#!/bin/bash
# touchhtml
# script for touching my HTML template file
# by Haiyong Zheng
# website: http://www.flyzhy.org/

# ANSI color definition
# Attribute:
# 0-off 1-bold(bright) 2-light(default) 4-underline 5-twinkle 7-reversal
# ForeGround:
# 30-black 31-red 32-green 33-yellow 34-blue 35-magenta 36-bluer 37-white
# BackGround:
# 40-black 41-red 42-green 43-yellow 44-blue 45-magenta 46-bluer 47-white
# Format: \033[Attribute;ForeGround;BackGroundm
# ie:
# NORMAL="\[\033[0m\]"
# BRIGHT_MAGENTA_RED="\[\033[1;35;41m\]"

echo -ne "Creating Standard XHTML 1.0 Strict template html file with \033[1;30;43mtitle\033[0m, \033[1;30;43mkeywords\033[0m, \033[1;30;43mdescription\033[0m, \033[1;30;43mheading\033[0m, and \033[1;30;43mdate\033[0m.\n"
echo -ne "Welcome to my homepage \033[2;33;44m http://www.flyzhy.org/\033[0m\n"
echo -ne "\n"
if [ $# -ne 1 ]; then
        echo -ne "Usage: $0 filename.html\n";
        exit 1;
fi
echo -ne "\n"
echo -ne "#########################################\n"
echo -ne "# \033[1;30;43mtitle\033[0m: The tile of $1\n"
echo -ne "#########################################\n"
echo -ne "\n"
echo -ne "### input your \033[1;30;43mtitle\033[0m:"
read title
echo -ne "title: $title\n"
echo -ne "\n"
echo -ne "#########################################\n"
echo -ne "# \033[1;30;43mkeywords\033[0m: GNU, linux, unix\n"
echo -ne "#########################################\n"
echo -ne "\n"
echo -ne "### input your \033[1;30;43mkeywords\033[0m:"
read keywords
echo -ne "keywords: $keywords\n"
echo -ne "\n"
echo -ne "#########################################\n"
echo -ne "# \033[1;30;43mdescription\033[0m: The description of $1\n"
echo -ne "#########################################\n"
echo -ne "\n"
echo -ne "### input your \033[1;30;43mdescription\033[0m:"
read description
echo -ne "description: $description\n"
echo -ne "\n"
echo -ne "#########################################\n"
echo -ne "# \033[1;30;43mheading\033[0m: The heading of $1\n"
echo -ne "#########################################\n"
echo -ne "\n"
echo -ne "### input your \033[1;30;43mheading\033[0m:"
read heading
echo -ne "heading: $heading\n"
echo -ne "\n"
echo -ne "#########################################\n"
echo -ne "# \033[1;30;43mdate\033[0m: Created date of $1\n"
echo -ne "#########################################\n"
echo -ne "\n"
date=`date`
echo -ne "date: $date\n"

touch $1
cat << EOF >> $1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<title>$title</title>
<link rel="Shortcut Icon" type="image/ico" href="/style/lover.ico" />
<link rel="stylesheet" type="text/css" href="/style/flyzhy.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="Haiyong Zheng" />
<meta name="keywords" content="$keywords" />
<meta name="description" content="$description" />
<script src="/style/abbr.js" type="text/javascript"></script>
</head>

<body>
<h1>$heading</h1>
<address>by Haiyong Zheng <a href="http://www.flyzhy.org/">flyzhy.org</a>
        &lt;<a href="mailto:flyzhy.org@gmail.com"><img src="/style/FlyZhy_Gmail_logo.png" alt="Email to Contact FlyZhy.Org" /></a>&gt;
        $date
</address>
<hr />
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-3203017294401244";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "578A24";
google_color_bg = "CCFF99";
google_color_link = "00008B";
google_color_url = "00008B";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<hr />
<!-- ######### The body of the html file #########-->

<hr />
Dec 14, 2006    <i>last modified</i><br />
Copyright (c) 2005, 2006 <a href="mailto:flyzhy.org@gmail.com">Haiyong Zheng</a> | <a href="http://www.flyzhy.org/">flyzhy.org</a> AT <a href="http://www.ouc.edu.cn/">OUC</a>

</body>

</html>
EOF
echo -ne "\n"
echo -ne "OK! Getting started to write your own $1 now ...\n"