Skip to content

Commit

Permalink
Start new theme folder structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlambe committed Aug 27, 2018
1 parent a23b02b commit 0229eeb
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 12 deletions.
18 changes: 18 additions & 0 deletions config/images.php
@@ -0,0 +1,18 @@
<?php

/**
* Edit this file in order to configure additional
* image sizes for your theme.
*
* @see https://developer.wordpress.org/reference/functions/add_image_size/
*
* @key string The size name.
* @param int $width The image width.
* @param int $height The image height.
* @param bool|array $crop Crop option. Since 3.9, define a crop position with an array.
* @param bool|string $media Add to media selection dropdown. Make it also available
* to the media custom field. If string, used as the display name ;)
*/
return [
'themosis_sample' => [200, 125, true, false],
];
11 changes: 11 additions & 0 deletions config/menus.php
@@ -0,0 +1,11 @@
<?php

/**
* Edit this file in order to add WordPress menus locations.
* The key is the menu location slug and its value is its description.
*
* @see https://developer.wordpress.org/reference/functions/register_nav_menus/
*/
return [
'header-nav' => __('Header Navigation', THEME_TD),
];
19 changes: 19 additions & 0 deletions config/sidebars.php
@@ -0,0 +1,19 @@
<?php

/**
* Edit this file in order to add WordPress sidebars to your theme.
*
* @see https://developer.wordpress.org/reference/functions/register_sidebar/
*/
return [
[
'name' => __('First sidebar', THEME_TEXTDOMAIN),
'id' => 'first-sidebar',
'description' => __('Area of first sidebar', THEME_TEXTDOMAIN),
'class' => 'custom',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>',
]
];
72 changes: 72 additions & 0 deletions config/support.php
@@ -0,0 +1,72 @@
<?php

/**
* Edit this file in order to add theme support features.
*
* @see https://developer.wordpress.org/reference/functions/add_theme_support/
*/
return [
/* --------------------------------------------------------------- */
// Enable post thumbnails
/* --------------------------------------------------------------- */
'post-thumbnails' => ['post'],

/* --------------------------------------------------------------- */
// Enable post formats (aside, gallery, link, image, ...)
/* --------------------------------------------------------------- */
'post-formats' => [],

/* --------------------------------------------------------------- */
// Enable title tag
/* --------------------------------------------------------------- */
'title-tag',

/* --------------------------------------------------------------- */
// Enable HTML5 features
/* --------------------------------------------------------------- */
'html5' => ['comment-list', 'comment-form', 'search-form', 'gallery', 'caption'],

/* --------------------------------------------------------------- */
// Enable feed links in head
/* --------------------------------------------------------------- */
//'automatic-feed-links',

/* --------------------------------------------------------------- */
// Enable Customize Selective Refresh Widgets
/* --------------------------------------------------------------- */
//'customize-selective-refresh-widgets',

/* --------------------------------------------------------------- */
// Enable Starter Content
/* --------------------------------------------------------------- */
//'starter-content' => [],

/* --------------------------------------------------------------- */
// Enable custom background (since WP 3.4)
/* --------------------------------------------------------------- */
//'custom-background' => [
// 'default-color' => '',
// 'default-image' => '',
// 'wp-head-callback' => '_custom_background_cb',
// 'admin-head-callback' => '',
// 'admin-preview-callback' => ''
//],

/* --------------------------------------------------------------- */
// Enable custom header (not compatible for versions < WP 3.4)
/* --------------------------------------------------------------- */
//'custom-header' => [
// 'default-image' => '',
// 'random-default' => false,
// 'width' => 0,
// 'height' => 0,
// 'flex-height' => false,
// 'flex-width' => false,
// 'default-text-color' => '',
// 'header-text' => true,
// 'uploads' => true,
// 'wp-head-callback' => '',
// 'admin-head-callback' => '',
// 'admin-preview-callback' => '',
//]
];
13 changes: 13 additions & 0 deletions config/templates.php
@@ -0,0 +1,13 @@
<?php

/**
* Edit this file in order to configure your theme templates.
*
* You can define just a template slug by only defining a key.
* For a better user experience, you can define a display title as a
* value and as a second argument, you can specify a list of post types
* where your template is available.
*/
return [
'custom-template' => ['Custom template', ['page']],
];
13 changes: 13 additions & 0 deletions config/theme.php
Expand Up @@ -27,5 +27,18 @@
*/
'providers' => [
Theme\Providers\RouteServiceProvider::class
],

/*
|--------------------------------------------------------------------------
| Theme views directories path.
|--------------------------------------------------------------------------
|
| You can define a list of directories paths for the views of your theme.
| Paths are relatives to the theme base directory.
|
*/
'views' => [
'views'
]
];
2 changes: 1 addition & 1 deletion resources/Providers/RouteServiceProvider.php
Expand Up @@ -25,7 +25,7 @@ public function boot()
public function map()
{
$themeName = ltrim(
str_replace($this->app->themesPath(), '', realpath(__DIR__.'/../../')),
str_replace(themes_path(), '', realpath(__DIR__.'/../../')),
'\/'
);

Expand Down
12 changes: 3 additions & 9 deletions routes.php
Expand Up @@ -2,13 +2,7 @@

/**
* Theme routes.
*
* The routes defined inside your theme override any similar routes
* defined on the application global scope.
*/
/*Route::get('home', [
'uses' => function ($post, $query) {
return 'WordPress home (blog archive). If not, fallback to a home page route anyway.';
}
]);*/

Route::get('page', function () {
return 'WordPress Page';
});
5 changes: 3 additions & 2 deletions style.css
@@ -1,11 +1,12 @@
/*
Theme Name: Themosis
Theme URI: https://framework.themosis.com/
Author: Julien Lambé
Author: Themosis Team
Author URI: https://www.themosis.com/
Description: The Themosis framework base theme.
Version: 1.4.0
License: GNU General Public License v2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: easy, organized, expressive.
Text Domain: themosis
*/

0 comments on commit 0229eeb

Please sign in to comment.