Skip to content

Commit 7baca47

Browse files
committed
updated docs and composer description
1 parent 8daf116 commit 7baca47

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

README.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<div align=center>
2-
<h1>jerpy</h1>
3-
<p>Small | Zero Dependencies | Flat-file</p>
2+
<div style="font-size:2em;font-weight:bold">jerpy</div>
3+
<p>Simple - Extendable - Flat-file</p>
44
</div>
55
<hr>
66

7-
Jerpy a small, zero-dependency, flat-file simple website system built for control and simplicity that is easy to install, customize, and maintain.
7+
Jerpy a simple, extendable, flat-file simple website system built for control and ease-of-use that is easy to install, customize, and maintain.
88

9-
Jerpy doesn't have a management interface or web portal (there *could* be a [plugin](#plugins) for that...). Everything is managed directly via the files themselves.
9+
**NOTE: Jerpy isn't a traditional CMS and doesn't have a management interface or web portal (but there *could* be a [plugin](#plugins) for that...). Everything is managed directly via the files themselves.**
1010

1111
# Getting Started
1212
## Composer
@@ -20,9 +20,7 @@ composer create-project ginger-tek/jerpy <directory>
2020
- ## `layouts`
2121
Stores layout templates, each their own `.php` file. The default global theme is set in `config.php` via the `$layout` property. The value is just the file name with no extension.
2222
- ## `assets`
23-
Organize your CSS, JavaScript, fonts, and images to use in your layouts and pages via absolute URI here:
24-
- ## `media`
25-
For any and all URL-accessible files, such as documents, video/music, etc.
23+
Organize your CSS, JavaScript, fonts, and images to use in your layouts and pages via absolute URI here
2624
- ## `content`
2725
For all your embedded content files, such as Markdown text files, and is not URL-accessible.
2826

@@ -54,13 +52,13 @@ $routes = [
5452
]
5553
```
5654

57-
When implementing metadata, use the `@` warning suppression syntax to avoid warnings when a route does't have that metadata property specified:
55+
When implementing metadata, use null coalescing syntax to avoid warnings when a route does't have that metadata property specified:
5856
```html
5957
<head>
6058
...
61-
<meta name="og:title" content="<?= @$meta['title'] ?>">
62-
<meta name="og:description" content="<?= @$meta['description'] ?>">
63-
<meta name="og:image" content="<?= @$meta['thumbnail'] ?>">
59+
<meta name="og:title" content="<?= $meta['title'] ?? '' ?>">
60+
<meta name="og:description" content="<?= $meta['description'] ?? '' ?>">
61+
<meta name="og:image" content="<?= $meta['thumbnail'] ?? '' ?>">
6462
...
6563
</head>
6664
```
@@ -103,8 +101,23 @@ Plugins can be created to extend or add functionality to Jerpy. They do not requ
103101
🗀 someSupportingPackage
104102
```
105103

106-
Plugins can be included/required on a given page file as needed, or you can load it globally to be used on every page. To add a plugin, simply copy/upload the plugin's folder to the `plugins` directory. To enable a plugin globally, add it's folder name to the `$plugins` array in `config.php`.
104+
## Enabling Plugins
105+
Plugins can be included/required on a given page file as needed, or you can load it globally to be used on every page. To add a plugin, simply copy/upload the plugin's folder to the `plugins` directory.
107106

107+
To enable a plugin globally, add it's folder name to the `$plugins` array in `config.php`:
108+
```php
109+
$plugins = [
110+
'md'
111+
];
112+
```
113+
To enable a plugin only when a certain URI is matched, set a string key to check if the incoming URI starts with it:
114+
```php
115+
$plugins = [
116+
'/admin' => 'admin' // only loaded when /admin* is requested
117+
];
118+
```
119+
120+
## Plugin Example
108121
Below is an example plugin for using Parsedown via a wrapper method:
109122

110123
**NOTE: When including/requiring files within a plugin, make sure to use the `__DIR__` global to ensure PHP looks *within* the plugin directory and not in the root directory of the site**
@@ -130,5 +143,5 @@ $plugins = [
130143

131144
`pages/some-page.php`
132145
```php
133-
<?= md('path/to/markdown-file.md') ?>
146+
<?= md('content/markdown-file.md') ?>
134147
```

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ginger-tek/jerpy",
33
"type": "project",
4-
"description": "Small, flat-file PHP website",
4+
"description": "Simple, extendable, flat-file PHP website",
55
"homepage": "https://github.com/ginger-tek/jerpy",
66
"license": "ISC",
77
"authors": [

0 commit comments

Comments
 (0)