Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken sitemap.xml template #972

Closed
bep opened this issue Mar 13, 2015 · 6 comments
Closed

Broken sitemap.xml template #972

bep opened this issue Mar 13, 2015 · 6 comments
Milestone

Comments

@bep
Copy link
Member

bep commented Mar 13, 2015

Pulled and built Hugo today, and now I get:

ERROR: 2015/03/13 Error while rendering sitemap: template: _internal/_default/sitemap.xml:11:14: executing "_internal/_default/sitemap.xml" at <.title>: can't evaluate field title in type string
@bep bep added the Bug label Mar 13, 2015
@bep
Copy link
Member Author

bep commented Mar 13, 2015

Suspect:

3c147bd

@spf13
Copy link
Contributor

spf13 commented Mar 13, 2015

I bet that's it. I'll take a look.

@anthonyfok anthonyfok added this to the v0.14 milestone Mar 13, 2015
@spf13
Copy link
Contributor

spf13 commented Mar 13, 2015

It's a bug, because it expects params.Images to have a specific structure. We should make it more flexible.

I didn't trigger it on my site since I don't use params.Images anyway.. and consequently I didn't notice it.

@bep
Copy link
Member Author

bep commented Mar 13, 2015

Yes - I use params.images in combination with an internal template (opengraph.html and others) ... that expects it to be a list of strings.

We should revert this - then fix it. I can revert this locally, but others are also using the current master.

@spf13
Copy link
Contributor

spf13 commented Mar 13, 2015

@bep.. Yeah, let's revert it. I see a couple other issues with it. We can put it back once it's cleaned up. My bad for merging it.

@bep bep closed this as completed in 27ed49e Mar 13, 2015
mohae pushed a commit to mohae/hugo that referenced this issue Mar 15, 2015
Fixes gohugoio#922

add finalize command and tests to change draft status of specified content to false and set date to Now()

undraft command

Allow hyphens in shortcode name

Fixes gohugoio#929

Keep trailing slash when baseUrl contains a sub path

Before this commit, .Site.BaseUrl ended up as:

http://mysite.com/ => http://mysite.com/
http://mysite.com/sub/ => http://mysite.com/sub

Now it becomes:

http://mysite.com/ => http://mysite.com/
http://mysite.com/sub/ => http://mysite.com/sub/

Fixed gohugoio#931

Improve error message on missing shortcode inner content

Fixes gohugoio#933

Allow the same shortcode to  be used with or without inline content

Fixes gohugoio#934

Update Readme.md with additional contribution guides

Added Gitter badge

Restructure top of Readme.md

Fixing image in readme

Using a smaller Header Image

Tidying the Readme a bit more

Update github-pages-blog.md

change `hugo serve` to `hugo server`

Add benchmark for the shortcode lexer

Apply gofmt -s

Avoid panic when pagination on 0 pages

Fixes gohugoio#948

Prevent 404.html from prettifying into 404/index.html

Restore @realchaseadams's commit 348e123
"Force `UglyUrls` option to force `404.html` file name"
which got lost after some refactoring (commit 8db3c0b).

Remove the equivalent "force `UglyUrls`" code for `sitemap.xml`
because the refactored code now calls `renderAndWriteXML()`
which uses `WriteDestFile()` which does not prettify a filename.

Fixes gohugoio#939

Fix errors reported by Go Vet

Fix some Go Lint errors

Apply some more Golint suggestions

helpers: apply some Golint rules

author: fix doc

hugolib: apply some Hugolint rules

page: make receiver name on Page methods consistent

Apply some Golint rules on Page, esp. making the method receiver names consistent:

(page *Page) ==> (p *Page)

menu: make receiver name on Page methods consistent

Apply some Golint rules on Menu, esp. making the method receiver names consistent.

hugolib: apply some more Golint rules

source: apply some Golint rules

livereload: apply some Golint rules

parser: apply some Golint rules

There is only one s.PageTarget() - so we cannot change it, even tempoararily. We have to find another solution to this.
...

Prevent 404.html from prettifying into 404/index.html

Restore @realchaseadams's commit 348e123
"Force `UglyUrls` option to force `404.html` file name"
which got lost after some refactoring (commit 8db3c0b).

