├── .gitignore ├── Gruntfile.coffee ├── package.json └── source ├── footer.jade ├── functions.php ├── header.jade ├── index.jade ├── layout.jade ├── nav.jade ├── page.jade ├── sidebar.jade ├── single.jade └── style.styl /.gitignore: -------------------------------------------------------------------------------- 1 | compiled 2 | node_modules 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /Gruntfile.coffee: -------------------------------------------------------------------------------- 1 | module.exports = (grunt) -> 2 | 3 | catchAllFiles = ['**/*.*', '!**/*.jade', '!**/*.styl',] 4 | 5 | grunt.initConfig 6 | 7 | watch: 8 | 9 | jade: 10 | files: 'source/**/*.jade' 11 | tasks: 'jadephp' 12 | options: 13 | livereload: 1337 14 | 15 | stylus: 16 | files: 'source/**/*.styl' 17 | tasks: 'stylus' 18 | options: 19 | livereload: 1337 20 | 21 | catchAll: 22 | files: catchAllFiles 23 | tasks: 'newer:copy' 24 | options: 25 | livereload: 1337 26 | 27 | jadephp: 28 | compile: 29 | options: 30 | filename: 'default' 31 | pretty: true 32 | files: [ 33 | expand: true 34 | cwd: 'source' 35 | src: ['**/*.jade'] 36 | dest: 'compiled' 37 | ext: '.php' 38 | ] 39 | 40 | stylus: 41 | compile: 42 | files: [ 43 | expand: true 44 | cwd: 'source' 45 | src: ['**/*.styl'] 46 | dest: 'compiled' 47 | ext: '.css' 48 | ] 49 | 50 | copy: 51 | catchAll: 52 | files: [ 53 | cwd: 'source' 54 | src: catchAllFiles 55 | dest: 'compiled/' 56 | expand: true 57 | ] 58 | 59 | grunt.registerTask 'default', 60 | [ 61 | 'jadephp' 62 | 'stylus' 63 | 'copy' 64 | 'watch' 65 | ] 66 | 67 | grunt.loadNpmTasks 'grunt-jade-php' 68 | grunt.loadNpmTasks 'grunt-contrib-watch' 69 | grunt.loadNpmTasks 'grunt-contrib-copy' 70 | grunt.loadNpmTasks 'grunt-contrib-stylus' 71 | grunt.loadNpmTasks 'grunt-newer' 72 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "grunt": "^0.4.5", 4 | "grunt-contrib-copy": "^0.8.1", 5 | "grunt-contrib-stylus": "^0.22.0", 6 | "grunt-contrib-watch": "^0.6.1", 7 | "grunt-jade-php": "^0.1.0", 8 | "grunt-newer": "^1.1.1", 9 | "jade-php": "^0.1.4" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /source/footer.jade: -------------------------------------------------------------------------------- 1 | :php 2 | 3 | get_sidebar(); 4 | wp_footer(); 5 | 6 | 7 | 8 | script(src='http://localhost:1337/livereload.js?snipver=1') 9 | 10 | 11 | -------------------------------------------------------------------------------- /source/functions.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjonasw/wordpress-starter-theme-jade-php/29b0e7c669a37899a117f208f1d2cda0996acc6d/source/functions.php -------------------------------------------------------------------------------- /source/header.jade: -------------------------------------------------------------------------------- 1 | doctype 2 | 3 | 4 | head 5 | meta(charset="UTF-8") 6 | title= wp_title('') 7 | link(rel="stylesheet" type="text/css" href= bloginfo('stylesheet_url') media="screen") 8 | - wp_head(); 9 | 10 | 11 | 12 | header 13 | a(href= esc_url( home_url( '/' ) ))= get_bloginfo() 14 | - get_template_part('nav') 15 | -------------------------------------------------------------------------------- /source/index.jade: -------------------------------------------------------------------------------- 1 | extends ./source/layout.jade 2 | 3 | block content 4 | :php 5 | if (have_posts()) : 6 | while (have_posts()) : the_post(); 7 | 8 | article 9 | date= the_time('j F \'y') 10 | h2: a(href= the_permalink())= the_title() 11 | p= the_excerpt() 12 | 13 | - endwhile; 14 | 15 | .pagination 16 | ul 17 | - if(next_posts_link('Older')) : 18 | li.older= next_posts_link('Older') 19 | - endif; 20 | 21 | - if(previous_posts_link('Newer')) : 22 | li.older= previous_posts_link('Newer') 23 | - endif; 24 | 25 | - else : 26 | 27 | | Nothing found 28 | 29 | - endif; 30 | -------------------------------------------------------------------------------- /source/layout.jade: -------------------------------------------------------------------------------- 1 | doctype 2 | html(lang='en') 3 | 4 | head 5 | meta(charset="UTF-8") 6 | title= wp_title('') 7 | link(rel="stylesheet" type="text/css" href= bloginfo('stylesheet_url') media="screen") 8 | - wp_head(); 9 | 10 | body 11 | 12 | header 13 | a(href= esc_url( home_url( '/' ) ))= get_bloginfo() 14 | - get_template_part('nav') 15 | 16 | block content 17 | 18 | :php 19 | 20 | get_sidebar(); 21 | wp_footer(); 22 | 23 | script(src='http://localhost:1337/livereload.js?snipver=1') 24 | -------------------------------------------------------------------------------- /source/nav.jade: -------------------------------------------------------------------------------- 1 | nav 2 | - foreach(get_pages() as $page){ 3 | a(href= get_page_link($page->ID))= $page->post_title 4 | - } 5 | -------------------------------------------------------------------------------- /source/page.jade: -------------------------------------------------------------------------------- 1 | :php 2 | get_header(); 3 | 4 | if (have_posts()) : 5 | while (have_posts()) : the_post(); 6 | 7 | article 8 | date= the_time('j F \'y') 9 | h2: a(href= the_permalink())= the_title() 10 | p= the_content() 11 | 12 | :php 13 | endwhile; 14 | endif; 15 | get_footer(); 16 | -------------------------------------------------------------------------------- /source/sidebar.jade: -------------------------------------------------------------------------------- 1 | aside 2 | h2 Categories 3 | ul 4 | - foreach(get_categories('show_count=0&title_li=&hide_empty=0&exclude=1') as $category){ 5 | li 6 | a(href= get_category_link($category->term_id))= $category->name 7 | - } 8 | -------------------------------------------------------------------------------- /source/single.jade: -------------------------------------------------------------------------------- 1 | - get_template_part('page') 2 | -------------------------------------------------------------------------------- /source/style.styl: -------------------------------------------------------------------------------- 1 | /*! 2 | Theme Name: cjonasw-JadePHP-with-grunt-Example 3 | Theme URI: https://github.com/cjonasw/ 4 | Description: cjonasw-JadePHP-with-grunt-Example 5 | Version: 1 6 | Author: Charlie Walter 7 | Author URI: http://www.charliejwalter.net 8 | */ 9 | 10 | body 11 | background #00A86B /* Jade green */ 12 | color white 13 | 14 | body:after 15 | content "JadePHP" 16 | --------------------------------------------------------------------------------