Skip to content

Commit

Permalink
Renamed Indexes to Taxonomies. Old template and config parameters sti…
Browse files Browse the repository at this point in the history
…ll work.
  • Loading branch information
spf13 committed Apr 9, 2014
1 parent aae6fa0 commit 93bcdde
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 150 deletions.
2 changes: 2 additions & 0 deletions commands/hugo.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ func InitializeConfig() {
viper.AddConfigPath(Source)
viper.ReadInConfig()

viper.RegisterAlias("taxonomies", "indexes")

viper.SetDefault("ContentDir", "content")
viper.SetDefault("LayoutDir", "layouts")
viper.SetDefault("StaticDir", "static")
Expand Down
18 changes: 0 additions & 18 deletions hugolib/indexing_test.go

This file was deleted.

24 changes: 12 additions & 12 deletions hugolib/page_index_test.go → hugolib/page_taxonomy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ import (
"testing"
)

var PAGE_YAML_WITH_INDEXES_A = `---
var PAGE_YAML_WITH_TAXONOMIES_A = `---
tags: ['a', 'b', 'c']
categories: 'd'
---
YAML frontmatter with tags and categories index.`
YAML frontmatter with tags and categories taxonomy.`

var PAGE_YAML_WITH_INDEXES_B = `---
var PAGE_YAML_WITH_TAXONOMIES_B = `---
tags:
- "a"
- "b"
- "c"
categories: 'd'
---
YAML frontmatter with tags and categories index.`
YAML frontmatter with tags and categories taxonomy.`

var PAGE_JSON_WITH_INDEXES = `{
var PAGE_JSON_WITH_TAXONOMIES = `{
"categories": "d",
"tags": [
"a",
Expand All @@ -30,19 +30,19 @@ var PAGE_JSON_WITH_INDEXES = `{
}
JSON Front Matter with tags and categories`

var PAGE_TOML_WITH_INDEXES = `+++
var PAGE_TOML_WITH_TAXONOMIES = `+++
tags = [ "a", "b", "c" ]
categories = "d"
+++
TOML Front Matter with tags and categories`

func TestParseIndexes(t *testing.T) {
for _, test := range []string{PAGE_TOML_WITH_INDEXES,
PAGE_JSON_WITH_INDEXES,
PAGE_YAML_WITH_INDEXES_A,
PAGE_YAML_WITH_INDEXES_B,
func TestParseTaxonomies(t *testing.T) {
for _, test := range []string{PAGE_TOML_WITH_TAXONOMIES,
PAGE_JSON_WITH_TAXONOMIES,
PAGE_YAML_WITH_TAXONOMIES_A,
PAGE_YAML_WITH_TAXONOMIES_B,
} {
p, err := ReadFrom(strings.NewReader(test), "page/with/index")
p, err := ReadFrom(strings.NewReader(test), "page/with/taxonomy")
if err != nil {
t.Fatalf("Failed parsing %q: %s", test, err)
}
Expand Down
Loading

0 comments on commit 93bcdde

Please sign in to comment.