Term is a tiny, lightweight CMS purpose-built for Terminal Land. But maybe you can use it for something, too?
- Simple templating engine
- Easy metadata management process
- Respects existing directory structure
- Supports Markdown
- Effortlessly extensible
- Put
term.php
wherever you’d like on your server. If you want Markdown support, putParsedown.php
in the same location. - At the root level from which your content is served, add a
.htaccess
file that looks like this:
Options -Indexes
DirectoryIndex /path/to/term.php
- In any directory from which you’re serving content, add a
metadata.json
file with these items at a minimum:
{
"index": "your_index.file",
"title": "Term",
}
- That’s it. Your Term-powered site is now up and running.
You can edit term.html
to customize the template however you’d like.
Term supports “collections”, which lets you manage some metadata at one level above the current page. For example, if you have some related pages being served under a parent directory, that parent directory is a collection and you can include a metadata.json
file there. That JSON string should include url
, title
, and icon
items which will override those values from the local metadata file.
You can also set a local metadata for any given page by including a special JSON chunk, like so:
%{
"title": "Unique page title",
"description": "Individual page description",
}%
Here’s a list of available metadata items:
index
: the file that should be served when the directory is accessedtitle
: the page’s titlecollection_title
: the collection’s titleurl
: the page’s canonical URLcollection_url
: the collection’s canonical URLdescription
: the page’s descriptionstylesheet
: the stylesheet path/filename to be usedhead
: any additional stuff you’d like to include in your page’s<head>
sectionicon
: any HTML that you’d like to include for a page or collection specific icon (SVG works well here)
That’s all. Hope you find it useful.