Remove the equivalent "force `UglyUrls`" code for `sitemap.xml`
because the refactored code now calls `renderAndWriteXML()`
which uses `WriteDestFile()` which does not prettify a filename.

Fixes gohugoio#939 (reverted from commit c4c19ad)

Handle 404 thread safely

Replaces hack that temporarily changes a global flag.

Fixes gohugoio#955
Fixes gohugoio#939

Fix UglyUrls on Windows

Fixes gohugoio#958

Fix eq and ne tpl function issue

`eq` and `ne` template functions don't work as expected when those are
used with a raw number and a calculated value by add, sub etc. It's
caused by both numbers type differences. For example, `eq 5 (add 2 3)`
returns `false` because raw 5 is `int` while `add 2 3` returns 5 with
`int64`

This normalizes `int`, `uint` and `float` type values to `int64`,
`uint64` and `float64` before comparing them. Other type of value is
passed to comparing function without any changes.

Fix gohugoio#961

Add test cases for Ne and Eq type normalisation

See gohugoio#961

Add new min_version field to theme.toml template

Switch from fsnotify.v0 to fsnotify.v1 API (watcher)

Fixes gohugoio#357
See also gohugoio#761

Do not parse backup files with trailing '~' as templates

Fixes gohugoio#964

absurlreplacer: write replacements directly to the byte buffer

The extra step isn't needed and this makes the code simpler.

And slightly faster:

benchmark              old ns/op     new ns/op     delta
BenchmarkAbsUrl        19987         17498         -12.45%
BenchmarkXmlAbsUrl     10606         9503          -10.40%

benchmark              old allocs     new allocs     delta
BenchmarkAbsUrl        28             24             -14.29%
BenchmarkXmlAbsUrl     14             12             -14.29%

benchmark              old bytes     new bytes     delta
BenchmarkAbsUrl        3512          3297          -6.12%
BenchmarkXmlAbsUrl     2059          1963          -4.66%

parser: add some frontmatter test cases

Skip directories like node_modules from the watchlist

A local `node_modules` directory can easily contain
tens of thousands of files, easily exhausting the tiny
default max open files limit especially on OS X Yosemite,
in spite of the fact that  Hugo already had code in place
since February 2014 to try to raise the maxfiles ulimit.

Also skip `.git` and `bower_components` directories.

The file watching situation will improve when
https://github.com/go-fsnotify/fsevents become ready,
but until then, we will be thrifty.  :-)

Thanks to @chibicode for the suggestion.

See gohugoio#168 for continued discussions.

Add some basic tests for doArithmetic

We might have to take precision into account for floating point nubers ... at some point.

doArithmetic: add test for division by zero

Correct initialisms as suggested by golint

First step to use initialisms that golint suggests,
for example:

    Line 116: func GetHtmlRenderer should be GetHTMLRenderer

as see on http://goreportcard.com/report/spf13/hugo

Thanks to @bep for the idea!

Note that command-line flags (cobra and pflag)
as well as struct fields like .BaseUrl and .Url
that are used in Go HTML templates need more work
to maintain backward-compatibility, and thus
are NOT yet dealt with in this commit.

First step in fixing gohugoio#959.

Remove trailing space from site build statistics

Update press coverage: Fix URL; new tutorial in Chinese

[Docs] Update and expand http://gohugo.io/overview/usage/

The `hugo help` output as shown in http://gohugo.io/overview/usage/
was not yet updated for v0.13. Thanks to @alebaffa for the heads up!

Also:
 - Clarify that, after using `hugo server`, the bare `hugo` command
   need to be run before deployment.
 - Add a section on running `hugo` as production web server,
   and add links to two blog posts of two Hugo users sharing
   their experience.

Partially fixes: gohugoio#852 and gohugoio#937

Add deprecated logger

Add double checking in Deprecated

To prevent possible duplicate log statements.

source: add some test cases for File

Do not ERROR-log missing /data dir

Fixes gohugoio#930

Experimental AsciiDoc support with external helpers

See gohugoio#470

 * Based on existing support for reStructuredText files

 * Handles content files with extensions `.asciidoc` and `.ad`

 * Pipes content through `asciidoctor --safe -`.
   If `asciidoctor` is not installed, then `asciidoc --safe -`.

 * To make sure `asciidoctor` or `asciidoc` is found, after adding
   a piece of AsciiDoc content, run `hugo` with the `-v` flag
   and look for this message:

        INFO: 2015/01/23 Rendering with /usr/bin/asciidoctor ...

