Skip to content

Commit 562fe6e

Browse files
authored
Merge pull request #4 from sebastianks/update-to-be-library
Adds config/ and removes example project
2 parents 85f4328 + 0e2bcc9 commit 562fe6e

File tree

24 files changed

+79
-236
lines changed

24 files changed

+79
-236
lines changed

β€ŽREADME.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,60 @@
11
# Volcano
2-
A lightweight flat file CMS written in PHP.
3-
Volcano was built to help you built fast and custom websites without headaches.
2+
3+
An extendable & lightweight flat file blog and website constructor.
44

55
## Features
6-
Volcano is lightweight but the features included makes it powerful enough to run small to medium websites.
7-
Even though Volcano ships with some powerful core features, you're not limited to those because of the built-in plugin environment.
86

97
- No database
108
- Lightweight & fast
119
- You write your content in beautiful markdown
1210
- Easy-to-use plugin environment
1311
- Great with custom designs
14-
- Built-in caching & minifying of JS and CSS
1512

1613
## Requirements
14+
1715
A server running PHP.
1816

1917
## Get started
20-
Make a folder to run your site from. Example:
21-
22-
`mkdir ~path/to/site/`
2318

24-
`git clone https://github.com/sebastianks/volcano.git ~path/to/site/`
19+
```bash
20+
composer require sebastianks/volcano
2521

26-
## Setup
27-
There's some minimal settings for you to take care of in `setup.php` in the root of your site. There's some pretty understandable comments explaining each setting.
22+
# IMPORTANT
23+
# copy initial configuration and site to your project
24+
# if you don't do this you *have* to set these things up manually.
25+
cd ~/path/to/site/
26+
cp vendor/sebastianks/volcano/config/setup.php .
27+
cp -R vendor/sebastianks/volcano/config/site .
28+
```
2829

2930
## Theming
30-
You always start off with a very basic theme that let's you know Volcano is running.
31-
You can use this as a foundation for your theme, or you can delete everything and build your own.
3231

3332
There are some minimum requirements for your theme to run. That is:
3433

3534
- The `theme` folder in `/site/` (obviously)
3635
- Inside `/site/theme` you need the following files:
37-
- header.php
38-
- footer.php
39-
- index.php
36+
- header.php
37+
- footer.php
38+
- index.php
4039
- That's it!
4140

4241
### Templates
43-
A template is a `.php` file that let's you create a custom layout for a specific page on your site.
42+
43+
A template is a file that let's you create a custom layout for a specific page on your site.
4444

4545
Templates live in a folder in `/site/theme/` called `/templates`. A template file equals the page name.
4646
Page `yoursite.com/about-me` requires a template file called `about-me.php`.
4747

4848
### Partials
49+
4950
In adition to templates you have partials. A partial is a piece of code that you find yourself reusing.
5051

5152
Partials live in a folder in `/site/theme` called `/partials`. Partial names should be a-Z, 0-9 and `.php` files.
5253
To use a partial in your theme you call it by filename without `.php`. Example: `<?php get_partial('partial-name'); ?>`.
5354

5455
### CSS & JS
55-
All `.css` and `.js` files in `/site/theme` and `/site/plugins/*` are automatically minified and cached.
56+
57+
All `.css` and `.js` files in `/site/theme` and `/site/plugins` are automatically loaded.
5658
The only thing you have to do is use `get_stylesheets()` and `get_scripts()`. Example:
5759

5860
```
@@ -66,13 +68,15 @@ The only thing you have to do is use `get_stylesheets()` and `get_scripts()`. Ex
6668
6769
<?php get_scripts(); ?>
6870
</body>
69-
</html>
70-
```
71+
</html>
72+
```
7173

72-
_Both functions will only get minified if set to true in `/setup.php`, else they'll return multiple files._
74+
Each file will be loaded and added to the DOM individually one after another.
7375

7476
## Plugins
77+
7578
Plugins in Volcano is easy to build and easy to use.
79+
7680
Plugins are basically a function that executes upon calling `plugin('plugin-name')` which could create a Facebook widget, a gallery or something else.
7781

7882
The requirements for a plugin is:
@@ -87,6 +91,4 @@ To call a plugin from your theme files use:
8791

8892
The `plugin()` function takes two arguments. First is the name. Second argument is passed to the plugin root function, like: `googleAnalytics($id)`. The second argument is used to pass options to your plugin. This could be a single value, like in this case, an id, or an array of options. `$options` is default to `false`, and is not needed if your plugin doesn't need it.
8993

90-
Use `fb-page-plugin` and `google-analytics` as guidelines on how to write a plugin in Volcano. A more detailed guide will be written soon. Feel free to take contact if you need help. Also - if you don't need the plugins, you can delete them.
91-
9294
Your plugin can have `.css` and `.js` files, and will automatically be added to the front-end. Read the section "CSS & JS" for more information.

β€Žconfig/setup.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
/**
4+
* @desc - path for site.
5+
* should be set, otherwise content will be served from volcano/site internally.
6+
* default: volcano/site
7+
*/
8+
define('SITE', dirname(__FILE__) . '/site');
9+
10+
/**
11+
* @desc - use 404 page or not
12+
* if "false" redirect to default.md
13+
* default: true
14+
*/
15+
define('USE_404', true);
16+
17+
/**
18+
* @desc - use index.php or template as home
19+
* if `true` template has to be: site/templates/home.php
20+
* if `false` it will be index.php
21+
* default: true
22+
*/
23+
define('USE_HOME_TEMPLATE', false);
24+
25+
/**
26+
* @desc - whether or not to show errors.
27+
* default: false
28+
*
29+
* Should be false when your site is live
30+
*
31+
* By setting to true, you'll get error messages.
32+
*/
33+
define('IS_DEV', true);
34+
35+
// require volcano
36+
require './vendor/sebastianks/volcano/index.php';
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
Β (0)