├── assets ├── js │ └── .gitkeep ├── css │ └── .gitkeep └── img │ ├── .gitkeep │ ├── whoops.svg │ └── 404.svg ├── app ├── PostTypes │ └── .gitkeep ├── Http │ ├── Controllers │ │ ├── .gitkeep │ │ └── Controller.php │ └── Lumberjack.php ├── Menu │ ├── Menu.php │ └── Item.php ├── Providers │ └── AppServiceProvider.php └── Exceptions │ └── Handler.php ├── .gitignore ├── views ├── html-footer.twig ├── templates │ ├── generic-page.twig │ ├── home.twig │ ├── posts.twig │ └── errors │ │ ├── 404.twig │ │ └── whoops.twig ├── base.twig └── html-header.twig ├── screenshot.png ├── config ├── timber.php ├── menus.php ├── posttypes.php ├── images.php ├── session.php └── app.php ├── style.css ├── .editorconfig ├── routes.php ├── bootstrap ├── app.php └── autoload.php ├── functions.php ├── phpcs.xml ├── .github ├── PULL_REQUEST_TEMPLATE.md └── ISSUE_TEMPLATE.md ├── single.php ├── 404.php ├── search.php ├── composer.json ├── index.php ├── author.php ├── page.php ├── LICENSE.txt ├── archive.php └── README.md /assets/js/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/PostTypes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/css/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/img/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/Http/Controllers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | vendor 3 | -------------------------------------------------------------------------------- /views/html-footer.twig: -------------------------------------------------------------------------------- 1 | {{ function('wp_footer') }} 2 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rareloop/lumberjack/HEAD/screenshot.png -------------------------------------------------------------------------------- /config/timber.php: -------------------------------------------------------------------------------- 1 | [ 8 | 'views', 9 | ], 10 | ]; 11 | -------------------------------------------------------------------------------- /views/templates/generic-page.twig: -------------------------------------------------------------------------------- 1 | {% extends "base.twig" %} 2 | 3 | {% block content %} 4 |
5 |

{{ title }}

6 | {{ content|raw }} 7 |
8 | {% endblock %} 9 | -------------------------------------------------------------------------------- /views/templates/home.twig: -------------------------------------------------------------------------------- 1 | {% extends "base.twig" %} 2 | 3 | {% block content %} 4 |
5 |

{{ title }}

6 |

{{ content|raw }}

7 |
8 | {% endblock %} 9 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Lumberjack Starter Theme 3 | Description: A supercharged starter theme for WordPress 4 | Version: 2.0.0 5 | Author: Rareloop 6 | Author URI: http://rareloop.com 7 | */ 8 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | [ 8 | 'main-nav' => __('Main Navigation'), 9 | ], 10 | ]; 11 | -------------------------------------------------------------------------------- /routes.php: -------------------------------------------------------------------------------- 1 | Hello World!'); 8 | // }); 9 | -------------------------------------------------------------------------------- /app/Menu/Menu.php: -------------------------------------------------------------------------------- 1 | [ 9 | ], 10 | ]; 11 | -------------------------------------------------------------------------------- /views/base.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% include 'html-header.twig' %} 5 | 6 | 7 | 8 | {% block content %} 9 |

Sorry, no content

