Skip to content

Commit

Permalink
Merge branch 'release/1.5.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed May 19, 2021
2 parents 353ea22 + e23bc2b commit ae7358e
Show file tree
Hide file tree
Showing 29 changed files with 393 additions and 14 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# v1.5.2
## 05/19/2021

1. [](#new)
* Added basic TailwindCSS theme [#65](https://github.com/getgrav/grav-plugin-devtools/pull/65)
1. [](#improved)
* Fixed typo [#67](https://github.com/getgrav/grav-plugin-devtools/pull/67)
* Use canonical URLs [#58](https://github.com/getgrav/grav-plugin-devtools/pull/58)
* Replace `theme_config` with `config.theme` [#60](https://github.com/getgrav/grav-plugin-devtools/pull/60)
1. [](#bugfix)
* Fixed a bad path regarding composer install after plugin creation

# v1.5.1
## 03/17/2021

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ By default, devtools will perform a check with the online gpm repository to ensu

## Plugin Scaffolding

To create a new plugin you simply need to run: `bin/plugin devtools newplugin` and fill in the few questions at the prompts:
To create a new plugin you simply need to run: `bin/plugin devtools new-plugin` and fill in the few questions at the prompts:

```
> bin/plugin devtools newplugin
> bin/plugin devtools new-plugin
Enter Plugin Name: MyPlugin
Enter Plugin Description: My New Custom Plugin
Enter Developer Name: Johnny Rotten
Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: DevTools
slug: devtools
type: plugin
version: 1.5.1
version: 1.5.2
description: Plugin and Theme scaffolding utilities
icon: cogs
author:
Expand Down
2 changes: 1 addition & 1 deletion classes/DevToolsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ protected function createComponent(): bool
$this->output->writeln('Path: <cyan>' . $component_folder . '</cyan>');
$this->output->writeln('');
if ($type === 'plugin') {
$this->output->writeln('<yellow>Please run `cd user/plugins/' . $name . '` and `composer update` to initialize the autoloader</yellow>');
$this->output->writeln('<yellow>Please run `cd ' . $component_folder . '` and `composer update` to initialize the autoloader</yellow>');
$this->output->writeln('');
}

Expand Down
2 changes: 1 addition & 1 deletion cli/NewThemeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected function serve(): int

$question = new ChoiceQuestion(
'Please choose an option',
['pure-blank' => 'Basic Theme using Pure.css', 'inheritance' => 'Inherit from another theme', 'copy' => 'Copy another theme']
['pure-blank' => 'Basic Theme using Pure.css', 'tailwind' => 'Basic Theme using tailwind.css', 'inheritance' => 'Inherit from another theme', 'copy' => 'Copy another theme']
);
$this->component['template'] = $io->askQuestion($question);

Expand Down
8 changes: 4 additions & 4 deletions components/plugin/blank/plugin.php.twig
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class {{ component.name|camelize }}Plugin extends Plugin
}
/**
* Composer autoload.
*is
* @return ClassLoader
*/
* Composer autoload
*
* @return ClassLoader
*/
public function autoload(): ClassLoader
{
return require __DIR__ . '/vendor/autoload.php';
Expand Down
4 changes: 2 additions & 2 deletions components/theme/inheritance/theme.yaml.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ streams:
type: ReadOnlyStream
prefixes:
'':
- user/themes/{{ component.name|hyphenize }}
- user/themes/{{ component.extends }}
- 'user://themes/{{ component.name|hyphenize }}'
- 'user://themes/{{ component.extends }}'

{{ component.config }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{% set theme_config = attribute(config.themes, config.system.pages.theme) %}
<!DOCTYPE html>
<html lang="{{ (grav.language.getActive ?: grav.config.site.default_lang)|e }}">
<head>
Expand All @@ -11,7 +10,7 @@
{% 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 }}" />
<link rel="canonical" href="{{ page.canonical(true)|e }}" />
{% endblock head %}

{% block stylesheets %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% endmacro %}

<ul>
{% if theme_config.dropdown.enabled %}
{% if config.theme.dropdown.enabled %}
{{ _self.loop(pages) }}
{% else %}
{% for page in pages.children.visible %}
Expand Down
5 changes: 5 additions & 0 deletions components/theme/tailwind/CHANGELOG.md.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# v0.1.0
## {{ "now"|date("m/d/Y") }}

1. [](#new)
* ChangeLog started...
21 changes: 21 additions & 0 deletions components/theme/tailwind/LICENSE.twig
Original file line number Diff line number Diff line change
@@ -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.
41 changes: 41 additions & 0 deletions components/theme/tailwind/README.md.twig
Original file line number Diff line number Diff line change
@@ -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**
43 changes: 43 additions & 0 deletions components/theme/tailwind/blueprints.yaml.twig
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions components/theme/tailwind/css/site.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*@import 'yourcssfile.css';*/

@tailwind base;
@tailwind components;
@tailwind utilities;
Empty file.
Binary file added components/theme/tailwind/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
2 changes: 2 additions & 0 deletions components/theme/tailwind/languages/en.yaml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
THEME_{{ component.name|hyphenize|replace({'-': '_'})|upper }}:
ERROR: 'Error!'
30 changes: 30 additions & 0 deletions components/theme/tailwind/package.json.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "{{ component.name }}",
"repository": "",
"private": true,
"version": "0.1.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "postcss css/site.css -o dist/css/site.css --verbose",
"watch": "postcss css/site.css -o dist/css/site.css --watch --verbose",
"prod" : "postcss css/site.css -o dist/css/site.min.css --env production --verbose"
},
"dependencies": {},
"devDependencies": {
"alpinejs": "^2.8.2",
"tailwindcss": "^2.1.2",
"@tailwindcss/forms": "^0.3.2",
"@tailwindcss/typography": "^0.4.0",
"tailwindcss-debug-screens": "^2.0.0",
"autoprefixer": "^10.2.5",
"precss": "^4.0.0",
"cssnano": "^4.1.11",
"postcss": "^8.2.9",
"postcss-cli": "^8.3.1",
"postcss-import": "^14.0.1",
"postcss-nested": "^5.0.5",
"postcss-hexrgba": "^2.0.1",
"postcss-color-function": "^4.1.0"
}
}
11 changes: 11 additions & 0 deletions components/theme/tailwind/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
plugins: {
'postcss-import': {},
'precss': {},
'tailwindcss': {},
'postcss-nested': {},
'autoprefixer': {},
...process.env.NODE_ENV === 'production'
? {'cssnano': {}} : {}
},
}
Binary file added components/theme/tailwind/screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions components/theme/tailwind/tailwind.config.js.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
const { colors } = require('tailwindcss/defaultTheme');

module.exports = {
purge: [
'../../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/typography'),
require('@tailwindcss/forms'),
require('tailwindcss-debug-screens'),
],
important: false,
}
5 changes: 5 additions & 0 deletions components/theme/tailwind/templates/default.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends 'partials/base.html.twig' %}

{% block content %}
{{ page.content|raw }}
{% endblock %}
8 changes: 8 additions & 0 deletions components/theme/tailwind/templates/error.html.twig
Original file line number Diff line number Diff line change
@@ -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 %}
Loading

0 comments on commit ae7358e

Please sign in to comment.