#---------------------------------------------------------------------------------------------------
# an apache web server folder-specific config file
# used only when unzipped content is viewed on the hosting web server
#
# - enable auto index pages when viewed in a browser
# - display (not run) python source code files
# - inherited by all subdirs: need just one at top of tree
#
# my isp: 
# - botches UTF8 signed BOM bytes in READMEs (had to resave 
#   some in ascii (notepad's "ansi") mode)
# - prefers an .html README over a .txt if both are present
#   (had to name the .txt explicitly here)
# - doesn't show .html files in root in indexes if they are 
#   prefixed by "README", due to a "IndexIgnore README* in 
#   httpd.conf, presumably (had to rename some files "Readme*")
#
# jun17 - ignore the zip; the top-level *is* the zip's content...
#
# oct17: RemoveHandler was broken by godaddy relocating my site...
# it can now appear just once, in the Books root folder's .htaccess;
#
# feb18: README.txt broken by showcode rewite rule in root .htaccess;
# fix by using HTML, and make mobile-friendly (not in lower levels);
#---------------------------------------------------------------------------------------------------

Options +Indexes
###RemoveHandler cgi-script .py .pyw
ReadmeName _README.html
IndexIgnore iconify-full-package.zip


#---------------------------------------------------------------------------------------------------
# Feb18: COPIED from feb18 generated page into .htaccess of all Apache auto-index folders.
# Can't use HeaderName insert files easily: requires unique title text in each.
# This could be generated by genhtml in .., but must then be one with title for each.
# Footer: see dummy-footer-COPY (dummy_footer.html links must be "..", only one ReadmeName).
# TDB: punt on analytics js?: already run by showsource url for files themselves.
# Aug18: use new https paths for icon/css resources, not http (see root .htaccess note).
#---------------------------------------------------------------------------------------------------

# else wrapped badly on small srceens; root .htaccess does [IndexOptions NameWidth=*]
IndexOptions +SuppressDescription +SuppressLastModified +SuppressSize

# else whole page is sent as Latin-1 (despite <meta>) which breaks UTF8 chars in README
IndexOptions +Charset=UTF-8

# else list includes this (but not README.txt!) in larger programs' pages; HTML is shown
IndexIgnore _README.html

# only 1 insert allowed (and though scantly documented, \=continuation in .htaccess);
# this adds: [unicode type, page icon, site-wide styles, mobile support, analytics];
# it _almost_ works to put all this in a separate common file referenced by HeaderName,
# but it shows up after </head> in <body>, and that's wrong for <meta> per standards;

IndexHeadInsert "\
<!--------INSERT by .htaccess--------> \
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"> \
\
<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://learning-python.com/favicon.ico\" /> \
\
<link rel=\"stylesheet\" type=\"text/css\" href=\"https://learning-python.com/_main.css\"> \
\
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"> \
\
<script> \
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ \
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), \
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) \
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); \
  ga('create', 'UA-52579036-1', 'auto'); \
  ga('send', 'pageview'); \
</script> \
\
<style> LI {margin-bottom: 5px;} UL {margin-bottom: 35px;} </style> \
<!--------END INSERT by .htaccess--------> \
"
