~srivathsan/blaze

10d9fdb1744a9822fa2204c78372abef5e3b1492 — Srivathsan Murali 3 years ago 078ca36
content is root dir
2 files changed, 16 insertions(+), 5 deletions(-)

M builder/page.go
M config/config.go
M builder/page.go => builder/page.go +11 -0
@@ 119,6 119,17 @@ func GetPages(rootPath string, config *config.BlazeConfig) ([]*Page, error) {
			return err
		}

		skip := info.Name()[0] == '_' || info.Name()[0] == '.'

		if info.IsDir() && skip {
			fmt.Println("Skipping - ", info.Name())
			return filepath.SkipDir
		}

		if skip {
			return nil
		}

		if info.IsDir() {
			// skip dirs
			return nil

M config/config.go => config/config.go +5 -5
@@ 36,7 36,7 @@ func LoadConfig(root string) (*BlazeConfig, error) {
		return nil, err
	}

	filename := path.Join(root, "config.yaml")
	filename := path.Join(root, "_config.yaml")

	buf, err := ioutil.ReadFile(filename)
	if err != nil {


@@ 57,17 57,17 @@ func LoadConfig(root string) (*BlazeConfig, error) {
}

func (c *BlazeConfig) TemplateDir() string {
	return path.Join(c.path, "templates")
	return path.Join(c.path, "_templates")
}

func (c *BlazeConfig) ContentDir() string {
	return path.Join(c.path, "contents")
	return c.path
}

func (c *BlazeConfig) OutputDir() string {
	return path.Join(c.path, "public")
	return path.Join(c.path, "_public")
}

func (c *BlazeConfig) StaticDir() string {
	return path.Join(c.path, "static")
	return path.Join(c.path, "_static")
}