index.sh
changeset 902 034aeeb2a16d
child 903 9ead7d97be34
equal deleted inserted replaced
901:e8d1390c77b3 902:034aeeb2a16d
       
     1 #!/bin/sh
       
     2 
       
     3 echo '<html>'
       
     4 echo '<head>'
       
     5 echo '  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">'
       
     6 echo '  <title>Tips</title>'
       
     7 echo '  <style type="text/css">'
       
     8 echo '    body { background-color: linen; }'
       
     9 echo '    a { text-decoration:none; }'
       
    10 echo '    a:link { color: brown; }'
       
    11 echo '    a:visited { color: IndianRed; }'
       
    12 echo '    a:hover { background: beige; border-radius: 10px; padding: 1px; }'
       
    13 echo '  </style>'
       
    14 echo '</head>'
       
    15 echo '<body>'
       
    16 echo '<h1>Tips</h1>'
       
    17 echo '<ul>'
       
    18 
       
    19 for file in *.rst *.txt; do
       
    20   ext=${file##*.}
       
    21   name=${file%.${ext}}
       
    22   case $ext in
       
    23     txt)
       
    24       printf '  <li><a href="%s.txt" target="article">%s</a>\n' $name $name
       
    25       ;;
       
    26     rst)
       
    27       printf '  <li><a href="%s.html" target="article">%s</a>\n' $name $name
       
    28       ;;
       
    29   esac
       
    30 done
       
    31 
       
    32 echo '<p>'
       
    33 echo '<address>'
       
    34 echo '    <a href="mailto:gavenkoa@gmail.com">Oleksandr Gavenko</a>'
       
    35 echo '</address>'
       
    36 echo '</body>'
       
    37 echo '</html>'