mediatheque
@@ -0,0 +1,21 @@
|
||||
title: {{ component.bpname }}
|
||||
extends@:
|
||||
type: default
|
||||
context: blueprints://pages
|
||||
|
||||
form:
|
||||
fields:
|
||||
tabs:
|
||||
type: tabs
|
||||
active: 1
|
||||
|
||||
fields:
|
||||
content:
|
||||
fields:
|
||||
header.an_example_text_field:
|
||||
type: text
|
||||
label: Add a number
|
||||
default: 5
|
||||
validate:
|
||||
required: true
|
||||
type: int
|
||||
@@ -0,0 +1,15 @@
|
||||
title: Item
|
||||
extends@:
|
||||
type: default
|
||||
context: blueprints://pages
|
||||
|
||||
form:
|
||||
fields:
|
||||
tabs:
|
||||
fields:
|
||||
blog:
|
||||
type: tab
|
||||
title: {{ component.bpname }}
|
||||
|
||||
fields:
|
||||
header.mytextfield:
|
||||
@@ -0,0 +1,5 @@
|
||||
# v0.1.0
|
||||
## {{ "now"|date("m/d/Y") }}
|
||||
|
||||
1. [](#new)
|
||||
* ChangeLog started...
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) {{ "now"|date("Y") }} {{ component.author.name }}
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,59 @@
|
||||
{% set component_title = (component.name|titleize) %}
|
||||
{% set component_hyphenated = (component.name|hyphenize) %}
|
||||
{% set developer_hyphenated = (component.author.githubid|hyphenize) %}
|
||||
# {{ component_title }} Plugin
|
||||
|
||||
**This README.md file should be modified to describe the features, installation, configuration, and general usage of the plugin.**
|
||||
|
||||
The **{{ component_title }}** Plugin is an extension for [Grav CMS](https://github.com/getgrav/grav). {{ component.description }}
|
||||
|
||||
## Installation
|
||||
|
||||
Installing the {{ component_title }} plugin can be done in one of three ways: The GPM (Grav Package Manager) installation method lets you quickly install the plugin with a simple terminal command, the manual method lets you do so via a zip file, and the admin method lets you do so via the Admin Plugin.
|
||||
|
||||
### GPM Installation (Preferred)
|
||||
|
||||
To install the plugin via the [GPM](https://learn.getgrav.org/cli-console/grav-cli-gpm), through your system's terminal (also called the command line), navigate to the root of your Grav-installation, and enter:
|
||||
|
||||
bin/gpm install {{ component_hyphenated }}
|
||||
|
||||
This will install the {{ component_title }} plugin into your `/user/plugins`-directory within Grav. Its files can be found under `/your/site/grav/user/plugins/{{ component_hyphenated }}`.
|
||||
|
||||
### Manual Installation
|
||||
|
||||
To install the plugin manually, download the zip-version of this repository and unzip it under `/your/site/grav/user/plugins`. Then rename the folder to `{{ component_hyphenated }}`. You can find these files on [GitHub](https://github.com/{{ developer_hyphenated }}/grav-plugin-{{ component_hyphenated }}) or via [GetGrav.org](https://getgrav.org/downloads/plugins).
|
||||
|
||||
You should now have all the plugin files under
|
||||
|
||||
/your/site/grav/user/plugins/{{ component_hyphenated }}
|
||||
|
||||
> NOTE: This plugin is a modular component for Grav which may require other plugins to operate, please see its [blueprints.yaml-file on GitHub](https://github.com/{{ developer_hyphenated }}/grav-plugin-{{ component_hyphenated }}/blob/main/blueprints.yaml).
|
||||
|
||||
### Admin Plugin
|
||||
|
||||
If you use the Admin Plugin, you can install the plugin directly by browsing the `Plugins`-menu and clicking on the `Add` button.
|
||||
|
||||
## Configuration
|
||||
|
||||
Before configuring this plugin, you should copy the `user/plugins/{{ component_hyphenated }}/{{ component_hyphenated }}.yaml` to `user/config/plugins/{{ component_hyphenated }}.yaml` and only edit that copy.
|
||||
|
||||
Here is the default configuration and an explanation of available options:
|
||||
|
||||
```yaml
|
||||
enabled: true
|
||||
```
|
||||
|
||||
Note that if you use the Admin Plugin, a file with your configuration named {{component_hyphenated}}.yaml will be saved in the `user/config/plugins/`-folder once the configuration is saved in the Admin.
|
||||
|
||||
## Usage
|
||||
|
||||
**Describe how to use the plugin.**
|
||||
|
||||
## Credits
|
||||
|
||||
**Did you incorporate third-party code? Want to thank somebody?**
|
||||
|
||||
## To Do
|
||||
|
||||
- [ ] Future plans, if any
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
{% set githubid = component.author.githubid ?: component.author.name|hyphenize -%}
|
||||
name: {{ component.name|titleize }}
|
||||
slug: {{ component.name|hyphenize }}
|
||||
type: plugin
|
||||
version: 0.1.0
|
||||
description: {{ component.description }}
|
||||
icon: plug
|
||||
author:
|
||||
name: {{ component.author.name }}
|
||||
email: {{ component.author.email }}
|
||||
homepage: https://github.com/{{ githubid }}/grav-plugin-{{ component.name|hyphenize }}
|
||||
demo: http://demo.yoursite.com
|
||||
keywords: grav, plugin, etc
|
||||
bugs: https://github.com/{{ githubid }}/grav-plugin-{{ component.name|hyphenize }}/issues
|
||||
docs: https://github.com/{{ githubid }}/grav-plugin-{{ component.name|hyphenize }}/blob/develop/README.md
|
||||
license: MIT
|
||||
|
||||
dependencies:
|
||||
- { name: grav, version: '>=1.6.0' }
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
enabled:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.PLUGIN_STATUS
|
||||
highlight: 1
|
||||
default: 0
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
text_var:
|
||||
type: text
|
||||
label: PLUGIN_{{ component.name|underscorize|upper }}.TEXT_VARIABLE
|
||||
help: PLUGIN_{{ component.name|underscorize|upper }}.TEXT_VARIABLE_HELP
|
||||
@@ -0,0 +1,25 @@
|
||||
{% set githubid = component.author.githubid ?: component.author.name|hyphenize -%}
|
||||
{
|
||||
"name": "{{ githubid|lower }}/{{ component.name|hyphenize }}",
|
||||
"type": "grav-plugin",
|
||||
"description": "{{ component.description }}",
|
||||
"keywords": ["plugin"],
|
||||
"homepage": "https://github.com/{{ githubid }}/grav-plugin-{{ component.name|hyphenize }}",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "{{ component.author.name }}",
|
||||
"email": "{{ component.author.email }}",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.1.3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Grav\\Plugin\\{{ component.name|camelize }}\\": "classes/"
|
||||
},
|
||||
"classmap": ["{{ component.name|hyphenize }}.php"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
en:
|
||||
PLUGIN_{{ component.name|underscorize|upper }}:
|
||||
TEXT_VARIABLE: Text Variable
|
||||
TEXT_VARIABLE_HELP: Text to add to the top of a page
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
namespace Grav\Plugin;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Grav\Common\Plugin;
|
||||
|
||||
/**
|
||||
* Class {{ component.name|camelize }}Plugin
|
||||
* @package Grav\Plugin
|
||||
*/
|
||||
class {{ component.name|camelize }}Plugin extends Plugin
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*
|
||||
* The getSubscribedEvents() gives the core a list of events
|
||||
* that the plugin wants to listen to. The key of each
|
||||
* array section is the event that the plugin listens to
|
||||
* and the value (in the form of an array) contains the
|
||||
* callable (or function) as well as the priority. The
|
||||
* higher the number the higher the priority.
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
'onPluginsInitialized' => [
|
||||
// Uncomment following line when plugin requires Grav < 1.7
|
||||
// ['autoload', 100000],
|
||||
['onPluginsInitialized', 0]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Composer autoload
|
||||
*
|
||||
* @return ClassLoader
|
||||
*/
|
||||
public function autoload(): ClassLoader
|
||||
{
|
||||
return require __DIR__ . '/vendor/autoload.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the plugin
|
||||
*/
|
||||
public function onPluginsInitialized(): void
|
||||
{
|
||||
// Don't proceed if we are in the admin plugin
|
||||
if ($this->isAdmin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Enable the main events we are interested in
|
||||
$this->enable([
|
||||
// Put your main events here
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
enabled: true
|
||||
text_var: Custom Text added by the **{{ component.name|titleize }}** plugin (disable plugin to remove)
|
||||
@@ -0,0 +1,5 @@
|
||||
# v0.1.0
|
||||
## {{ "now"|date("m/d/Y") }}
|
||||
|
||||
1. [](#new)
|
||||
* ChangeLog started...
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) {{ "now"|date("Y") }} {{ component.author.name }}
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,59 @@
|
||||
{% set component_title = (component.name|titleize) %}
|
||||
{% set component_hyphenated = (component.name|hyphenize) %}
|
||||
{% set developer_hyphenated = (component.author.githubid|hyphenize) %}
|
||||
# {{ component_title }} Plugin
|
||||
|
||||
**This README.md file should be modified to describe the features, installation, configuration, and general usage of the plugin.**
|
||||
|
||||
The **{{ component_title }}** Plugin is an extension for [Grav CMS](https://github.com/getgrav/grav). {{ component.description }}
|
||||
|
||||
## Installation
|
||||
|
||||
Installing the {{ component_title }} plugin can be done in one of three ways: The GPM (Grav Package Manager) installation method lets you quickly install the plugin with a simple terminal command, the manual method lets you do so via a zip file, and the admin method lets you do so via the Admin Plugin.
|
||||
|
||||
### GPM Installation (Preferred)
|
||||
|
||||
To install the plugin via the [GPM](https://learn.getgrav.org/cli-console/grav-cli-gpm), through your system's terminal (also called the command line), navigate to the root of your Grav-installation, and enter:
|
||||
|
||||
bin/gpm install {{ component_hyphenated }}
|
||||
|
||||
This will install the {{ component_title }} plugin into your `/user/plugins`-directory within Grav. Its files can be found under `/your/site/grav/user/plugins/{{ component_hyphenated }}`.
|
||||
|
||||
### Manual Installation
|
||||
|
||||
To install the plugin manually, download the zip-version of this repository and unzip it under `/your/site/grav/user/plugins`. Then rename the folder to `{{ component_hyphenated }}`. You can find these files on [GitHub](https://github.com/{{ developer_hyphenated }}/grav-plugin-{{ component_hyphenated }}) or via [GetGrav.org](https://getgrav.org/downloads/plugins).
|
||||
|
||||
You should now have all the plugin files under
|
||||
|
||||
/your/site/grav/user/plugins/{{ component_hyphenated }}
|
||||
|
||||
> NOTE: This plugin is a modular component for Grav which may require other plugins to operate, please see its [blueprints.yaml-file on GitHub](https://github.com/{{ developer_hyphenated }}/grav-plugin-{{ component_hyphenated }}/blob/main/blueprints.yaml).
|
||||
|
||||
### Admin Plugin
|
||||
|
||||
If you use the Admin Plugin, you can install the plugin directly by browsing the `Plugins`-menu and clicking on the `Add` button.
|
||||
|
||||
## Configuration
|
||||
|
||||
Before configuring this plugin, you should copy the `user/plugins/{{ component_hyphenated }}/{{ component_hyphenated }}.yaml` to `user/config/plugins/{{ component_hyphenated }}.yaml` and only edit that copy.
|
||||
|
||||
Here is the default configuration and an explanation of available options:
|
||||
|
||||
```yaml
|
||||
enabled: true
|
||||
```
|
||||
|
||||
Note that if you use the Admin Plugin, a file with your configuration named {{component_hyphenated}}.yaml will be saved in the `user/config/plugins/`-folder once the configuration is saved in the Admin.
|
||||
|
||||
## Usage
|
||||
|
||||
**Describe how to use the plugin.**
|
||||
|
||||
## Credits
|
||||
|
||||
**Did you incorporate third-party code? Want to thank somebody?**
|
||||
|
||||
## To Do
|
||||
|
||||
- [ ] Future plans, if any
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
{% set githubid = component.author.githubid ?: component.author.name|hyphenize -%}
|
||||
name: {{ component.name|titleize }}
|
||||
slug: {{ component.name|hyphenize }}
|
||||
type: plugin
|
||||
version: 0.1.0
|
||||
description: {{ component.description }}
|
||||
icon: plug
|
||||
author:
|
||||
name: {{ component.author.name }}
|
||||
email: {{ component.author.email }}
|
||||
homepage: https://github.com/{{ githubid }}/grav-plugin-{{ component.name|hyphenize }}
|
||||
demo: http://demo.yoursite.com
|
||||
keywords: grav, plugin, etc
|
||||
bugs: https://github.com/{{ githubid }}/grav-plugin-{{ component.name|hyphenize }}/issues
|
||||
docs: https://github.com/{{ githubid }}/grav-plugin-{{ component.name|hyphenize }}/blob/develop/README.md
|
||||
license: MIT
|
||||
|
||||
dependencies:
|
||||
- { name: grav, version: '>=1.6.0' }
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
enabled:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.PLUGIN_STATUS
|
||||
highlight: 1
|
||||
default: 0
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
text_var:
|
||||
type: text
|
||||
label: PLUGIN_{{ component.name|underscorize|upper }}.TEXT_VARIABLE
|
||||
help: PLUGIN_{{ component.name|underscorize|upper }}.TEXT_VARIABLE_HELP
|
||||
@@ -0,0 +1,132 @@
|
||||
title: '{{ component.flex_name|capitalize }}'
|
||||
description: '{{ component.flex_name|capitalize }}'
|
||||
type: flex-objects
|
||||
|
||||
# Flex Configuration
|
||||
config:
|
||||
# Administration Configuration
|
||||
admin:
|
||||
# Admin router (optional)
|
||||
router:
|
||||
path: '/{{ component.flex_name|lower|underscorize }}'
|
||||
|
||||
# Admin menu (optional)
|
||||
menu:
|
||||
list:
|
||||
route: '/{{ component.flex_name|lower|underscorize }}'
|
||||
title: '{{ component.flex_name|capitalize }}'
|
||||
icon: fa-address-card-o
|
||||
# Authorization to collection admin
|
||||
authorize: ['admin.{{ component.flex_name|lower|underscorize }}.list', 'admin.super']
|
||||
# Priority -10 .. 10 (highest goes up)
|
||||
priority: 2
|
||||
|
||||
# Admin template type / folder
|
||||
template: default
|
||||
|
||||
# Permissions
|
||||
permissions:
|
||||
# Primary permissions
|
||||
admin.{{ component.flex_name|lower|underscorize }}:
|
||||
type: crudpl
|
||||
label: '{{ component.flex_name|capitalize }}'
|
||||
|
||||
# List view
|
||||
list:
|
||||
title: name
|
||||
fields:
|
||||
published:
|
||||
field:
|
||||
type: toggle
|
||||
label: Published
|
||||
width: 8
|
||||
name:
|
||||
link: edit
|
||||
description:
|
||||
|
||||
# Edit View
|
||||
edit:
|
||||
title:
|
||||
template: '{{ object.name }}'
|
||||
|
||||
# Preview View
|
||||
preview:
|
||||
enabled: false
|
||||
route:
|
||||
#template: '/plugins/flex-objects/directory:contacts'
|
||||
|
||||
# Data Export
|
||||
export:
|
||||
enabled: true
|
||||
method: 'jsonSerialize'
|
||||
formatter:
|
||||
class: 'Grav\Framework\File\Formatter\YamlFormatter'
|
||||
filename: '{{ component.flex_name|lower|underscorize }}'
|
||||
|
||||
# Site Configuration
|
||||
site:
|
||||
templates:
|
||||
collection:
|
||||
# Lookup for the template layout files for collections of objects
|
||||
paths:
|
||||
- 'flex/{TYPE}/collection/{LAYOUT}{EXT}'
|
||||
object:
|
||||
# Lookup for the template layout files for objects
|
||||
paths:
|
||||
- 'flex/{TYPE}/object/{LAYOUT}{EXT}'
|
||||
defaults:
|
||||
# Default template {TYPE}; overridden by filename of this blueprint if template folder exists
|
||||
type: '{{ component.flex_name|lower|underscorize }}'
|
||||
# Default template {LAYOUT}; can be overridden in render calls (usually Twig in templates)
|
||||
layout: default
|
||||
|
||||
# Data Configuration
|
||||
data:
|
||||
# Object class to be used, allowing custom methods for the object
|
||||
object: 'Grav\Plugin\{{ component.name|camelize }}\Flex\Types\{{ component.flex_name|camelize }}\{{ component.flex_name|camelize }}Object'
|
||||
# Collection class to be used, allowing custom methods for the collections
|
||||
collection: 'Grav\Plugin\{{ component.name|camelize }}\Flex\Types\{{ component.flex_name|camelize }}\{{ component.flex_name|camelize }}Collection'
|
||||
# Index class to be used, works as a quick database-like lookup index
|
||||
index: 'Grav\Common\Flex\Types\Generic\GenericIndex'
|
||||
storage:
|
||||
# Storage class, use single file storage (does not support images and assets)
|
||||
class: 'Grav\Framework\Flex\Storage\{{ component.flex_storage|capitalize }}Storage'
|
||||
options:
|
||||
formatter:
|
||||
# File formatter class, in this case the file is stored in markdown
|
||||
class: 'Grav\Framework\File\Formatter\JsonFormatter'
|
||||
# JSON file where all the objects will be stored
|
||||
folder: user-data://{{ component.flex_name|underscorize }}
|
||||
search:
|
||||
# Search options
|
||||
options:
|
||||
contains: 1
|
||||
# Fields to be searched
|
||||
fields:
|
||||
- name
|
||||
- description
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
published:
|
||||
type: toggle
|
||||
label: Published
|
||||
highlight: 1
|
||||
default: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.YES
|
||||
0: PLUGIN_ADMIN.NO
|
||||
validate:
|
||||
type: bool
|
||||
required: true
|
||||
name:
|
||||
type: text
|
||||
label: Name
|
||||
validate:
|
||||
required: true
|
||||
description:
|
||||
type: text
|
||||
label: Description
|
||||
validate:
|
||||
required: true
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @package Grav\Common\Flex
|
||||
*
|
||||
* @copyright Copyright (c) 2015 - 2021 Trilby Media, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Plugin\{{ component.name|camelize }}\Flex\Types\{{ component.flex_name|camelize }};
|
||||
|
||||
use Grav\Common\Flex\Types\Generic\GenericCollection;
|
||||
|
||||
/**
|
||||
* Class {{ component.flex_name|camelize }}Collection
|
||||
* @package Grav\Common\Flex\Generic
|
||||
*
|
||||
* @extends FlexCollection<string,GenericObject>
|
||||
*/
|
||||
class {{ component.flex_name|camelize }}Collection extends GenericCollection
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @package Grav\Common\Flex
|
||||
*
|
||||
* @copyright Copyright (c) 2015 - 2021 Trilby Media, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Plugin\{{ component.name|camelize }}\Flex\Types\{{ component.flex_name|camelize }};
|
||||
|
||||
use Grav\Common\Flex\Types\Generic\GenericObject;
|
||||
|
||||
/**
|
||||
* Class {{ component.flex_name|camelize }}Object
|
||||
* @package Grav\Common\Flex\Generic
|
||||
*
|
||||
* @extends FlexObject<string,GenericObject>
|
||||
*/
|
||||
class {{ component.flex_name|camelize }}Object extends GenericObject
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{% set githubid = component.author.githubid ?: component.author.name|hyphenize -%}
|
||||
{
|
||||
"name": "{{ githubid|lower }}/{{ component.name|hyphenize }}",
|
||||
"type": "grav-plugin",
|
||||
"description": "{{ component.description }}",
|
||||
"keywords": ["plugin"],
|
||||
"homepage": "https://github.com/{{ githubid }}/grav-plugin-{{ component.name|hyphenize }}",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "{{ component.author.name }}",
|
||||
"email": "{{ component.author.email }}",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.1.3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Grav\\Plugin\\{{ component.name|camelize }}\\": "classes/"
|
||||
},
|
||||
"classmap": ["{{ component.name|hyphenize }}.php"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
en:
|
||||
PLUGIN_{{ component.name|underscorize|upper }}:
|
||||
TEXT_VARIABLE: Text Variable
|
||||
TEXT_VARIABLE_HELP: Text to add to the top of a page
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
namespace Grav\Plugin;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Grav\Common\Plugin;
|
||||
use Grav\Events\FlexRegisterEvent;
|
||||
|
||||
/**
|
||||
* Class {{ component.name|camelize }}Plugin
|
||||
* @package Grav\Plugin
|
||||
*/
|
||||
class {{ component.name|camelize }}Plugin extends Plugin
|
||||
{
|
||||
public $features = [
|
||||
'blueprints' => 0,
|
||||
];
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*
|
||||
* The getSubscribedEvents() gives the core a list of events
|
||||
* that the plugin wants to listen to. The key of each
|
||||
* array section is the event that the plugin listens to
|
||||
* and the value (in the form of an array) contains the
|
||||
* callable (or function) as well as the priority. The
|
||||
* higher the number the higher the priority.
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
'onPluginsInitialized' => [
|
||||
// Uncomment following line when plugin requires Grav < 1.7
|
||||
// ['autoload', 100000],
|
||||
['onPluginsInitialized', 0]
|
||||
],
|
||||
FlexRegisterEvent::class => [['onRegisterFlex', 0]],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Composer autoload
|
||||
*
|
||||
* @return ClassLoader
|
||||
*/
|
||||
public function autoload(): ClassLoader
|
||||
{
|
||||
return require __DIR__ . '/vendor/autoload.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the plugin
|
||||
*/
|
||||
public function onPluginsInitialized(): void
|
||||
{
|
||||
// Don't proceed if we are in the admin plugin
|
||||
if ($this->isAdmin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Enable the main events we are interested in
|
||||
$this->enable([
|
||||
// Put your main events here
|
||||
]);
|
||||
}
|
||||
|
||||
public function onRegisterFlex($event): void
|
||||
{
|
||||
$flex = $event->flex;
|
||||
|
||||
$flex->addDirectoryType(
|
||||
'{{ component.flex_name|lower|underscorize }}',
|
||||
'blueprints://flex-objects/{{ component.flex_name|lower|underscorize }}.yaml'
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
enabled: true
|
||||
text_var: Custom Text added by the **{{ component.name|titleize }}** plugin (disable plugin to remove)
|
||||
@@ -0,0 +1,5 @@
|
||||
# v0.1.0
|
||||
## {{ "now"|date("m/d/Y") }}
|
||||
|
||||
1. [](#new)
|
||||
* ChangeLog started...
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) {{ "now"|date("Y") }} {{ component.author.name }}
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,7 @@
|
||||
# {{ component.name|titleize }} Theme
|
||||
|
||||
The **{{ component.name|titleize }}** Theme is for [Grav CMS](http://github.com/getgrav/grav). This README.md file should be modified to describe the features, installation, configuration, and general usage of this theme.
|
||||
|
||||
## Description
|
||||
|
||||
{{ component.description }}
|
||||
@@ -0,0 +1,19 @@
|
||||
{% set githubid = component.author.githubid ?: component.author.name|hyphenize -%}
|
||||
name: {{ component.name|titleize }}
|
||||
slug: {{ component.name|hyphenize }}
|
||||
type: theme
|
||||
version: 0.1.0
|
||||
description: {{ component.description }}
|
||||
icon: rebel
|
||||
author:
|
||||
name: {{ component.author.name }}
|
||||
email: {{ component.author.email }}
|
||||
homepage: https://github.com/{{ githubid }}/grav-theme-{{ component.name|hyphenize }}
|
||||
demo: http://demo.yoursite.com
|
||||
keywords: grav, theme, etc
|
||||
bugs: https://github.com/{{ githubid }}/grav-theme-{{ component.name|hyphenize }}/issues
|
||||
readme: https://github.com/{{ githubid }}/grav-theme-{{ component.name|hyphenize }}/blob/develop/README.md
|
||||
license: MIT
|
||||
|
||||
dependencies:
|
||||
- { name: grav, version: '>=1.6.0' }
|
||||
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Grav\Theme;
|
||||
|
||||
use Grav\Common\Theme;
|
||||
|
||||
class {{ component.name|camelize }} extends {{ component.extends|camelize }}
|
||||
{
|
||||
// Access plugin events in this class
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
streams:
|
||||
schemes:
|
||||
theme:
|
||||
type: ReadOnlyStream
|
||||
prefixes:
|
||||
'':
|
||||
- 'user://themes/{{ component.name|hyphenize }}'
|
||||
- 'user://themes/{{ component.extends }}'
|
||||
|
||||
{{ component.config }}
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
@@ -0,0 +1,5 @@
|
||||
# v0.1.0
|
||||
## {{ "now"|date("m/d/Y") }}
|
||||
|
||||
1. [](#new)
|
||||
* ChangeLog started...
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) {{ "now"|date("Y") }} {{ component.author.name }}
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,7 @@
|
||||
# {{ component.name|titleize }} Theme
|
||||
|
||||
The **{{ component.name|titleize }}** Theme is for [Grav CMS](http://github.com/getgrav/grav). This README.md file should be modified to describe the features, installation, configuration, and general usage of this theme.
|
||||
|
||||
## Description
|
||||
|
||||
{{ component.description }}
|
||||
@@ -0,0 +1,33 @@
|
||||
{% set githubid = component.author.githubid ?: component.author.name|hyphenize -%}
|
||||
name: {{ component.name|titleize }}
|
||||
slug: {{ component.name|hyphenize }}
|
||||
type: theme
|
||||
version: 0.1.0
|
||||
description: {{ component.description }}
|
||||
icon: rebel
|
||||
author:
|
||||
name: {{ component.author.name }}
|
||||
email: {{ component.author.email }}
|
||||
homepage: https://github.com/{{ githubid }}/grav-theme-{{ component.name|hyphenize }}
|
||||
demo: http://demo.yoursite.com
|
||||
keywords: grav, theme, etc
|
||||
bugs: https://github.com/{{ githubid }}/grav-theme-{{ component.name|hyphenize }}/issues
|
||||
readme: https://github.com/{{ githubid }}/grav-theme-{{ component.name|hyphenize }}/blob/develop/README.md
|
||||
license: MIT
|
||||
|
||||
dependencies:
|
||||
- { name: grav, version: '>=1.6.0' }
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
dropdown.enabled:
|
||||
type: toggle
|
||||
label: Dropdown in Menu
|
||||
highlight: 1
|
||||
default: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
@@ -0,0 +1,175 @@
|
||||
/* Core Stuff */
|
||||
* {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 1rem;
|
||||
line-height: 1.7;
|
||||
color: #606d6e;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
color: #454B4D;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #1F8CD6;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #175E91;
|
||||
}
|
||||
|
||||
pre {
|
||||
background: #F0F0F0;
|
||||
margin: 1rem 0;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
border-left: 10px solid #eee;
|
||||
margin: 0;
|
||||
padding: 0 2rem;
|
||||
}
|
||||
|
||||
/* Utility Classes */
|
||||
.wrapper {
|
||||
margin: 0 3rem;
|
||||
}
|
||||
|
||||
.padding {
|
||||
padding: 3rem 1rem;
|
||||
}
|
||||
|
||||
.left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.right {
|
||||
float: right
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.text-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* Content Styling */
|
||||
.header .padding {
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.header {
|
||||
background-color: #1F8DD6;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
.header a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.header .logo {
|
||||
font-size: 1.7rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.footer {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
/* Menu Settings */
|
||||
.main-nav ul {
|
||||
text-align: center;
|
||||
letter-spacing: -1em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.main-nav ul li {
|
||||
display: inline-block;
|
||||
letter-spacing: normal;
|
||||
}
|
||||
|
||||
.main-nav ul li a {
|
||||
position: relative;
|
||||
display: block;
|
||||
line-height: 45px;
|
||||
color: #fff;
|
||||
padding: 0 20px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.main-nav > ul > li > a {
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
/*Active dropdown nav item */
|
||||
.main-nav ul li:hover > a {
|
||||
background-color: #175E91;
|
||||
}
|
||||
|
||||
/* Selected Dropdown nav item */
|
||||
.main-nav ul li.selected > a {
|
||||
background-color: #fff;
|
||||
color: #175E91;
|
||||
}
|
||||
|
||||
/* Dropdown CSS */
|
||||
.main-nav ul li {position: relative;}
|
||||
|
||||
.main-nav ul li ul {
|
||||
position: absolute;
|
||||
background-color: #1F8DD6;
|
||||
min-width: 100%;
|
||||
text-align: left;
|
||||
z-index: 999;
|
||||
|
||||
display: none;
|
||||
}
|
||||
.main-nav ul li ul li {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Dropdown CSS */
|
||||
.main-nav ul li ul ul {
|
||||
left: 100%;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
/* Active on Hover */
|
||||
.main-nav li:hover > ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Child Indicator */
|
||||
.main-nav .has-children > a {
|
||||
padding-right: 30px;
|
||||
}
|
||||
.main-nav .has-children > a:after {
|
||||
font-family: FontAwesome;
|
||||
content: '\f107';
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
right: 8px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.main-nav .has-children .has-children > a:after {
|
||||
content: '\f105';
|
||||
}
|
||||
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,5 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{{ page.content|raw }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,8 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="lead text-center">
|
||||
<h1>Error!</h1>
|
||||
{{ page.content|raw }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ (grav.language.getActive ?: grav.config.site.default_lang)|e }}">
|
||||
<head>
|
||||
{% block head %}
|
||||
<meta charset="utf-8" />
|
||||
<title>{% if header.title %}{{ header.title|e }} | {% endif %}{{ site.title|e }}</title>
|
||||
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
{% include 'partials/metadata.html.twig' %}
|
||||
|
||||
<link rel="icon" type="image/png" href="{{ url('theme://images/logo.png')|e }}" />
|
||||
<link rel="canonical" href="{{ page.canonical(true)|e }}" />
|
||||
{% endblock head %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{% do assets.addCss('https://unpkg.com/purecss@1.0.0/build/pure-min.css', 100) %}
|
||||
{% do assets.addCss('https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', 99) %}
|
||||
{% do assets.addCss('theme://css/custom.css', 98) %}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{% do assets.addJs('jquery', 100) %}
|
||||
{% endblock %}
|
||||
|
||||
{% block assets deferred %}
|
||||
{{ assets.css()|raw }}
|
||||
{{ assets.js()|raw }}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body id="top" class="{{ page.header.body_classes|e }}">
|
||||
|
||||
{% block header %}
|
||||
<div class="header">
|
||||
<div class="wrapper padding">
|
||||
<a class="logo left" href="{{ home_url|e }}">
|
||||
<i class="fa fa-rebel"></i>
|
||||
{{ config.site.title|e }}
|
||||
</a>
|
||||
{% block header_navigation %}
|
||||
<nav class="main-nav">
|
||||
{% include 'partials/navigation.html.twig' %}
|
||||
</nav>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<section id="body">
|
||||
<div class="wrapper padding">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
<div class="footer text-center">
|
||||
<div class="wrapper padding">
|
||||
<p><a href="https://getgrav.org">Grav</a> was <i class="fa fa-code"></i> with <i class="fa fa-heart"></i> by <a href="https://trilby.media">Trilby Media, LLC</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block bottom %}
|
||||
{{ assets.js('bottom')|raw }}
|
||||
{% endblock %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,47 @@
|
||||
{% macro loop(page) %}
|
||||
{% for p in page.children.visible %}
|
||||
{% set current_page = (p.active or p.activeChild) ? 'selected' : '' %}
|
||||
{% if p.children.visible.count > 0 %}
|
||||
<li class="has-children {{ current_page|e }}">
|
||||
<a href="{{ p.url|e }}">
|
||||
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon|e }}"></i>{% endif %}
|
||||
{{ p.menu|e }}
|
||||
</a>
|
||||
<ul>
|
||||
{{ _self.loop(p) }}
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="{{ current_page|e }}">
|
||||
<a href="{{ p.url|e }}">
|
||||
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon|e }}"></i>{% endif %}
|
||||
{{ p.menu|e }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
|
||||
<ul>
|
||||
{% if config.theme.dropdown.enabled %}
|
||||
{{ _self.loop(pages) }}
|
||||
{% else %}
|
||||
{% for page in pages.children.visible %}
|
||||
{% set current_page = (page.active or page.activeChild) ? 'selected' : '' %}
|
||||
<li class="{{ current_page|e }}">
|
||||
<a href="{{ page.url|e }}">
|
||||
{% if page.header.icon %}<i class="fa fa-{{ page.header.icon|e }}"></i>{% endif %}
|
||||
{{ page.menu|e }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% for mitem in site.menu %}
|
||||
<li>
|
||||
<a href="{{ mitem.url|e }}">
|
||||
{% if mitem.icon %}<i class="fa fa-{{ mitem.icon|e }}"></i>{% endif %}
|
||||
{{ mitem.text|e }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Grav\Theme;
|
||||
|
||||
use Grav\Common\Theme;
|
||||
|
||||
class {{ component.name|camelize }} extends Theme
|
||||
{
|
||||
// Access plugin events in this class
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
enabled: true
|
||||
dropdown:
|
||||
enabled: true
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
@@ -0,0 +1,5 @@
|
||||
# v0.1.0
|
||||
## {{ "now"|date("m/d/Y") }}
|
||||
|
||||
1. [](#new)
|
||||
* ChangeLog started...
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) {{ "now"|date("Y") }} {{ component.author.name }}
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,41 @@
|
||||
# {{ component.name|titleize }} Theme
|
||||
|
||||
The **{{ component.name|titleize }}** Theme is for [Grav CMS](http://github.com/getgrav/grav). This README.md file should be modified to describe the features, installation, configuration, and general usage of this theme.
|
||||
|
||||
## Description
|
||||
|
||||
{{ component.description }}
|
||||
|
||||
# Instructions
|
||||
|
||||
Run
|
||||
|
||||
`npm install` to setup tailwind and required plugins
|
||||
|
||||
How to build tailwind:
|
||||
|
||||
Development:
|
||||
|
||||
`npm run build` for single time compiling
|
||||
|
||||
`npm run watch` for constant development
|
||||
|
||||
Production:
|
||||
|
||||
`npm run prod` for production compiling. **Don't forget to turn on production mode in the theme config**# Instructions
|
||||
|
||||
Run
|
||||
|
||||
`npm install` to setup tailwind and required plugins
|
||||
|
||||
How to build tailwind:
|
||||
|
||||
Development:
|
||||
|
||||
`npm run build` for single time compiling
|
||||
|
||||
`npm run watch` for constant development
|
||||
|
||||
Production:
|
||||
|
||||
`npm run prod` for production compiling. **Don't forget to turn on production mode in the theme config**
|
||||
@@ -0,0 +1,43 @@
|
||||
{% set githubid = component.author.githubid ?: component.author.name|hyphenize -%}
|
||||
name: {{ component.name|titleize }}
|
||||
slug: {{ component.name|hyphenize }}
|
||||
type: theme
|
||||
version: 0.1.0
|
||||
description: {{ component.description }}
|
||||
icon: rebel
|
||||
author:
|
||||
name: {{ component.author.name }}
|
||||
email: {{ component.author.email }}
|
||||
homepage: https://github.com/{{ githubid }}/grav-theme-{{ component.name|hyphenize }}
|
||||
demo: http://demo.yoursite.com
|
||||
keywords: grav, theme, etc
|
||||
bugs: https://github.com/{{ githubid }}/grav-theme-{{ component.name|hyphenize }}/issues
|
||||
readme: https://github.com/{{ githubid }}/grav-theme-{{ component.name|hyphenize }}/blob/develop/README.md
|
||||
license: MIT
|
||||
|
||||
dependencies:
|
||||
- { name: grav, version: '>=1.6.0' }
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
dropdown.enabled:
|
||||
type: toggle
|
||||
label: Dropdown in Menu
|
||||
highlight: 1
|
||||
default: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
production:
|
||||
type: toggle
|
||||
label: Production Mode
|
||||
highlight: 1
|
||||
default: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
@@ -0,0 +1,5 @@
|
||||
/*@import 'yourcssfile.css';*/
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
After Width: | Height: | Size: 8.5 KiB |
@@ -0,0 +1,5 @@
|
||||
import Alpine from 'alpinejs'
|
||||
|
||||
window.Alpine = Alpine
|
||||
|
||||
Alpine.start()
|
||||
@@ -0,0 +1,2 @@
|
||||
THEME_{{ component.name|hyphenize|replace({'-': '_'})|upper }}:
|
||||
ERROR: 'Error!'
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "{{ component.name }}",
|
||||
"repository": "",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "npx mix",
|
||||
"watch": "npx mix watch",
|
||||
"prod": "npx mix -p"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/forms": "^0.5.0",
|
||||
"@tailwindcss/typography": "^0.5.2",
|
||||
"alpinejs": "^2.8.2",
|
||||
"browser-sync": "^2.27.7",
|
||||
"browser-sync-webpack-plugin": "^2.3.0",
|
||||
"laravel-mix": "^6.0.43",
|
||||
"mix-tailwindcss": "^1.3.0",
|
||||
"tailwindcss": "^3.0.18",
|
||||
"tailwindcss-debug-screens": "^2.2.1"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,70 @@
|
||||
const colors = require('tailwindcss/colors');
|
||||
|
||||
module.exports = {
|
||||
content: [
|
||||
'../../config/**/*.yaml',
|
||||
'../../pages/**/*.md',
|
||||
'./blueprints/**/*.yaml',
|
||||
'./js/**/*.js',
|
||||
'./templates/**/*.twig',
|
||||
'./{{ component.name|hyphenize }}.yaml',
|
||||
'./{{ component.name|hyphenize }}.php'
|
||||
],
|
||||
darkMode: 'class', //false or 'media' or 'class'
|
||||
theme: {
|
||||
extend: {
|
||||
screens: {
|
||||
sm: '640px',
|
||||
md: '768px',
|
||||
lg: '1024px',
|
||||
xl: '1280px',
|
||||
'2xl': '1536px'
|
||||
}
|
||||
},
|
||||
colors: {
|
||||
'primary': {
|
||||
'lighter': colors.yellow['300'],
|
||||
DEFAULT: colors.yellow['400'],
|
||||
'darker' : colors.yellow['500'],
|
||||
},
|
||||
black: colors.black,
|
||||
white: colors.white,
|
||||
red: colors.red,
|
||||
green: colors.green,
|
||||
blue: colors.blue,
|
||||
orange: colors.orange,
|
||||
indigo: colors.indigo,
|
||||
transparent: 'transparent',
|
||||
'inherit': 'inherit',
|
||||
},
|
||||
typography: (theme) => ({
|
||||
DEFAULT: {
|
||||
css: {
|
||||
color: 'inherit',
|
||||
lineHeight: 'inherit',
|
||||
maxWidth: 'inherit',
|
||||
a: {
|
||||
transition: 'all 500ms',
|
||||
color: theme('colors.primary.DEFAULT'),
|
||||
'&:hover': {
|
||||
color: theme('colors.primary.darker')
|
||||
},
|
||||
textDecoration: 'none'
|
||||
},
|
||||
strong: {
|
||||
color: 'inherit'
|
||||
},
|
||||
}
|
||||
}
|
||||
}),
|
||||
},
|
||||
variants: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [
|
||||
require('@tailwindcss/forms'),
|
||||
require('@tailwindcss/typography'),
|
||||
require('tailwindcss-debug-screens')
|
||||
],
|
||||
important: false,
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{{ page.content|raw }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,8 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="prose">
|
||||
<h1>{{ 'THEME_TAILWIND.ERROR'|t }}</h1>
|
||||
{{ page.content|raw }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,68 @@
|
||||
{% set extension = config.theme.production ? '.min' : '' %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ (grav.language.getActive ?: grav.config.site.default_lang)|e }}">
|
||||
<head>
|
||||
{% block head %}
|
||||
<meta charset="utf-8" />
|
||||
<title>{% if header.title %}{{ header.title|e }} | {% endif %}{{ site.title|e }}</title>
|
||||
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
{% include 'partials/metadata.html.twig' %}
|
||||
|
||||
<link rel="icon" type="image/png" href="{{ url('theme://images/logo.png')|e }}" />
|
||||
<link rel="canonical" href="{{ page.url(true, true)|e }}" />
|
||||
{% endblock head %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{% do assets.addCss('theme://dist/css/site' ~ extension ~ '.css', 98) %}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{% do assets.addJs('theme://dist/js/main' ~ extension ~ '.js', 98) %}
|
||||
{% endblock %}
|
||||
|
||||
{% block assets deferred %}
|
||||
{{ assets.css()|raw }}
|
||||
{{ assets.js()|raw }}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body id="top" class="{{ page.header.body_classes|e }} {{ config.theme.production ?: 'debug-screens' }}">
|
||||
|
||||
{% block header %}
|
||||
<div class="header">
|
||||
<div class="">
|
||||
<a class="logo" href="{{ home_url|e }}">
|
||||
{{ config.site.title|e }}
|
||||
</a>
|
||||
{% block header_navigation %}
|
||||
<nav class="main-nav">
|
||||
{% include 'partials/navigation.html.twig' %}
|
||||
</nav>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<section id="body">
|
||||
<div class="prose">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
<div class="footer text-center">
|
||||
<div class="">
|
||||
<p><a href="http://getgrav.org">Grav</a>, by <a href="https://trilby.media">Trilby Media, LLC</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block bottom %}
|
||||
{{ assets.js('bottom')|raw }}
|
||||
{% endblock %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,47 @@
|
||||
{% macro loop(page) %}
|
||||
{% for p in page.children.visible %}
|
||||
{% set current_page = (p.active or p.activeChild) ? 'selected' : '' %}
|
||||
{% if p.children.visible.count > 0 %}
|
||||
<li class="has-children {{ current_page|e }}">
|
||||
<a href="{{ p.url|e }}">
|
||||
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon|e }}"></i>{% endif %}
|
||||
{{ p.menu|e }}
|
||||
</a>
|
||||
<ul>
|
||||
{{ _self.loop(p) }}
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="{{ current_page|e }}">
|
||||
<a href="{{ p.url|e }}">
|
||||
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon|e }}"></i>{% endif %}
|
||||
{{ p.menu|e }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
|
||||
<ul>
|
||||
{% if config.theme.dropdown.enabled %}
|
||||
{{ _self.loop(pages) }}
|
||||
{% else %}
|
||||
{% for page in pages.children.visible %}
|
||||
{% set current_page = (page.active or page.activeChild) ? 'selected' : '' %}
|
||||
<li class="{{ current_page|e }}">
|
||||
<a href="{{ page.url|e }}">
|
||||
{% if page.header.icon %}<i class="fa fa-{{ page.header.icon|e }}"></i>{% endif %}
|
||||
{{ page.menu|e }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% for mitem in site.menu %}
|
||||
<li>
|
||||
<a href="{{ mitem.url|e }}">
|
||||
{% if mitem.icon %}<i class="fa fa-{{ mitem.icon|e }}"></i>{% endif %}
|
||||
{{ mitem.text|e }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Grav\Theme;
|
||||
|
||||
use Grav\Common\Theme;
|
||||
|
||||
class {{ component.name|camelize }} extends Theme
|
||||
{
|
||||
// Access plugin events in this class
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
enabled: true
|
||||
production: false
|
||||
dropdown:
|
||||
enabled: true
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
@@ -0,0 +1,17 @@
|
||||
let mix = require('laravel-mix');
|
||||
require('mix-tailwindcss');
|
||||
|
||||
const extension = mix.inProduction() ? '.min' : '';
|
||||
|
||||
mix.js('js/main.js', `js/main${extension}.js`)
|
||||
.css('css/site.css', `css/site${extension}.css`)
|
||||
.tailwind()
|
||||
.setPublicPath('dist')
|
||||
.version()
|
||||
// .browserSync({
|
||||
// proxy: 'http://domain.test',
|
||||
// files: [
|
||||
// './dist/mix-manifest.json',
|
||||
// '../../pages/**/*.md'
|
||||
// ]
|
||||
// })
|
||||
@@ -0,0 +1,5 @@
|
||||
# v0.1.0
|
||||
## {{ "now"|date("m/d/Y") }}
|
||||
|
||||
1. [](#new)
|
||||
* ChangeLog started...
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) {{ "now"|date("Y") }} {{ component.author.name }}
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,41 @@
|
||||
# {{ component.name|titleize }} Theme
|
||||
|
||||
The **{{ component.name|titleize }}** Theme is for [Grav CMS](http://github.com/getgrav/grav). This README.md file should be modified to describe the features, installation, configuration, and general usage of this theme.
|
||||
|
||||
## Description
|
||||
|
||||
{{ component.description }}
|
||||
|
||||
# Instructions
|
||||
|
||||
Run
|
||||
|
||||
`npm install` to setup tailwind and required plugins
|
||||
|
||||
How to build tailwind:
|
||||
|
||||
Development:
|
||||
|
||||
`npm run build` for single time compiling
|
||||
|
||||
`npm run watch` for constant development
|
||||
|
||||
Production:
|
||||
|
||||
`npm run prod` for production compiling. **Don't forget to turn on production mode in the theme config**# Instructions
|
||||
|
||||
Run
|
||||
|
||||
`npm install` to setup tailwind and required plugins
|
||||
|
||||
How to build tailwind:
|
||||
|
||||
Development:
|
||||
|
||||
`npm run build` for single time compiling
|
||||
|
||||
`npm run watch` for constant development
|
||||
|
||||
Production:
|
||||
|
||||
`npm run prod` for production compiling. **Don't forget to turn on production mode in the theme config**
|
||||
@@ -0,0 +1,43 @@
|
||||
{% set githubid = component.author.githubid ?: component.author.name|hyphenize -%}
|
||||
name: {{ component.name|titleize }}
|
||||
slug: {{ component.name|hyphenize }}
|
||||
type: theme
|
||||
version: 0.1.0
|
||||
description: {{ component.description }}
|
||||
icon: rebel
|
||||
author:
|
||||
name: {{ component.author.name }}
|
||||
email: {{ component.author.email }}
|
||||
homepage: https://github.com/{{ githubid }}/grav-theme-{{ component.name|hyphenize }}
|
||||
demo: http://demo.yoursite.com
|
||||
keywords: grav, theme, etc
|
||||
bugs: https://github.com/{{ githubid }}/grav-theme-{{ component.name|hyphenize }}/issues
|
||||
readme: https://github.com/{{ githubid }}/grav-theme-{{ component.name|hyphenize }}/blob/develop/README.md
|
||||
license: MIT
|
||||
|
||||
dependencies:
|
||||
- { name: grav, version: '>=1.6.0' }
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
dropdown.enabled:
|
||||
type: toggle
|
||||
label: Dropdown in Menu
|
||||
highlight: 1
|
||||
default: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
production:
|
||||
type: toggle
|
||||
label: Production Mode
|
||||
highlight: 1
|
||||
default: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
@@ -0,0 +1,5 @@
|
||||
/*@import 'yourcssfile.css';*/
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
After Width: | Height: | Size: 8.5 KiB |
@@ -0,0 +1,5 @@
|
||||
import Alpine from 'alpinejs'
|
||||
|
||||
window.Alpine = Alpine
|
||||
|
||||
Alpine.start()
|
||||
@@ -0,0 +1,2 @@
|
||||
THEME_{{ component.name|hyphenize|replace({'-': '_'})|upper }}:
|
||||
ERROR: 'Error!'
|
||||
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"name": "tailwind",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"devDependencies": {
|
||||
"postcss": "^8.4.21"
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
|
||||
"integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
|
||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.4.21",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz",
|
||||
"integrity": "sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/postcss/"
|
||||
},
|
||||
{
|
||||
"type": "tidelift",
|
||||
"url": "https://tidelift.com/funding/github/npm/postcss"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.4",
|
||||
"picocolors": "^1.0.0",
|
||||
"source-map-js": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
|
||||
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"nanoid": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
|
||||
"integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==",
|
||||
"dev": true
|
||||
},
|
||||
"picocolors": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
|
||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
|
||||
"dev": true
|
||||
},
|
||||
"postcss": {
|
||||
"version": "8.4.21",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz",
|
||||
"integrity": "sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"nanoid": "^3.3.4",
|
||||
"picocolors": "^1.0.0",
|
||||
"source-map-js": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"source-map-js": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
|
||||
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "{{ component.name }}",
|
||||
"repository": "",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "cross-env NODE_ENV=development tailwindcss -i ./css/site.css -o ./dist/css/site.css --postcss",
|
||||
"watch": "cross-env NODE_ENV=development tailwindcss -i ./css/site.css -o ./dist/css/site.css --postcss --watch",
|
||||
"prod" : "cross-env NODE_ENV=production tailwindcss -i ./css/site.css -o ./dist/css/site.css --postcss"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/forms": "^0.5.3",
|
||||
"@tailwindcss/typography": "^0.5.9",
|
||||
"alpinejs": "^2.8.2",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"cross-env": "^7.0.3",
|
||||
"postcss": "^8.4.21",
|
||||
"postcss-import": "^15.1.0",
|
||||
"tailwindcss": "^3.2.6",
|
||||
"tailwindcss-debug-screens": "^2.2.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
'postcss-import': {},
|
||||
'tailwindcss/nesting': {},
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
...process.env.NODE_ENV === 'production'
|
||||
? {'cssnano': {}} : {}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,22 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'../../config/**/*.yaml',
|
||||
'../../pages/**/*.md',
|
||||
'./blueprints/**/*.yaml',
|
||||
'./js/**/*.js',
|
||||
'./templates/**/*.twig',
|
||||
'./{{ component.name|hyphenize }}.yaml',
|
||||
'./{{ component.name|hyphenize }}.php'
|
||||
],
|
||||
darkMode: 'class', //false or 'media' or 'class'
|
||||
theme: {},
|
||||
variants: {
|
||||
extend: {}
|
||||
},
|
||||
plugins: [
|
||||
require('@tailwindcss/forms'),
|
||||
require('@tailwindcss/typography'),
|
||||
require('tailwindcss-debug-screens')
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{{ page.content|raw }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,8 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="prose">
|
||||
<h1>{{ 'THEME_TAILWIND.ERROR'|t }}</h1>
|
||||
{{ page.content|raw }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,68 @@
|
||||
{% set extension = config.theme.production ? '.min' : '' %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ (grav.language.getActive ?: grav.config.site.default_lang)|e }}">
|
||||
<head>
|
||||
{% block head %}
|
||||
<meta charset="utf-8" />
|
||||
<title>{% if header.title %}{{ header.title|e }} | {% endif %}{{ site.title|e }}</title>
|
||||
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
{% include 'partials/metadata.html.twig' %}
|
||||
|
||||
<link rel="icon" type="image/png" href="{{ url('theme://images/logo.png')|e }}" />
|
||||
<link rel="canonical" href="{{ page.url(true, true)|e }}" />
|
||||
{% endblock head %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{% do assets.addCss('theme://dist/css/site' ~ extension ~ '.css', 98) %}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{% do assets.addJs('theme://js/main' ~ extension ~ '.js', 98) %}
|
||||
{% endblock %}
|
||||
|
||||
{% block assets deferred %}
|
||||
{{ assets.css()|raw }}
|
||||
{{ assets.js()|raw }}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body id="top" class="{{ page.header.body_classes|e }} {{ config.theme.production ?: 'debug-screens' }}">
|
||||
|
||||
{% block header %}
|
||||
<div class="header">
|
||||
<div class="">
|
||||
<a class="logo" href="{{ home_url|e }}">
|
||||
{{ config.site.title|e }}
|
||||
</a>
|
||||
{% block header_navigation %}
|
||||
<nav class="main-nav">
|
||||
{% include 'partials/navigation.html.twig' %}
|
||||
</nav>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<section id="body">
|
||||
<div class="prose">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
<div class="footer text-center">
|
||||
<div class="">
|
||||
<p><a href="http://getgrav.org">Grav</a>, by <a href="https://trilby.media">Trilby Media, LLC</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block bottom %}
|
||||
{{ assets.js('bottom')|raw }}
|
||||
{% endblock %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,47 @@
|
||||
{% macro loop(page) %}
|
||||
{% for p in page.children.visible %}
|
||||
{% set current_page = (p.active or p.activeChild) ? 'selected' : '' %}
|
||||
{% if p.children.visible.count > 0 %}
|
||||
<li class="has-children {{ current_page|e }}">
|
||||
<a href="{{ p.url|e }}">
|
||||
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon|e }}"></i>{% endif %}
|
||||
{{ p.menu|e }}
|
||||
</a>
|
||||
<ul>
|
||||
{{ _self.loop(p) }}
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="{{ current_page|e }}">
|
||||
<a href="{{ p.url|e }}">
|
||||
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon|e }}"></i>{% endif %}
|
||||
{{ p.menu|e }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
|
||||
<ul>
|
||||
{% if config.theme.dropdown.enabled %}
|
||||
{{ _self.loop(pages) }}
|
||||
{% else %}
|
||||
{% for page in pages.children.visible %}
|
||||
{% set current_page = (page.active or page.activeChild) ? 'selected' : '' %}
|
||||
<li class="{{ current_page|e }}">
|
||||
<a href="{{ page.url|e }}">
|
||||
{% if page.header.icon %}<i class="fa fa-{{ page.header.icon|e }}"></i>{% endif %}
|
||||
{{ page.menu|e }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% for mitem in site.menu %}
|
||||
<li>
|
||||
<a href="{{ mitem.url|e }}">
|
||||
{% if mitem.icon %}<i class="fa fa-{{ mitem.icon|e }}"></i>{% endif %}
|
||||
{{ mitem.text|e }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Grav\Theme;
|
||||
|
||||
use Grav\Common\Theme;
|
||||
|
||||
class {{ component.name|camelize }} extends Theme
|
||||
{
|
||||
// Access plugin events in this class
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
enabled: true
|
||||
production: false
|
||||
dropdown:
|
||||
enabled: true
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
@@ -0,0 +1,17 @@
|
||||
let mix = require('laravel-mix');
|
||||
require('mix-tailwindcss');
|
||||
|
||||
const extension = mix.inProduction() ? '.min' : '';
|
||||
|
||||
mix.js('js/main.js', `js/main${extension}.js`)
|
||||
.css('css/site.css', `css/site${extension}.css`)
|
||||
.tailwind()
|
||||
.setPublicPath('dist')
|
||||
.version()
|
||||
// .browserSync({
|
||||
// proxy: 'http://domain.test',
|
||||
// files: [
|
||||
// './dist/mix-manifest.json',
|
||||
// '../../pages/**/*.md'
|
||||
// ]
|
||||
// })
|
||||