Caveats:

 * The final "Last updated" timestamp is currently not stripped.

 * When `hugo` is run with `-v`, you may see a lot of these messages

        INFO: 2015/01/23 Rendering with /usr/bin/asciidoctor ...

   if you have lots of `*.ad`, `*.adoc` or `*.asciidoc` files.

 * Some versions of `asciidoc` may have trouble with its safe mode.
   To test if you are affected, try this:

        $ echo "Hello" | asciidoc --safe -
        asciidoc: ERROR: unsafe: ifeval invalid
        asciidoc: FAILED: ifeval invalid safe document

   If so, I recommend that you install `asciidoctor` instead.

Feedback and patches welcome!

Ideally, we should be using https://github.com/VonC/asciidocgo,
@VonC's wonderful Go implementation of Asciidoctor.  However,
there is still a bit of work needed for asciidocgo to expose
its API so that Hugo can actually use it.

Until then, hope this "experimental AsciiDoc support through external
helpers" can serve as a stopgap solution for our community. :-)

2015-01-30: Updated for the replaceShortcodeTokens() syntax change
2015-02-21: Add `.adoc` extension as suggested by @Fale

Conflicts:
	helpers/content.go

Add Seq template func

Very similar to GNU's seq.

Fixes gohugoio#552

Conflicts:
	tpl/template.go

Added image support to the sitemap.xml template

Conflicts:
	tpl/template_embedded.go

Revert "Added image support to the sitemap.xml template"

This reverts commit 3c147bd.

Fixes gohugoio#972

removed duplicate word in readme

delete finalize files
tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
bep added a commit that referenced this issue Jan 5, 2020
bd0e15bb6 Optimised images with calibre/image-actions
59830ea44 Remove comments from quickstart code samples
348821b5d Remove image-actions
1cbbd26a9 Update index.md
bcf3de764 Update index.md
fcf17e6ef Release 0.62.1
0956bde21 Merge branch 'temp621'
28d604756 releaser: Add release notes to /docs for release of 0.62.1
c895f12e7 Fix statement about version installed with apt-get (#854)
e96928e38 Updated quickstart to split theme download and theme config add into separate blocks (#967)
e099c1ad6 changed ".Title" to ".URL" (#972)
bea71280d Fix small typing error (#1001)
9c28c422e Correct hyperlink for 'markdownify' function
cf3844a06 Corrected small conjugation mistake (#996)
8b9c1d4f2 Added remarks about additional parameters in ref/relref (#995)
ca06c9a56 Fix illegal character in render-link.html example
7a85c789b Update RenderString.md
69df3b17e Update configuration-markup.md
43e9222a2 Revert "Add shortcodes to note comparing with `markdownify`"
2bd5bc2d7 Add shortcodes to note comparing with `markdownify`
ddfee60b7 Update configuration-markup.md
f87c35fe2 docs: Remove extra double quotation
5ca5cc15f Update index.md
6e457f5ec Update configuration-markup.md
12df3c0fc Update configuration-markup.md
91977fd96 Update configuration-markup.md
377b8954a Update configuration-markup.md
99d691b5e Update hosting-on-render.md
ccf855b22 Update index.md
a945acc42 Update index.md
7d4f308d6 Fix Netlify config
f4caa07f5 Release 0.62.0
79d18276f releaser: Add release notes to /docs for release of 0.62.0
9db1a08d1 Merge commit '8a4005cf2b0ef34265ff8051a6b76226685fc226'
79e556223 docs: More on hooks
5088c54df tpl: Do not return any value in errorf
98c8c8638 tpl: Add a warnf template func
4a9d76cea docs: Regen docshelper
626e53b55 Fix incorrect MIME type from image/jpg to image/jpeg
f92f77c5d Preserve HTML Text for link render hooks
6db9c52b1 docs: Footnote
16801db3b Add render template hooks for links and images
0facb823c Merge commit '2e711a28c71e8667258e5ab824f9b9a71c261b0a'
79bf8ed4c markup/tableofcontents: Add config option for ordered list

git-subtree-dir: docs
git-subtree-split: bd0e15bb6063f7ad4f0c47eb33c8c0c23c962d13
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants