Commit graph

1092 commits

Author SHA1 Message Date
bep 6e1b0e0c00 Apply gofmt -s 2015-03-05 23:57:38 +01:00
bep 8557e2cbb8 Add benchmark for the shortcode lexer 2015-03-05 21:11:15 +01:00
Saint Asky ecb2aca6a2 Update github-pages-blog.md
change `hugo serve` to `hugo server`
2015-03-05 01:46:06 -07:00
Steve Francia fb0facefa8 Tidying the Readme a bit more 2015-03-04 09:17:35 -05:00
Steve Francia 6c9bdc2859 Using a smaller Header Image 2015-03-04 09:16:49 -05:00
Steve Francia 8aa646ced2 Fixing image in readme 2015-03-04 09:15:55 -05:00
Steve Francia 1e210a434d Restructure top of Readme.md 2015-03-04 09:15:03 -05:00
Steve Francia fa5cbb2a4a Merge pull request #944 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md
2015-03-04 09:08:03 -05:00
The Gitter Badger 45d962c60a Added Gitter badge 2015-03-04 14:06:38 +00:00
Steve Francia d5cb369556 Update Readme.md with additional contribution guides 2015-03-04 09:01:15 -05:00
bep ab5862cd00 Allow the same shortcode to be used with or without inline content
Fixes #934
2015-03-02 21:49:33 +01:00
bep 241f9f9e46 Improve error message on missing shortcode inner content
Fixes #933
2015-02-28 19:24:30 +01:00
bep 9d80ecb4d8 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 #931
2015-02-28 18:45:02 +01:00
bep 176ce5deab Allow hyphens in shortcode name
Fixes #929
2015-02-27 11:57:23 +01:00
bep 967d001ebe Use osext on GitHub
Fixes #922
2015-02-23 18:12:19 +01:00
Anthony Fok bb13d82677 [Docs] NetBSD and ARM pre-built binaries are already provided
See https://github.com/spf13/hugo/releases

What a pleasant surprise indeed!
How come I have never noticed them before?

And even `.deb` files are provided!  How amazing!
2015-02-21 23:26:34 -07:00
spf13 729a6739f2 Bumping to version "v0.14-DEV" 2015-02-21 23:11:36 -05:00
spf13 e43eabacee Updating the final release notes for v0.13 2015-02-21 22:31:01 -05:00
Anthony Fok 88e7c031a8 [Docs] Clarify the switch to canonifyurls = false as default
Quote from @spf13: "I also think it's the better default
and should continue to be the case going forward."

Also mention the use of `hugo config` to check the current value
of `canonifyurls`, thanks to suggestion by @bep.

Fixes #802
2015-02-21 14:50:14 -07:00
Anthony Fok ac189fd514 Update README.md and overview/installing.md
- Clarify that Hugo may be built wherever Go is available;
- Add links to Git, Mercurial and Go;
- Unlist Bazaar: No libraries that Hugo depends on use it any more;
- Suggest the user to simply run `make` to build `hugo`
  to get `hugo version` to display the commit hash.
2015-02-21 13:42:15 -07:00
bep dc7b7ef865 Avoid race condition in target list init
As reported by Go's race detector.

See #917
2015-02-20 18:38:35 +01:00
bep c33a8528f8 Avoid race condition in isInnerShortcode
As reported by Go's race detector.

See #917
2015-02-20 17:41:37 +01:00
Cyrill Schumacher a3892685bc Add trailing file separator to temp dir
Make sure that the file separator is added to the temp dir in all cases.

This prevents cache temp files being written to the root temp folder.

Fixes #910
2015-02-19 14:16:04 +01:00
bep f0c8585b50 Use $.Paginator in template
Since there will only be one paginator per page, this can get rid of some scoping confusion.
2015-02-19 11:36:09 +01:00
bep 62752cfee9 Return unmodified content if panic in LiveReloadInject 2015-02-18 22:16:40 +01:00
bep 4d708f096d Add revocer in LiveReloadInject
The panic cannot be reproduced, but add this as protection.

Fixes #911
2015-02-18 21:51:32 +01:00
René Jochum d2e022f2a7 Suppress errors for symbolic links witch point to a file. 2015-02-17 19:18:28 -08:00
riboflavin aeddaee901 add note that running with watch doesn't produce a site suitable for deployment 2015-02-17 19:17:38 -08:00
karland e31536dd85 Add information to highlighting with Payments
Conflicts:
	docs/content/extras/highlighting.md
2015-02-17 12:35:39 -05:00
Anthony Fok c4393257e8 Adapt to relative path bug fix in purell
Temporary workaround for the bug fix and resulting
behavioral change in purell.NormalizeURLString():
a leading '/' was inadvertently to relative links,
but no longer, see #878.

I think the real solution is to allow Hugo to
make relative URL with relative path,
e.g. "../../post/hello-again/", as wished by users
in issues #157, #622, etc., without forcing
relative URLs to begin with '/'.
Once the fixes are in, let's remove this kludge
and restore SanitizeUrl() to the way it was.

