Homebrew repository

From 5etools Community Wiki
Jump to: navigation, search

framless
v1.1.0

Hosting your own Homebrew Repository

EXPERT MODE ENGAGED!

SO you've created your own set of homebrew and are wanting to move to creating a complete, separate repository of homebrew you KNOW you like.

This is where you go to learn how.


First, The Directory structure is best mirrored off the Main Repository. (to the extent that your files are going to be stored by those categories.)

_generated
action
adventure
background
book
boon
class
collection
condition
creature
cult
deity
disease
feat
hazard
item
language
magicvariant
makebrew
object
optionalfeature
psionic
race
reward
spell
subclass
subrace
table
trap
variantrule
vehicle

The Site will be keying off the contents of the _generated directory's content.

Three files in directory are pulled for the homebrew manager to build the list of file for:

index-props.json
index-sources.json
index-timestamps.json

(its best to minify these after you've generated them)

index-props.json

List the entries by Object containers. (For use for specific homebrew manager calls from various site page features (ie. You're in Bestiary and "Add Homebrew"; you will only be pulling from the "creature" object the files that meet that criteria.
Structure
{
	"<object_name>":{
		"<dir_name>/<filename>.json": "<object>"
	}
}
The object's name corresponds to the folders/objects listed in Homebrew.
Each entry includes the directory (relative to the URL provided) / the filename, then defined as what kind of object it is (This is because a single entry can be a "collection" and so can span may object types.
Example (From the Main Repo)
{
	"action":{
		"action/Sample - Giddy; Extinguish.json": "action",
		"collection/hafdon; zorq.json":"collection"
	},
	"adventure":{
		"adventure/Adventurers League; DDEX1-01 - Defiance in Phlan.json":"adventure",
		"adventure/Adventurers League; DDEX1-02 - Secrets of Sokol Keep.json":"adventure"
       }
}

index-sources.json

This lists all possible files with their JSON identifiers as the key.
Structure
{
    "<json>": "<dir>/<filename>",
    "<json>": "<dir>/<filename>"
}


EXAMPLE:
{
	"GiddyAction":"action/Sample - Giddy; Extinguish.json",
 	"DDEX1-01":"adventure/Adventurers League; DDEX1-01 - Defiance in Phlan.json",
	"DDEX1-02":"adventure/Adventurers League; DDEX1-02 - Secrets of Sokol Keep.json"
}

index-timestamps.json

A file to list by Timestamps (creation and modification)
Structure
{
	"<dir>/<filename>":
		{"a":<epoc_Time>,"m":<epoc_Time>},
	"<dir>/<filename>":
		{"a":<epoc_Time>,"m":<epoc_Time>}
}
"a" being the epoctime for the content's publishing/creation date;
"m" being the epoctime for the last modification time.
Example:
{
	"action/Sample - Giddy; Extinguish.json":
		{"a":0,"m":0},
	"adventure/Adventurers League; DDEX1-01 - Defiance in Phlan.json":
		{"a":1558867830,"m":1558867830},
	"adventure/Adventurers League; DDEX1-02 - Secrets of Sokol Keep.json":
		{"a":1558867830,"m":1558867830}
}