schtickle.ts 1.05 KB
Newer Older
Colby Russell's avatar
Colby Russell committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
/* This Software is subject to the terms of The MIT License. */

/// <reference path="fsutils.ts" />

interface Config {
  postLink: string;
}

interface Contents {
  frontMatter: string;
  mainContent: string;
}

interface Doc {
  content: string;
  name: string;
  url: string;
}

interface Post extends Doc {
  date: Date;
  tags: string[];
  // isLink: boolean;
}

interface TagToPostMap {
  [index: string]: Post[];
}

interface MoldContext {
  site: {
    posts: Post[];
    tags: TagToPostMap;
    config: Config;
  };
  dateFormat: any;
}

interface BakedLayout {
  (arg?: any): string;
  fileName: string;
}

interface LayoutMap {
  [index: string]: BakedLayout;
}

function readConfig(): Config {
}

function readContents(fileName: string): Contents {
}

function readPosts(config: Config): Post[] {
}

function getURL(config: Config, post: Post): string {
}

function gatherTags(posts: Post[]): TagToPostMap {
}

function prepareIncludes(context: MoldContext) {
}

function getLayout(name: string, context: MoldContext): BakedLayout {
}

function generate() {
}