neatnik / term

A tiny, lightweight CMS purpose-built for Terminal Land

Home Page:https://terminal.land/tools/term/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Term

Term is a tiny, lightweight CMS purpose-built for Terminal Land. But maybe you can use it for something, too?

Features

  • Simple templating engine
  • Easy metadata management process
  • Respects existing directory structure
  • Supports Markdown
  • Effortlessly extensible

Get started

  1. Put term.php wherever you’d like on your server. If you want Markdown support, put Parsedown.php in the same location.
  2. 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
  1. 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",
}
  1. That’s it. Your Term-powered site is now up and running.

Make it your own

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 accessed
  • title: the page’s title
  • collection_title: the collection’s title
  • url: the page’s canonical URL
  • collection_url: the collection’s canonical URL
  • description: the page’s description
  • stylesheet: the stylesheet path/filename to be used
  • head: any additional stuff you’d like to include in your page’s <head> section
  • icon: 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.

About

A tiny, lightweight CMS purpose-built for Terminal Land

https://terminal.land/tools/term/

License:MIT License


Languages

Language:PHP 88.9%Language:HTML 6.6%Language:CSS 4.4%