Fixes #878
2015-02-17 12:31:39 -05:00
Cyrill Schumacher 41c0e82f95 Moved futured getSQL topic to another branch 2015-02-17 12:14:39 -05:00
Cyrill Schumacher b209f44335 getJson and getCsv documentation proof reading by @msjulias 2015-02-17 12:14:39 -05:00
Cyrill Schumacher 4342dd84fc Update Dynamic Content docs 2015-02-17 12:14:39 -05:00
Cyrill Schumacher 48a6d44786 Update doc 2015-02-17 12:14:39 -05:00
Cyrill Schumacher 47b7cfeb44 Add getSQL idea 2015-02-17 12:14:39 -05:00
Cyrill Schumacher fdf8db9c21 Initial doc file: Dynamic Content 2015-02-17 12:14:39 -05:00
Cyrill Schumacher 32d645d900 Fix bug where running hugo without options causes to create
$TMPDIR/hugo_cache/ directory.
2015-02-17 12:14:39 -05:00
Cyrill Schumacher 076b618ff2 GetJson and GetCsv have now variadic URL parts so that you can submit pre or post parts of an URL. The parts will be joined to the final URL. 2015-02-17 12:14:39 -05:00
Cyrill Schumacher 10c2b41b85 Add --ignoreCache CLI flag with description "Ignores the
cache directory for reading but still writes to it" as @spf13
suggested.
2015-02-17 12:14:39 -05:00
Cyrill Schumacher c168666b6d Adding getJson and getCsv to funcMap 2015-02-17 12:14:39 -05:00
Cyrill Schumacher 41a5168198 Fix bug on windows where the backslash got removed in func MakePath() 2015-02-17 12:14:39 -05:00
Cyrill Schumacher 5e2d3d2e10 Merge to stay up to date with current dev
Feature: GetJson and GetJson in short codes or other layout files.
For more details please see: http://cyrillschumacher.com/2014/12/21/dynamic-pages-with-gohugo.io/
2015-02-17 12:14:39 -05:00
Anthony Fok 9bf223e584 Quote strings in hugo config output
Also, use ` = ` to separate keys and values
if metaformatdata is "toml".
2015-02-17 11:51:43 +01:00
Anthony Fok 82a0888995 Revert "Expansion of unit tests for utils/utils.go"
Rationale: Test failing on Windows with errors like this:

    utils_test.go:177: Error: Could not remove file "f".
    Error: remove C:\Users\appveyor\AppData\Local\Temp\utils_test_747965610:
    The process cannot access the file because it is being used by another
    process.

This reverts commit 6b28e38cea.

Sorry for my premature merge of Pull Request #818.
2015-02-17 03:35:23 -07:00
bep c2e2913872 Fix canonifyurl vs schemaless links
And looks even faster:

Compared to previous attempt:

benchmark              old ns/op     new ns/op     delta
BenchmarkAbsUrl        30902         27206         -11.96%
BenchmarkXmlAbsUrl     15389         14216         -7.62%

benchmark              old allocs     new allocs     delta
BenchmarkAbsUrl        33             28             -15.15%
BenchmarkXmlAbsUrl     16             14             -12.50%

benchmark              old bytes     new bytes     delta
BenchmarkAbsUrl        4167          3504          -15.91%
BenchmarkXmlAbsUrl     2057          2048          -0.44%

Compared to before I started all of this:

benchmark              old ns/op     new ns/op     delta
BenchmarkAbsUrl        36219         27206         -24.88%
BenchmarkXmlAbsUrl     23903         14216         -40.53%

benchmark              old allocs     new allocs     delta
BenchmarkAbsUrl        60             28             -53.33%
BenchmarkXmlAbsUrl     30             14             -53.33%

benchmark              old bytes     new bytes     delta
BenchmarkAbsUrl        5842          3504          -40.02%
BenchmarkXmlAbsUrl     3754          2048          -45.44%

Fixes #816
2015-02-17 11:07:24 +01:00
Owen Waller 6b28e38cea Expansion of unit tests for utils/utils.go
This commit expands the test coverage for the utils/utils.go module.

The utils module uses the 'github.com/spf13/jwalterweatherman' (aka jww)
package for logging. The tests take the approach of examining the log
file that is produced by this module to verify correct behaviour. This
avoids refactoring the utils module.

The log file messages written by the jww module are of the form:
<log level>: yyyy/mm/dd <string|error message>

The checkLogFile function checks each of these parts in turn except for
the date string, which is currently ignored. The final part of the log
file format can either be a single error message, or a series of
strings followed by an error message. Both the error message and the
series of strings can be empty strings.

The log file is checked using a combination of the regex package,
along with the bufio scanner type. Each test logs to its own temporary
log file. This is achieved with standard test setup and teardown
functions.

One consequence of these tests is that StopOnErr has been refactored
into call a new unexported function doStopOnErr which contains the bulk
of the original logic. This allows the same testing approach to be used
with StopOnErr as with CheckErr and cutUsageMessage, rather than look at
the exit status code of the test itself.

An unfortunate side effect of this is that the author of the tests must
now know if a log file is expected or not. If doStopOnErr determines
that an empty error message would be written to the log file then
nothing is written. In the context of the tests this means that the log
file created by the test would have no contents. Consequently there
would be nothing for the test to examine. This situation is indicated by
the boolean flag logFileExoected in the testData struct, and processed
by the logFileIsExpectedAndValid function.

Although not ideal this was deemed a reasonable compromise.
2015-02-17 02:20:00 -07:00
Anthony Fok cb9fa62743 [Docs] Minor copyediting of highlighting.md
Also add `apt-get` command for installing Pygments.
2015-02-17 01:59:40 -07:00
karland bd0de85dbc Add information to highlighting with Pygments 2015-02-17 01:49:44 -07:00
karland 1827680bea List of variables
Some variables are currently not documented and others are explained
across the document. So, I tried to pull an overview from the source.
Pls double check. I am not 100% sure, what the purpose of some variables
is or whether they are only relevant for previous versions. Thanks
2015-02-17 01:28:20 -07:00
Maxime Michel 09ed3c4b92 Fixed a typo 2015-02-17 01:16:41 -07:00