From 23375c7f3f181b249dffc2907290c01967ab7c58 Mon Sep 17 00:00:00 2001 From: James Tomasino Date: Tue, 11 Dec 2018 21:20:04 -0500 Subject: [PATCH] added line numbers to log entries --- bin/cosmic-web | 17 +++++++++++------ templates/webheader.tmpl | 5 +++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/bin/cosmic-web b/bin/cosmic-web index 49f258b..4c15ff5 100755 --- a/bin/cosmic-web +++ b/bin/cosmic-web @@ -10,9 +10,9 @@ entry_index () { # print link in listings if [ $index -lt 20 ]; then - printf ">> %s\\n" "$loghtml" "$title" >> "${file_html}" + printf "
  • >> %s
  • \\n" "$loghtml" "$title" >> "${file_html}" fi - printf ">> %s\\n" "$loghtml" "$title" >> "${log_html}" + printf "
  • >> %s
  • \\n" "$loghtml" "$title" >> "${log_html}" # create entry entry_html="${html_dir}${loghtml}.html" @@ -42,6 +42,8 @@ if [ "$run_user" -eq 0 ]; then html_dir="/var/www/html" gopher_dir="/var/gopher" + logcount=$(wc -l "${gopher_dir}/listing.gophermap" | awk '{print $1}') + # Clear web folder rm -rf "${html_dir:-/var/www/html}/*" # Generate RSS @@ -66,12 +68,12 @@ if [ "$run_user" -eq 0 ]; then printf "
    "
         # Intro text
         cat "${gopher_dir}/intro.gophermap"
    -    # Ship listings
         printf "\\n>> Complete Transmission Log\\n"
         printf ">> Ships, Colonies, Outposts\\n"
         printf ">> RSS Feed\\n\\n"
         # Logs
    -    printf "Most recent (20) log entries:\\n"
    +    printf "Most recent log entries:\\n"
    +    printf "
      " "$logcount" } >> "${file_html}" # Custom header elements and body start @@ -85,6 +87,7 @@ if [ "$run_user" -eq 0 ]; then printf "<< BACK TO RELAY ONE\\n\\n" # Intro text cat "${gopher_dir}/log/intro.gophermap" + printf "
        " } >> "${log_html}" # Loop through listings gophermap @@ -95,6 +98,7 @@ if [ "$run_user" -eq 0 ]; then done < "${gopher_dir}/listing.gophermap" # footer { + printf "
      \\n" printf "
    \\n" printf "\\n" printf "\\n" @@ -147,8 +151,9 @@ if [ "$run_user" -eq 0 ]; then printf "\\n" fi printf "%s - Ship Log\\n" "$ship" - grep "^0${ship}" "${gopher_dir}/listing.gophermap" | sed "s|0${ship} - ||" | awk -F"\\t" '{f=$2; gsub(".txt", ".html", f); printf ">> %s\n", f, $1}' - printf "" + printf "
      " + grep "^0${ship}" "${gopher_dir}/listing.gophermap" | sed "s|0${ship} - ||" | awk -F"\\t" '{f=$2; gsub(".txt", ".html", f); printf "
    1. >> %s
    2. \n", f, $1}' + printf "
    " } >> "${ship_html}" fi done diff --git a/templates/webheader.tmpl b/templates/webheader.tmpl index 217016c..41e9ad3 100644 --- a/templates/webheader.tmpl +++ b/templates/webheader.tmpl @@ -33,6 +33,11 @@ width: auto; } + ol { + padding: 0; + line-height: 0.5em; + } + @media screen and (min-width: 700px) { body, html { font-size: 18px;