You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
+
```
28
29
29
30
## 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.
32
31
33
32
There are some minimum requirements for your theme to run. That is:
34
33
35
34
- The `theme` folder in `/site/` (obviously)
36
35
- 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
40
39
- That's it!
41
40
42
41
### 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.
44
44
45
45
Templates live in a folder in `/site/theme/` called `/templates`. A template file equals the page name.
46
46
Page `yoursite.com/about-me` requires a template file called `about-me.php`.
47
47
48
48
### Partials
49
+
49
50
In adition to templates you have partials. A partial is a piece of code that you find yourself reusing.
50
51
51
52
Partials live in a folder in `/site/theme` called `/partials`. Partial names should be a-Z, 0-9 and `.php` files.
52
53
To use a partial in your theme you call it by filename without `.php`. Example: `<?php get_partial('partial-name'); ?>`.
53
54
54
55
### 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.
56
58
The only thing you have to do is use `get_stylesheets()` and `get_scripts()`. Example:
57
59
58
60
```
@@ -66,13 +68,15 @@ The only thing you have to do is use `get_stylesheets()` and `get_scripts()`. Ex
66
68
67
69
<?php get_scripts(); ?>
68
70
</body>
69
-
</html>
70
-
```
71
+
</html>
72
+
```
71
73
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.
73
75
74
76
## Plugins
77
+
75
78
Plugins in Volcano is easy to build and easy to use.
79
+
76
80
Plugins are basically a function that executes upon calling `plugin('plugin-name')` which could create a Facebook widget, a gallery or something else.
77
81
78
82
The requirements for a plugin is:
@@ -87,6 +91,4 @@ To call a plugin from your theme files use:
87
91
88
92
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.
89
93
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
-
92
94
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.
0 commit comments