hugolib: Remove unused code - hugo - [fork] hugo port for 9front
 (HTM) git clone git@git.drkhsh.at/hugo.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit dea185aa9b62e1660cb5c6e79e90f2078db7fe6f
 (DIR) parent c21dc16dbe9d9cf44b341f1f995ed7776d6a1b62
 (HTM) Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
       Date:   Mon, 14 Mar 2016 15:41:03 +0100
       
       hugolib: Remove unused code
       
       Diffstat:
         M hugolib/menu_test.go                |       6 ------
         M hugolib/page.go                     |       5 -----
         M hugolib/page_test.go                |       5 -----
         M hugolib/pagesPrevNext_test.go       |      15 ---------------
         M hugolib/site.go                     |      14 --------------
         M hugolib/site_show_plan_test.go      |       9 ---------
         M hugolib/site_test.go                |      38 ++++++++-----------------------
         M hugolib/site_url_test.go            |       7 -------
       
       8 files changed, 9 insertions(+), 90 deletions(-)
       ---
 (DIR) diff --git a/hugolib/menu_test.go b/hugolib/menu_test.go
       @@ -182,12 +182,6 @@ menu:
        Front Matter with Menu with Identifier`, title, menu, identifier))
        }
        
       -type testMenuState struct {
       -        site       *Site
       -        oldMenu    interface{}
       -        oldBaseURL interface{}
       -}
       -
        // Issue 817 - identifier should trump everything
        func TestPageMenuWithIdentifier(t *testing.T) {
        
 (DIR) diff --git a/hugolib/page.go b/hugolib/page.go
       @@ -73,7 +73,6 @@ type Page struct {
                plain               string // TODO should be []byte
                plainWords          []string
                plainInit           sync.Once
       -        plainSecondaryInit  sync.Once
                renderingConfig     *helpers.Blackfriday
                renderingConfigInit sync.Once
                pageMenus           PageMenus
       @@ -813,10 +812,6 @@ func (p *Page) guessMarkupType() string {
                return helpers.GuessType(p.Source.Ext())
        }
        
       -func (p *Page) detectFrontMatter() (f *parser.FrontmatterType) {
       -        return parser.DetectFrontMatter(rune(p.frontmatter[0]))
       -}
       -
        func (p *Page) parse(reader io.Reader) error {
                psr, err := parser.ReadFrom(reader)
                if err != nil {
 (DIR) diff --git a/hugolib/page_test.go b/hugolib/page_test.go
       @@ -101,11 +101,6 @@ Content of the file goes Here
        Some text
        `
        
       -        SIMPLE_PAGE_JSON_COMPACT = `
       -{"title":"foobar","customData":{"foo":"bar"},"date":"2012-08-06"}
       -Text
       -`
       -
                SIMPLE_PAGE_NOLAYOUT = `---
        title: simple_no_layout
        ---
 (DIR) diff --git a/hugolib/pagesPrevNext_test.go b/hugolib/pagesPrevNext_test.go
       @@ -34,21 +34,6 @@ var pagePNTestSources = []pagePNTestObject{
                {"/section2/testpage5.md", 1, "2012-04-06"},
        }
        
       -func preparePagePNTestPages(t *testing.T) Pages {
       -        var pages Pages
       -        for _, s := range pagePNTestSources {
       -                p, err := NewPage(s.path)
       -                if err != nil {
       -                        t.Fatalf("failed to prepare test page %s", s.path)
       -                }
       -                p.Weight = s.weight
       -                p.Date = cast.ToTime(s.date)
       -                p.PublishDate = cast.ToTime(s.date)
       -                pages = append(pages, p)
       -        }
       -        return pages
       -}
       -
        func TestPrev(t *testing.T) {
                pages := preparePageGroupTestPages(t)
                assert.Equal(t, pages.Prev(pages[0]), pages[4])
 (DIR) diff --git a/hugolib/site.go b/hugolib/site.go
       @@ -87,7 +87,6 @@ type Site struct {
                targets        targetList
                targetListInit sync.Once
                RunMode        runmode
       -        params         map[string]interface{}
                draftCount     int
                futureCount    int
                Data           map[string]interface{}
       @@ -769,14 +768,6 @@ func (s *Site) Render() (err error) {
                return
        }
        
       -func (s *Site) checkDescriptions() {
       -        for _, p := range s.Pages {
       -                if len(p.Description) < 60 {
       -                        jww.FEEDBACK.Println(p.Source.Path() + " ")
       -                }
       -        }
       -}
       -
        func (s *Site) Initialise() (err error) {
                return s.initialize()
        }
       @@ -861,11 +852,6 @@ func (s *Site) checkDirectories() (err error) {
                return
        }
        
       -type pageResult struct {
       -        page *Page
       -        err  error
       -}
       -
        // ReReadFile resets file to be read from disk again
        func (s *Site) ReReadFile(absFilePath string) (*source.File, error) {
                jww.INFO.Println("rereading", absFilePath)
 (DIR) diff --git a/hugolib/site_show_plan_test.go b/hugolib/site_show_plan_test.go
       @@ -42,15 +42,6 @@ var fakeSource = []source.ByteSource{
                },
        }
        
       -func stringInSlice(a string, list []string) bool {
       -        for _, b := range list {
       -                if b == a {
       -                        return true
       -                }
       -        }
       -        return false
       -}
       -
        func checkShowPlanExpected(t *testing.T, s *Site, expected string) {
        
                out := new(bytes.Buffer)
 (DIR) diff --git a/hugolib/site_test.go b/hugolib/site_test.go
       @@ -41,18 +41,11 @@ title: simple template
        ---
        content`
        
       -        TEMPLATE_MISSING_FUNC        = "{{ .Title | funcdoesnotexists }}"
       -        TEMPLATE_FUNC                = "{{ .Title | urlize }}"
       -        TEMPLATE_CONTENT             = "{{ .Content }}"
       -        TEMPLATE_DATE                = "{{ .Date }}"
       -        INVALID_TEMPLATE_FORMAT_DATE = "{{ .Date.Format time.RFC3339 }}"
       -        TEMPLATE_WITH_URL_REL        = "<a href=\"foobar.jpg\">Going</a>"
       -        TEMPLATE_WITH_URL_ABS        = "<a href=\"/foobar.jpg\">Going</a>"
       -        PAGE_URL_SPECIFIED           = `---
       -title: simple template
       -url: "mycategory/my-whatever-content/"
       ----
       -content`
       +        TEMPLATE_MISSING_FUNC = "{{ .Title | funcdoesnotexists }}"
       +        TEMPLATE_FUNC         = "{{ .Title | urlize }}"
       +        TEMPLATE_CONTENT      = "{{ .Content }}"
       +        TEMPLATE_DATE         = "{{ .Date }}"
       +        TEMPLATE_WITH_URL_ABS = "<a href=\"/foobar.jpg\">Going</a>"
        
                PAGE_WITH_MD = `---
        title: page with md
       @@ -149,18 +142,6 @@ func NopCloser(w io.Writer) io.WriteCloser {
                return nopCloser{w}
        }
        
       -func matchRender(t *testing.T, s *Site, p *Page, tmplName string, expected string) {
       -        content := new(bytes.Buffer)
       -        err := s.renderThing(p, tmplName, NopCloser(content))
       -        if err != nil {
       -                t.Fatalf("Unable to render template.")
       -        }
       -
       -        if string(content.Bytes()) != expected {
       -                t.Fatalf("Content did not match expected: %s. got: %s", expected, content)
       -        }
       -}
       -
        func TestRenderThing(t *testing.T) {
                tests := []struct {
                        content  string
       @@ -209,15 +190,14 @@ func HTML(in string) string {
        
        func TestRenderThingOrDefault(t *testing.T) {
                tests := []struct {
       -                content  string
                        missing  bool
                        template string
                        expected string
                }{
       -                {PAGE_SIMPLE_TITLE, true, TEMPLATE_TITLE, HTML("simple template")},
       -                {PAGE_SIMPLE_TITLE, true, TEMPLATE_FUNC, HTML("simple-template")},
       -                {PAGE_SIMPLE_TITLE, false, TEMPLATE_TITLE, HTML("simple template")},
       -                {PAGE_SIMPLE_TITLE, false, TEMPLATE_FUNC, HTML("simple-template")},
       +                {true, TEMPLATE_TITLE, HTML("simple template")},
       +                {true, TEMPLATE_FUNC, HTML("simple-template")},
       +                {false, TEMPLATE_TITLE, HTML("simple template")},
       +                {false, TEMPLATE_FUNC, HTML("simple-template")},
                }
        
                hugofs.DestinationFS = new(afero.MemMapFs)
 (DIR) diff --git a/hugolib/site_url_test.go b/hugolib/site_url_test.go
       @@ -43,13 +43,6 @@ func must(err error) {
                }
        }
        
       -func mustReturn(ret *Page, err error) *Page {
       -        if err != nil {
       -                panic(err)
       -        }
       -        return ret
       -}
       -
        type InMemoryAliasTarget struct {
                target.HTMLRedirectAlias
                files map[string][]byte