Theme Creation Rules
CleanSlate Theme Development Tutorial Series
Video #8 File, folder structure and theme rules
When making CleanSlate themes, you must follow the following rules when making a theme:
- Your theme
must have the following four folders at the top level and they
must be named:
images
,javascripts
,stylesheets
andviews
.- Within
views
you must have alayouts
folder. - Inside the
layouts
folder, you must have adefault.html
file. - Inside your
views
folder, you must have a template calledfrontpage.html
. You're probably also going to want a template calledbackpage.html
if your theme has more than one page.
- Within
- Your theme must have a
config.yml
file in the root. - Your theme should have a
.gitignore
file in the root. - Your theme should have a
README.md
file in the root that has:- Your theme's name
- A short description of your theme
- Your (the developer's) name
- The Bitbucket Repository URL
- Site URL
- A list of any required dependencies or software needed to work with the theme (e.g., if you're using Sass, you could say that you used GulpJS and Gulp Sass to make the site). Please include version numbers here, if appropriate.
- Any other notes, comments or reminders that would be helpful to those unfamiliar with the project.
Your theme's structure should look similar to the image above. You should check out the CleanSlate Toolkit boilerplate for a working example of a theme's structure.
Note:You can have other top level folders in your theme; however, they will not be publicly readable from your site's URL (e.g., http://example.wvu.edu/awesome-folder/goofy.jpg will not load in your browser).
Note 2: There is one exception to the folder rule. You can have a
folder named public
and it will be publicly readable. You can put
anything in there you like; however, it shouldn't be CSS or javascript. We
usually put fonts in the public
folder at public/fonts
.
The
code repository makes use of the public folder.
Last updated on July 20, 2022.
We welcome all questions, feedback and bug reports. If you're having an issue, we usually need the following information:
- A brief description of the issue
- A link to the page where you saw the issue
- Screenshots that illustrate the problem - How do I take a screenshot?
Kindly email CleanSlate@mail.wvu.edu for help or use the form on the request help page.