Skip to content

Commit

Permalink
add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
furtherLee committed Sep 4, 2012
1 parent f639df3 commit 4186e91
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,3 +1,4 @@
*.htaccess
app/views/pages/*
app/config.php
app/views/pages/*.html

15 changes: 13 additions & 2 deletions app/Makefile
@@ -1,2 +1,13 @@
gensite:

PAGE_DIR:=pages/
HTML_DIR:=view/pages/
GENERATOR:=rdiscount

PAGES:=$(wildcard $(PAGE_DIR)*.md)
HTMLS:=$(subst md,html,$(subst $(PAGE_DIR),$(HTML_DIR),$(PAGES)))

.PHONY: pages *.html

%.html:
rdiscount $(subst $(HTML_DIR),$(PAGE_DIR),$(subst html,md,$@)) > $@

pages: $(HTMLS)
6 changes: 6 additions & 0 deletions app/config-debug.php
@@ -0,0 +1,6 @@
<?php

define('HOME_BASE', 'http://localhost/further/');
define('JS_BASE', HOME_BASE.'assets/js/');
define('CSS_BASE', HOME_BASE.'assets/css/');
define('IMG_BASE', HOME_BASE.'assets/img/');
File renamed without changes.
Empty file removed app/config.php
Empty file.
1 change: 1 addition & 0 deletions app/config.php
1 change: 1 addition & 0 deletions app/pages/about.md
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions app/pages/books.md
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions app/pages/projects.md
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions app/pages/tools.md
@@ -0,0 +1 @@

9 changes: 9 additions & 0 deletions app/show.php
@@ -0,0 +1,9 @@
<?php


$page = $_GET['page'];

if(!isset($page))
$page = "about";


Empty file removed app/view/pages/books.php
Empty file.
Empty file removed app/view/pages/projects.php
Empty file.
Empty file removed app/view/pages/tools.php
Empty file.
4 changes: 2 additions & 2 deletions index.php
Expand Up @@ -4,5 +4,5 @@
* Author: Li Shijian
* Last Modification: 2012.9.4
*/
require("app/config.php");
require("app/show.php");
require_once("app/config.php");
require_once("app/show.php");

0 comments on commit 4186e91

Please sign in to comment.