Giter VIP home page Giter VIP logo

directory-theme's Introduction

Directory Theme

Thanks to jfrazelle for providing the wonderful base theme which I used as my base.

The core reason for my fork and changes was to focus on NGINX and tweak a few visual aspects of the theme to better suit my own needs and play better with NGINX. The original theme, while great, only truly shined on Apache directory listing since NGINX currently doesn't support richer features such as MIME icons, search, etc. Because of this there was a lot of extra resources that would just be ignored on NGINX and resulted in a browsing experience that wasn't quite as visually nice as the equivalent running on Apache.

Dependencies

To start, you're going to want to ensure that your NGINX installation was built including the Fancy Index module. In brief, this module provides some slight improvements over NGINX's vanilla autoindex and provides additional goodies like human-readable file sizes, date formatting, etc.

Install

To install, clone or download this repository and put it at the root of your directory listing site in /var/www/ or wherever you put the websites that you've added to NGINX. To hide the theme directory from your listing change the name to .theme as jfrazelle did. At this time feel free to take a peek into footer.html and change the footer links to be your own Twitter account, blog, whatever.

Now for the last step, in your sites-enabled directory in NGINX you're going to want to vim into your directory listing site and paste this as the last chunk in your server block:

root /var/www/${YOUR_PATH_HERE};
charset utf-8;

error_page 404 /.theme/404.html;
# let non-html ending links point to the html file
try_files $uri.html $uri $uri/ =404;

location / {
    auth_basic            "Restricted Area";
    auth_basic_user_file  /etc/nginx/conf.d/.htpasswd;
    fancyindex on;
    fancyindex_exact_size off;
    fancyindex_footer /.theme/footer.html;
    fancyindex_header /.theme/header.html;
    fancyindex_css_href /.theme/style.css;
    fancyindex_time_format "%B %e, %Y";
}

I'm unsure if having the vanialla autoindex enabled above this will screw with things, so to be safe remove that line if it was present before. Reload your page and you should now be using a nicer theme that can easily be tweaked to your own liking.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.