Coder Social home page Coder Social logo

nesbot.com's Introduction

nesbot.com

I am making the source code of my personal site available publicly in case it helps anybody. It's developed using the Slim Framework.

I am working on a blog post about the rewrite and it should get posted in the next few days finally got posted: http://nesbot.com/2013/1/11/this-blog-trimmed-the-fat-now-powered-by-slim-2.

Installation

The dependencies are resolved using composer.

If you have PHP 5.4+ installed you can be up and running in 10 seconds +/- 5 seconds for slower typers or copy & pasters.

git clone git://github.com/briannesbitt/nesbot.com.git
cd nesbot.com
curl -s http://getcomposer.org/installer | php
php composer.phar update
touch env.local
cd public
php -S 127.0.0.1:80

Thats it. Open a browser to http://127.0.0.1/ and you should see the site as you see at nesbot.com

If you are running a version of PHP 5.3, the setup for nginx and apache are shown below. Either way you will still need to perform the first 5 commands from above.

Nginx

http://docs.slimframework.com/pages/routing-url-rewriting/#nginx

The root should be pointing to the /your/install/path/nesbot.com/public directory of the project.

Apache

http://docs.slimframework.com/pages/routing-url-rewriting/#apache_and_mod_rewrite

As shown you will need to create a .htaccess file in the 'public/' folder. I try not to use apache if possible so there isn't one in the repo.

The DocumentRoot should be pointing to the /your/install/path/nesbot.com/public directory of the project.

How do I?

Bundle assets

To generate the posts file, compile the less and minify/combine the js run the following command from the project root.

php bundle.php

This command is run on every page load when in local (development) mode.

Add a post

  • Create a new file in views/posts/ with a format of yyyy-m-d-slug.php.
  • The first line in the file needs to be <?/*Post title!*/?>.
  • Run php genposts.php from the project root. (this is automatically ran when in local mode)

This will parse the files in the views/posts/ directory and extract the date, slug and title for each post and generate a new posts.php.

See the posts already in there for examples of functions you can use while writing posts.

What about... ?

This isn't your grandma's blog... read the code and figure it out.

Author

Brian Nesbitt - [email protected] - http://twitter.com/NesbittBrian

License

Source code

The code for this project is licensed under the MIT License.

Blog posts

You are free to copy, distribute, modify or display any or all of the blog post material. However you may not use it, in any way, for commercial purposes.

Previous versions

Previously the site was developed against different versions of the Play framework.

nesbot.com's People

Contributors

briannesbitt avatar

Watchers

Francis Suarez avatar James Cloos avatar

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.