Giter Club home page Giter Club logo

windex's Introduction

Windex

Make your localhost look nice with styled directory index pages. No more 1996 jank.

Features include:

  • SVG icons, sized pixel-perfect for 24x24 & multiples thereof
  • View HTML files without extensions: project/page.html at project/page
  • Nice mobile view with big tap targets

View Windex demo on CodePen

Windex screenshot

Install

Windex uses Apache.

Let's say your root folder used for localhost is ~/dev.

  1. Download or clone this project to the root folder: ~/dev/windex
  2. Move .htaccess to the root folder: ~/dev/.htaccess

.htaccess is a hidden file. You can copy it to its location in Terminal via the command line:

cd ~/dev
cp windex/.htaccess .

Setting up a practical localhost on macOS

I like to use localhost so I can view my projects in ~/dev. This allows me to create static sites that I can easily view in the browser, without having to start up a server. For example, going to localhost/masonry/sandbox allows me to see ~/dev/masonry/sandbox.

Below are instructions to set that up on macOS. This will make a single user's folder viewable for all users. For separate users folders like localhost/~username, view these instructions.


Open /etc/apache2/httpd.conf in your text editor. Making changes to this file will require administrator access. Change the following lines (line numbers may vary in your file):

Line 186: Enable mod_rewrite. This enables .htaccess files to rewrite URLs.

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

Lines 255-256: Change DocumentRoot and subsequent Directory to your desired directory. This sets localhost to point to the directory.

DocumentRoot "/Users/username/dev"
<Directory "/Users/username/dev">

Line 269: Within this <Directory> block, add Indexes to Options. This enables file index view.

    Options FollowSymLinks Multiviews Indexes

Line 277: Change AllowOverride value to All. This enables .htaccess files.

    AllowOverride All

That block should look like:

DocumentRoot "/Users/username/dev"
<Directory "/Users/username/dev">
    # Possible values for the Options directive...
    Options FollowSymLinks Multiviews Indexes
    MultiviewsMatch Any

    # AllowOverride controls what directives...
    AllowOverride All

    # Controls who can get stuff from this server.
    Require all granted
</Directory>

Save changes to httpd.conf. This may require macOS user approval.

In Terminal, start or restart apachectl.

sudo apachectl restart

View http://localhost in a browser. You'll should see the index page for ~/dev. Without Windex, it's ugly, but it works. With Windex, it's pretty.

If you messed up httpd.conf, you can replace it with its original at /etc/apache2/original/httpd.conf.

Viewing on other devices on macOS

You can view this localhost on another device like a phone.

  1. Open System Preferences. Select Sharing.
  2. Change Computer name to something rad, like thunderclaw, if you haven't already.
  3. Enable File sharing.

Now, you can view http://thunderclaw.local on another device if you are on the same Wi-Fi.

Alternatives

License

Windex is released under the MIT license. Have at it.


Made by David DeSandro

windex's People

Contributors

bjrn avatar daveatnclud avatar desandro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windex's Issues

Windex Not working !!!

Hi desandro

Whatever I try , I can not install Windex.

I'm using sharing host. my sharing host working on Litespeed web server.

Windex Page not created never.My feeling is that I do the right steps.

Media Temple not working

I've had two Media Temple users fail at getting Windex working. The closest we came was to changing windex/.htaccess

AddHandler application/x-httpd-php5 .php

to

AddHandler php5-script .php

This solution got the php header and footer to be parsed and displayed correctly. But no directory listings were being generated. I believe the problem has to do with Apache, but I can't make a clear diagnosis.

Not working with WordPress installation

Taken from Richard Sweeney's comment on the nclud blog:

Hi @dave - thanks for this, but whilst I can view my other sites (for example those built with Zend and those in Plain HTML) I can’t view my local WordPress by simply navigating to local host… I always get taken to a 404 which lacks any CSS or JavaScript included files.

I have given the site a hostname with MAMP pro and it obviously works fine on my local machine.

It may have something to do with how WordPress works.. When I click on an internal link it removes the IP address of the serving computer and I get taken to another site to or I get an error.

So, on my iPhone I can navigate to 10.blah.blah and there I can navigate my localhost - when I click on a folder which contains the site I get taken to 10.blah.blah/my-local-site.com/ - and when I click on a link on this site I get taken to my-local-site.com (404).

Any thoughts on what I could do to make this work?!

I should add that I get the same 404 if I navigate to the site on the serving computer via localhost - so localhost/my-local-site.com brings me the site, but I get 404

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.