10 | {% endblock %} 11 | 12 | {% include 'html-footer.twig' %} 13 | 14 | 15 | -------------------------------------------------------------------------------- /config/images.php: -------------------------------------------------------------------------------- 1 | 'thumb' 8 | * 'width' => 100, 9 | * 'height' => 200, 10 | * 'crop' => true, 11 | * ] 12 | */ 13 | 'sizes' => [ 14 | ], 15 | ]; 16 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | bind(HandlerInterface::class, $app->make(Handler::class)); 14 | 15 | return $app; 16 | -------------------------------------------------------------------------------- /views/html-header.twig: -------------------------------------------------------------------------------- 1 | 2 | {{ function('wp_title') }} 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ function('wp_head') }} 10 | 11 | -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | make(Lumberjack::class); 10 | $lumberjack->bootstrap(); 11 | 12 | // Import our routes file 13 | require_once('routes.php'); 14 | 15 | // Set global params in the Timber context 16 | add_filter('timber_context', [$lumberjack, 'addToContext']); 17 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | current) { 18 | $this->add_class($this->listItemClass . '--current'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /phpcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Rareloop Coding Standards 4 | 5 | 6 | . 7 | 8 | 9 | 10 | 11 | 12 | */vendor/* 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | (Thanks for sending a pull request! Please make sure you read the contribution guidelines, then fill out the blanks below.) 2 | 3 | What does this implement/fix? Explain your changes. 4 | --------------------------------------------------- 5 | … 6 | 7 | Does this close any currently open issues? 8 | ------------------------------------------ 9 | … 10 | 11 | 12 | Any relevant logs, error output, etc? 13 | ------------------------------------- 14 | (If it’s long, please paste to https://ghostbin.com/ and insert the link here.) 15 | 16 | Any other comments? 17 | ------------------- 18 | … 19 | -------------------------------------------------------------------------------- /single.php: -------------------------------------------------------------------------------- 1 | title; 23 | $context['content'] = $post->content; 24 | 25 | return new TimberResponse('templates/generic-page.twig', $context); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /404.php: -------------------------------------------------------------------------------- 1 | $searchQuery, 24 | ]); 25 | 26 | return new TimberResponse('templates/posts.twig', $context); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rareloop/lumberjack", 3 | "license": "MIT", 4 | "type": "wordpress-theme", 5 | "description": "Lumberjack WordPress starter theme", 6 | "authors": [ 7 | { 8 | "name": "Adam Tomat", 9 | "email": "adam.tomat@rareloop.com", 10 | "homepage": "http://rareloop.com" 11 | }, 12 | { 13 | "name": "Joe Lambert", 14 | "email": "joe@rareloop.com", 15 | "homepage": "http://rareloop.com" 16 | } 17 | ], 18 | "keywords": [ 19 | "lumberjack", "composer", "wordpress", "wp", "theme", "timber", "twig", "mvc", "dry" 20 | ], 21 | "require": { 22 | "composer/installers": "^1.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | query_vars['author']); 23 | 24 | $data['author'] = $author; 25 | $data['title'] = 'Author Archives: ' . $author->name(); 26 | 27 | $data['posts'] = Post::query([ 28 | 'author' => $author->ID 29 | ]); 30 | 31 | return new TimberResponse('templates/posts.twig', $data); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /page.php: -------------------------------------------------------------------------------- 1 | title; 28 | $context['content'] = $page->content; 29 | 30 | return new TimberResponse('templates/generic-page.twig', $context); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /views/templates/posts.twig: -------------------------------------------------------------------------------- 1 | {% extends "base.twig" %} 2 | 3 | {% block content %} 4 |
5 |

{{ title }}

6 | 7 |
8 | {{ content|raw }} 9 |
10 | 11 | {% if posts|length > 0 %} 12 | 24 | {% else %} 25 |

No results found.

