Skip to content

ni-c/photocake

Repository files navigation

photocake

About

photocake is a markdown photoblog based on CakePHP. It is able to parse Jpeg-files and create blog posts using the EXIF data of the images.

You can find a live demo of photocake at willithiel.de.

Features

  • Fast (Ultrafast with Nginx)
  • Multilingualized (Currently English and German)
  • Resizing of images (if necessary) with ImageMagick
  • Needs only (well-formated markdown) EXIF data to create photo posts

Installation

Requirements

photocake needs the CakePHP framework to run. Version 2.3 of CakePHP can be found on GitHub. You should read the CakePHP Cookbook for a detailed installation guide.

Step by step

Clone the CakePHP framework

git clone git://github.com/cakephp/cakephp.git ~/cakephp

Update your PHP include path to the cakephp lib path

vi /etc/php5/cgi/php.ini

search for 'include_path' and add "~/cakephp/lib" (include_path = "~/cakephp/lib")

Restart PHP

sudo /etc/init.d/php5 restart

Clone photocake

git clone git://github.com/ni-c/photocake.git ~/photocake
git submodule init
git submodule update

Git hooks (optional)

To register the git hooks that clear the photocake cache and generate static files you should run the following command after cloning:

bin/create-hook-symlinks

Make ~/photocake accessible from your webserver.

photocake comes with an install script that asks for your database credentials when you visit your fresh blog the first time.

nginx

If you are using Apache as webserver, then the included .htaccess files will do the URL rewriting. If you are using nginx, then you have to do some configuration. Here is an example configuration file for nginx:

server {
  listen   80;
  server_name YOURDOMAIN.COM;

  # Serve static content directly with some caching goodness
  location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|mp3|ogg|html|htm)$ {
    root /var/www/$host;
    access_log        off;
    expires           1d;
    break;
  }

  # Deny .ht files
  location ~ /\.ht {
    access_log        off;
    deny              all;
    break;
  }

  # CakePHP rewrite rules
  location / {
    access_log        off;
    root              ~/photocake;  # Project directory
    index             index.php;

    # Serve static pages immediately
    if (-f $request_filename) {
      break;
    }

    if (!-e $request_filename) {
      rewrite ^/(.+)$ /index.php?url=$1 last;
      break;
      }
    }

  # FastCGI
  location ~ .php$ {
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /~/photocake/$fastcgi_script_name;  # Project directory
    include        fastcgi_params;
  }
}

Creating Posts

You can add a post to your photocake blog by copying a JPG-Image into a directory (Default: Files/). photocake will extract the EXIF data from the image and create a new blog post. To parse all new images in the folder open /admin/publish.

For title, description, categories and tags of the new post, a JSON-String is expected in the EXIF data for 'ImageDescription':

{
  "Title":"A Title",
  "Description":"Some *markdown* discription",
  "Category":"Nice images",
  "Tags":"some,comma,separated,tags"
}

You can use exiftool to view and edit the EXIF data of your images. To set the 'ImageDescription' with exiftool type:

exiftool -ImageDescription='{"Title":"foo","Description":"bar","Category":"foobar","Tags":"foo,bar"}' [filename].jpg

References

Build upon the CakePHP PHP Framework. Inspired by the pixelpost photoblog app and the The World in 35mm template.

License

The license under which photocake is released is the GPLv2 (or later) from the Free Software Foundation.

About

photocake is a markdown photo blog based on CakePHP.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published