suomato / base-camp
Awesome WordPress starter theme with own CLI for developers based on modern web technologies.
Installs: 489
Dependents: 0
Suggesters: 0
Security: 0
Stars: 144
Watchers: 12
Forks: 23
Open Issues: 21
Type:wordpress-theme
Requires
- php: ^7.0
- league/flysystem: ^1.0
- suomato/luna: ^1.3
- symfony/console: ^4.1
- symfony/finder: ^4.1
- symfony/var-dumper: ^4.1
- timber/timber: ^1.7
- vlucas/phpdotenv: ^2.4
- dev-master
- v1.9.0
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.0
- v1.6.1
- v1.6.0
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.1
- v1.0.0
- 1.0.0-beta.1
- dev-dependabot/npm_and_yarn/global-modules-path-and-webpack-cli--removed
- dev-dependabot/npm_and_yarn/json5-and-loader-utils-1.0.2
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/engine.io-and-browser-sync-6.2.1
- dev-dependabot/npm_and_yarn/loader-utils-1.4.2
- dev-dependabot/npm_and_yarn/socket.io-parser-and-browser-sync-4.2.1
- dev-dependabot/npm_and_yarn/css-what-2.1.3
- dev-dependabot/npm_and_yarn/follow-redirects-1.14.8
- dev-dependabot/npm_and_yarn/node-sass-7.0.0
- dev-dependabot/npm_and_yarn/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/tar-2.2.2
- dev-dependabot/npm_and_yarn/hosted-git-info-2.8.9
- dev-dependabot/npm_and_yarn/y18n-3.2.2
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/ini-1.3.7
- dev-dependabot/npm_and_yarn/lodash.merge-4.6.2
- dev-dependabot/npm_and_yarn/lodash.mergewith-4.6.2
- dev-dependabot/npm_and_yarn/jquery-3.5.0
- dev-dependabot/npm_and_yarn/mixin-deep-1.3.2
- dev-develop
This package is auto-updated.
Last update: 2024-11-14 02:10:20 UTC
README
About Base Camp
Awesome WordPress starter theme with own CLI for developers based on modern web technologies.
Features
- Bulma (Responsive CSS framework based on Flexbox)
- Timber
- Twig Template Engine
- Cleaner and better code
- Separates the logic from presentation
- Webpack
- Sass / Scss for stylesheets (Minimize in production)
- ES6 for Javascript (Minimize in production)
- Automatic Cache Busting
- Split javascript code to two chunks, app.js and vendor.js
- Vuejs for boosting frontend development
- BrowserSync for synchronised browser testing
- Luna (Command-line interface included with Base Camp)
- WooCommerce support with basic boilerplate.
Requirements
- Wordpress >= v4.9.6
- Composer >= v1.6.5
- PHP >= v7.0
- Yarn >= v1.7.0 or npm >= v6.1.0
- Nodejs >= v8.11.1
Installation
- Go your themes folder and run
composer create-project suomato/base-camp
cd base-camp
yarn
ornpm install
- define your custom webpack config to
build/config.js
file yarn watch
ornpm run watch
- Happy developing :)
Structure
base-camp/ # Theme root
├── app/ # Theme logic
│ ├── config/ # Theme config
│ │ ├── wp/ # WordPress specific config
│ │ │ ├── admin-page.php # Register here WordPress Admin Page config
│ │ │ ├── image-sizes.php # Register here WordPress Custom image sizes
│ │ │ ├── login-page.php # Register here WordPress Login Page config
│ │ │ ├── maintenance.php # Maintenance mode config
│ │ │ ├── menus.php # Register here WordPress navigation menus
│ │ │ ├── scripts-and-styles.php # Register here WordPress scripts and styles
│ │ │ ├── security.php # Things that increase the site security
│ │ │ ├── sidebars.php # Register here WordPress sidebars
│ │ │ └── theme-supports.php # Register here WordPress theme features
│ │ ├── autoload.php # Includes all config files (DON'T REMOVE THIS)
│ │ ├── timber.php # Timber specific config
│ │ └── woocommerce.php # Init woocommerce support
│ ├── models/ # Wrappers for Timber Classes
│ ├── timber-extends/ # Extended Timber Classes
│ │ └── BaseCampSite.php # Extended TimberSite Class
│ ├── bootstrap.php # Bootstrap theme
│ ├── helpers.php # Common helper functions
├── build/ # Theme assets and views
│ ├── config.js # Custom webpack config
│ ├── webpack.config.js # Webpack config
├── resources/ # Theme assets and views
│ ├── assets/ # Front-end assets
│ │ ├── js/ # Javascripts
│ │ │ └── components/ # Vue Components
│ │ ├── sass/ # Styles
│ │ │ └── components/ # Partials
│ ├── languages/ # Language features
│ │ ├── base-camp.pot # Template for translation
│ │ └── messages.php # Language strings
│ ├── views/ # Theme Twig files
│ │ ├── components/ # Partials
│ │ ├── footer/ # Theme footer templates
│ │ └── header/ # Theme header templates
Models
Models are wrapper classes for Wordpress Post Types and Taxonomies. They provide very simple interface to interact with the database.
How to use
// index.php
<?php
use Basecamp\Models\Post;
// returns an array of TimberPost objects
Post::all();
// returns TimberPost object with the ID 1 (if it exists)
Post::find(1);
// returns first two posts;
Post::take(2)->get();
// skips first two posts;
Post::skip(2)->get();
// returns published posts;
// Supported values: https://codex.wordpress.org/Post_Status#Default_Statuses
Post::status('publish')->get();
// returns all posts except post with ID 1;
Post::exclude([1])->get();
// returns only posts with ID 1;
Post::include([1])->get();
// returns an array of posts descending order by author;
// Supported Values: https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
Post::orderby('author', 'desc')->get();
// returns an array of posts authored by admin;
Post::author('admin')->get();
// returns an array of posts which are in category 'cars' or 'vehicles';
Post::inCategory(['cars', 'vehicles'])->get();
All queries are chainable. For example you can get three first incomplete posts authored by admin:
Post::status('draft')->author('admin')->take(3)->get();
All models are able to use almost every methods. However there are some exceptions:
- Only
Post
model hasinCategory()
method - Taxonomies (Category, Tag) have
hideEmpty()
method