26 | {% endif %} 27 |
28 | {% endblock %} 29 | -------------------------------------------------------------------------------- /app/Http/Lumberjack.php: -------------------------------------------------------------------------------- 1 | getenv('SESSION_DRIVER') ?: 'file', 8 | 9 | /** 10 | * The name of the cookie that is set in a visitors browser 11 | */ 12 | 'cookie' => getenv('SESSION_COOKIE') ?: 'lumberjack_session', 13 | 14 | /** 15 | * How long the session will persist for 16 | */ 17 | 'lifetime' => getenv('SESSION_LIFETIME') ?: 120, 18 | 19 | /** 20 | * The URL path that will be considered valid for the cookie. Normally this is the 21 | * root of the domain but might need to be changed if serving WordPress from a sub-directory. 22 | */ 23 | 'path' => '/', 24 | 25 | /** 26 | * The domain that the cookie is valid for 27 | */ 28 | 'domain' => getenv('SESSION_DOMAIN') ?: null, 29 | 30 | /** 31 | * If true, the cookie will only be sent if the connection is done over HTTPS 32 | */ 33 | 'secure' => getenv('SESSION_SECURE_COOKIE') ?: false, 34 | 35 | /** 36 | * If true, JavaScript will not be able to access the cookie data 37 | */ 38 | 'http_only' => true, 39 | 40 | /** 41 | * Should the session data be encrypted when stored? 42 | */ 43 | 'encrypt' => false, 44 | 45 | /** 46 | * When using the `file` driver this is the path to which session data is stored. 47 | * If none is specified the default PHP location will be used. 48 | */ 49 | 'files' => false, 50 | ]; 51 | -------------------------------------------------------------------------------- /archive.php: -------------------------------------------------------------------------------- 1 | getenv('WP_ENV'), 8 | 9 | /** 10 | * Is debug mode enabled? 11 | */ 12 | 'debug' => WP_DEBUG ?? false, 13 | 14 | /** 15 | * List of providers to initialise during app boot 16 | */ 17 | 'providers' => [ 18 | Rareloop\Lumberjack\Providers\RouterServiceProvider::class, 19 | Rareloop\Lumberjack\Providers\WordPressControllersServiceProvider::class, 20 | Rareloop\Lumberjack\Providers\TimberServiceProvider::class, 21 | Rareloop\Lumberjack\Providers\ImageSizesServiceProvider::class, 22 | Rareloop\Lumberjack\Providers\CustomPostTypesServiceProvider::class, 23 | Rareloop\Lumberjack\Providers\MenusServiceProvider::class, 24 | Rareloop\Lumberjack\Providers\LogServiceProvider::class, 25 | Rareloop\Lumberjack\Providers\ThemeSupportServiceProvider::class, 26 | Rareloop\Lumberjack\Providers\QueryBuilderServiceProvider::class, 27 | Rareloop\Lumberjack\Providers\SessionServiceProvider::class, 28 | Rareloop\Lumberjack\Providers\EncryptionServiceProvider::class, 29 | 30 | // Application Providers 31 | App\Providers\AppServiceProvider::class, 32 | ], 33 | 34 | 'aliases' => [ 35 | 'Config' => Rareloop\Lumberjack\Facades\Config::class, 36 | 'Log' => Rareloop\Lumberjack\Facades\Log::class, 37 | 'Router' => Rareloop\Lumberjack\Facades\Router::class, 38 | 'Session' => Rareloop\Lumberjack\Facades\Session::class, 39 | ], 40 | 41 | /** 42 | * Logs enabled, path and level 43 | * 44 | * When path is `false` the default Apache/Nginx error logs are used. By setting path to a string, no logs will be sent 45 | * to the default and instead a file will be created. To disable all logging output set `enabled` to `false`. 46 | */ 47 | 'logs' => [ 48 | 'enabled' => true, 49 | 'path' => false, 50 | 'level' => Monolog\Logger::ERROR, 51 | ], 52 | 53 | 'themeSupport' => [ 54 | 'post-thumbnails', 55 | ], 56 | 57 | /** 58 | * The key used by the Encrypter. This should be a random 32 character string. 59 | */ 60 | 'key' => getenv('APP_KEY'), 61 | ]; 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![framework](https://img.shields.io/github/release/rareloop/lumberjack-core.svg)](https://github.com/Rareloop/lumberjack/releases) 2 | [![GitHub license](https://img.shields.io/github/license/rareloop/lumberjack.svg)](https://github.com/Rareloop/lumberjack/blob/master/LICENSE.txt) 3 | ![Downloads](https://img.shields.io/packagist/dt/rareloop/lumberjack-core.svg) 4 | [![Trees Planted](https://img.shields.io/ecologi/trees/rareloop.svg?label=trees%20planted)](https://ecologi.com/rareloop?r=60618d1bcdd7a4001d7b86f2) 5 | 6 | 7 | Lumberjack Logo 8 | 9 | # Supercharge your WordPress Development 10 | 11 | Lumberjack is a powerful MVC framework for the modern WordPress developer. Write better, more expressive and easier to maintain code. 12 | 13 | ## Who is Lumberjack for? 14 | 15 | Coming from another PHP framework such as Laravel, have experience using Timber with WordPress but want more, or are just getting started with modern WordPress? Then Lumberjack is for you. 16 | 17 | Use as little or as much as you need, it's beginner friendly! 18 | 19 | ## Documentation 20 | 21 | The Lumberjack documentation can be found here: 22 | 23 | [https://docs.lumberjack.rareloop.com](https://docs.lumberjack.rareloop.com) 24 | 25 | For more information, check out the website: 26 | 27 | [https://lumberjack.rareloop.com](https://lumberjack.rareloop.com) 28 | 29 | *Note: This repository is just the starter theme used for the project and doesn't require updating very often. The majority of the development work, and where progress can be seen if you're interested, is in the [framework repository](https://github.com/Rareloop/lumberjack-core)* 30 | 31 | ## Getting Started 32 | 33 | See the documentation for details on how to get started: [https://docs.lumberjack.rareloop.com/getting-started/installation](https://docs.lumberjack.rareloop.com/getting-started/installation) 34 | 35 | ## Built on strong foundations 36 | 37 | Standing on the shoulders of giants, Lumberjack proudly builds on the great work of other open source WordPress projects. 38 | 39 | - [Bedrock](https://roots.io/bedrock/docs/installing-bedrock/) 40 | - [Timber](https://timber.github.io/docs/) 41 | 42 | ## Beautiful code. Easy to maintain 43 | 44 | Object orientated and MVC patterns help keep your code structured and DRY. 45 | 46 | **index.php** 47 | 48 | ```php 49 | class IndexController 50 | { 51 | public function handle() 52 | { 53 | $context = Timber::get_context(); 54 | $context['posts'] = Post::whereStatus('publish') 55 | ->limit(5) 56 | ->get(); 57 | 58 | return new TimberResponse('index.twig', $context); 59 | } 60 | } 61 | ``` 62 | 63 | **index.twig** 64 | 65 | ```html 66 | {% if posts is not empty %} 67 |

Recent Articles

68 | 77 | {% endif %} 78 | ``` 79 | 80 | ## You're in good company 81 | 82 | > Lumberjack is the deluxe version of what Modern WordPress should look like today. The team has done a great job of making it easy to build complicated custom applications while taking advantage of the best parts of WordPress. 83 | > 84 | > **_- Jared Novack - Timber creator_** 85 | 86 | ## Made by [Rareloop](https://rareloop.com) 87 | 88 | We're a Digital Product Studio based in Southampton (UK) with many years experience working on modern WordPress websites. We design and build digital products for a range of clients, take a look at what else we can do. 89 | 90 | [Find out more](https://rareloop.com) 91 | 92 | ## Licence & Giving Back 93 | Lumberjack is available under the [MIT license](https://github.com/Rareloop/lumberjack/blob/master/LICENSE.txt) and you're free to use it for personal or commercial projects. 94 | 95 | **If you've recieved value from Lumberjack we'd hugely appreciate it if you could donate to our [Ecologi forest](https://ecologi.com/rareloop?r=60618d1bcdd7a4001d7b86f2) and help us plant real life trees to combat the climate crisis. Compared to the cost of developing a framework like Lumberjack, a few trees per project is a bargain and makes a positive difference to the environment.** 96 | 97 | [![Trees Planted](https://img.shields.io/ecologi/trees/rareloop.svg?label=trees%20planted&style=for-the-badge)](https://ecologi.com/rareloop?r=60618d1bcdd7a4001d7b86f2) 98 | 99 | [Help us plant real life trees 🌱](https://ecologi.com/rareloop?r=60618d1bcdd7a4001d7b86f2) 100 | -------------------------------------------------------------------------------- /views/templates/errors/404.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ function('wp_title') }} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 215 | 225 | 226 | 227 | 228 |
229 |
230 | 404 231 |

Oops page not found

232 |

We are very sorry for the inconvenience. It looks like you are trying to access a page that either has been deleted or never existed.

233 |
234 | Go home 235 |
236 |
237 |
238 |
239 | 261 | 262 | {{ function('wp_footer') }} 263 | 264 | 265 | -------------------------------------------------------------------------------- /views/templates/errors/whoops.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ function('wp_title')|default('Whoops, something went wrong') }} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 220 | 230 | 231 | 232 | 233 |
234 |
235 | 500 236 |

Something went wrong

237 |

Please try again in a few minutes, if the error persists contact us for support.

238 |
239 | Go home 240 |
241 |
242 |
243 |
244 | 266 | 267 | {{ function('wp_footer') }} 268 | 269 | 270 | -------------------------------------------------------------------------------- /assets/img/whoops.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Design Copy 4 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /assets/img/404.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Design Copy 3 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | --------------------------------------------------------------------------------