Commit graph

454 commits

Author SHA1 Message Date
Max Rydahl Andersen aee2b06780 Add --debug option to be improved on over time
Why:

 * first time using hugo I got very little info from --verbose output
   but I noticed there is quite a lot of useful DEBUG logging
 * asked for in other issues like https://github.com/gohugoio/hugo/issues/3514

This change addreses the need by:

 * adding a simple --debug flag which simply turns on debug level in stdout
   and logoutput if enabled.
2017-07-27 22:36:22 +02:00
Bjørn Erik Pedersen 91f410ea90 Bump versions to 0.26-DEV 2017-07-10 09:16:02 +02:00
Bjørn Erik Pedersen aded65b71d releaser: Prepare repository for 0.25-DEV
[ci skip]
2017-07-10 09:02:20 +02:00
Bjørn Erik Pedersen 0e09be7b3c releaser: Bump versions for release of 0.25.1
[ci skip]
2017-07-10 08:57:34 +02:00
Vasiliy Solovey 7bcc1ce659 commands: Navigate to changed on CREATE
When working with content from IntelliJ IDE,
like WebStorm, every file save is followed by
two events: "RENAME" and then "CREATE".
2017-07-08 09:37:24 +02:00
Bjørn Erik Pedersen 6e086e3d03 releaser: Bump versions for release of 0.25
[ci skip]
2017-07-07 09:23:54 +02:00
Bjørn Erik Pedersen 75f782f035 Revert "commands: Adjust docs path"
This reverts commit 729be8074b.
2017-07-06 10:34:04 +02:00
Bjørn Erik Pedersen 5f831a6223 releaser: Replace the magic version handling
Take the new version as a string value.
2017-07-05 14:27:43 +02:00
Bjørn Erik Pedersen e7a54e7afc releaser: Add --try flag to ease testing 2017-07-05 14:27:43 +02:00
Victor Kropp 1039356edf commands: Support human-readable YAML boolean values in undraft 2017-07-03 23:26:01 +02:00
coderzh 7ee1f25e9e hugo import jekyll support nested _posts directories
Fixes #1890
Closes #1911
2017-07-01 10:15:22 +02:00
Anthony Fok 30e14cc316 Make --navigateToChanged more robust on Windows
This ensures the new "open 'current content page' in browser" works
on Windows, especially with Emacs and Vim.

Special thanks to @bep for coming up with the idea of the fix.

See #3645
2017-06-27 11:45:54 +02:00
Bjørn Erik Pedersen c825a73121 Support open "current content page" in browser
This commit adds a new `--navigateToChanged` and config setting with the same name, that, when running the Hugo server with live reload enabled, will navigate to the current content file's URL on save. 

This is really useful for site-wide content changes (copyedits etc.).
Fixes #3643
2017-06-26 21:34:16 +02:00
Anthony Fok aff1ac3235 commands: Use example.com as homepage for new theme
The fictional siteforthistheme.com domain has been
squatted by Afternic of GoDaddy since November 2016...
2017-06-26 12:38:45 -06:00
Bjørn Erik Pedersen fd924d1802 commands: Create default archetype on new site
See #3626
2017-06-22 22:00:42 +02:00
Bjørn Erik Pedersen 8f69fe57a4 releaser: Bump versions for release of 0.24
[ci skip]
2017-06-21 13:52:27 +02:00
Bjørn Erik Pedersen 662e12f348 commands, create: Add .Site to the archetype templates
This commit completes the "The Revival of the Archetypes!"

If `.Site` is used in the arcetype template, the site is built and added to the template context.

Note that this may be potentially time consuming for big sites.

A more complete example would then be for the section `newsletter` and the archetype file `archetypes/newsletter.md`:

```
---
title: "{{ replace .TranslationBaseName "-" " " | title }}"
date: {{ .Date }}
tags:
- x
categories:
- x
draft: true
---

<!--more-->

{{ range first 10 ( where .Site.RegularPages "Type" "cool" ) }}
* {{ .Title }}
{{ end }}
```

And then create a new post with:

```bash
hugo new newsletter/the-latest-cool.stuff.md
```

**Hot Tip:** If you set the `newContentEditor` configuration variable to an editor on your `PATH`, the newly created article will be opened.

The above _newsletter type archetype_ illustrates the possibilities: The full Hugo `.Site` and all of Hugo's template funcs can be used in the archetype file.

Fixes #1629
2017-06-19 10:47:00 +02:00
Bjørn Erik Pedersen 422057f607 create: Use archetype template as-is as a Go template
This commit removes the fragile front matter decoding, and takes the provided archetype file as-is and processes it as a template.

This also means that we no longer will attempt to fill in default values for `title` and `date`.

The upside is that it is now easy to create these values in a dynamic way:

```toml
+++
title = {{ .BaseFileName | title }}
date = {{ .Date }}
draft = true
+++
```

You can currently use all of Hugo's template funcs, but the data context is currently very shallow:

* `.Type` gives the archetype kind provided
* `.Name` gives the target file name without extension.
* `.Path` gives the target file name
* `.Date` gives the current time as RFC3339 formatted string

The above  will probably be extended in #1629.

Fixes #452
Updates #1629
2017-06-18 19:06:28 +02:00
Bjørn Erik Pedersen b502b9d8cc releaser: Bump versions for release of 0.23
[ci skip]
2017-06-16 09:41:39 +02:00
Bjørn Erik Pedersen 729be8074b commands: Adjust docs path 2017-06-14 10:37:58 +02:00
Bjørn Erik Pedersen 873a6f1885 Run gofmt to get imports in line vs gohugoio/hugo 2017-06-13 19:12:10 +02:00
Bjørn Erik Pedersen c17ad675e8 all: Update textual references in Go source to point to gohugoio/hugo 2017-06-13 18:47:17 +02:00
Bjørn Erik Pedersen d8717cd4c7 all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
Bjørn Erik Pedersen 2aafb24766 Revert "releaser: Bump versions for release of 0.22.1"
This reverts commit dce70fb7c5.
2017-06-13 14:26:56 +02:00
Bjørn Erik Pedersen 4bd5ce7ef3 releaser: Prepare repository for 0.23-DEV 2017-06-13 14:25:19 +02:00
Bjørn Erik Pedersen 0f78dd06a4 releaser: Prepare repository for 0.22.1-DEV
[ci skip]
2017-06-13 14:22:14 +02:00
Bjørn Erik Pedersen dce70fb7c5 releaser: Bump versions for release of 0.22.1
[ci skip]
2017-06-13 14:17:15 +02:00
Bjørn Erik Pedersen ff54b6bddc commands: Adjust rlimit to 64000
See #3582
2017-06-12 20:43:19 +02:00
Bjørn Erik Pedersen 629e1439e8 commands: Make error on setting rlimit a warning only
And reduce it to 10000.

Closes #3582
2017-06-12 20:35:19 +02:00
Bjørn Erik Pedersen 26aa06a3db Revert "commands: Remove the rlimit tweaking on macOS"
This reverts commit bcd32f1086.

See #3582
2017-06-12 20:35:19 +02:00
Bjørn Erik Pedersen 21cf464c1f releaser: Bump versions for release of 0.22
[ci skip]
2017-06-12 09:01:59 +02:00
Bjørn Erik Pedersen fe901b8119 hugolib, commands: Improve live-reload on directory structure changes
This issue is more visible now that we support nested sections.

This commit makes operations like pasting new content folders or deleting content folders during server watch just work.

Fixes #3570
2017-06-08 20:14:28 +02:00
Bjørn Erik Pedersen 0907a5c1c2 all: Temporarily revert to BurntSushi for TOML front matter handling
We still have go-toml as a transitive dependency, and it is the way to go eventually, but we care about speed, so let us wait that one out.

Note that the issue this fixes is about taxonomies, but I guess this is a general issue for sites with many pages that uses TOML as front matter.

```
benchmark                              old ns/op     new ns/op     delta
BenchmarkFrontmatterTags/TOML:1-4      23206         8543          -63.19%
BenchmarkFrontmatterTags/TOML:11-4     80117         18495         -76.92%
BenchmarkFrontmatterTags/TOML:21-4     140676        28727         -79.58%

benchmark                              old allocs     new allocs     delta
BenchmarkFrontmatterTags/TOML:1-4      173            60             -65.32%
BenchmarkFrontmatterTags/TOML:11-4     625            138            -77.92%
BenchmarkFrontmatterTags/TOML:21-4     1106           210            -81.01%

benchmark                              old bytes     new bytes     delta
BenchmarkFrontmatterTags/TOML:1-4      9231          2912          -68.45%
BenchmarkFrontmatterTags/TOML:11-4     19808         5184          -73.83%
BenchmarkFrontmatterTags/TOML:21-4     31200         7536          -75.85%
```

See #3541
Updates #3464
2017-06-03 09:22:57 +02:00
Albert Nigmatzianov 421a46947a cmd: Replace flagChanged with pflag.FlagSet.Changed 2017-05-24 10:51:51 +02:00
Bjørn Erik Pedersen bcd32f1086 commands: Remove the rlimit tweaking on macOS
Fixes #3512
2017-05-23 18:52:00 +03:00
Bjørn Erik Pedersen 1a965e5d2f releaser: Bump versions for release of 0.21
[ci skip]
2017-05-22 16:09:42 +03:00
Albert Nigmatzianov 94b5be67fc commands: Skip .git directories
Fix #3468
2017-05-15 14:38:04 +03:00
Bjørn Erik Pedersen 5794a265b4 commands, hugolib: Deprecate disable404, disableRSS, disableSitemap, disableRobotsTXT
Use disableKinds instead.

Fixes #3345
2017-05-10 20:00:08 +02:00
Albert Nigmatzianov 9b2028626e commands: Use paths from PathSpec for walker 2017-05-09 14:07:43 +02:00
Albert Nigmatzianov f0f69d03c5 commands: Make first letter of flags' usage lowercase 2017-04-26 22:23:20 +02:00
Bjørn Erik Pedersen 7f6430d84d Automate the Hugo release process
This commit adds a work flow aroung GoReleaser to get the Hugo release process automated and more uniform:

* It can be run fully automated or in two steps to allow for manual edits of the relase notes.
* It supports both patch and full releases.
* It fetches author, issue, repo info. etc. for the release notes from GitHub.
* The file names produced are mainly the same as before, but we no use tar.gz as archive for all Unix versions.
* There isn't a fully automated CI setup in place yet, but the release tag is marked in the commit message with "[ci deploy]"

Fixes #3358
2017-04-24 11:08:56 +02:00
Stefan Buynov 5f3ad1c319 commands: Import Octopress image tag in Jekyll importer 2017-04-22 22:35:52 +02:00
Bjørn Erik Pedersen dac0d4a69d all: Prepare Hugo 0.20 release version 2017-04-10 09:10:53 +02:00
Bjørn Erik Pedersen 7b2e1b0be9 hubolib: Do not add missing trailing slash to command line baseURL
This makes it consistent with how it behaves when it's set in config.toml.

This commit also unifies BaseURL in Site.Info so we now have one source for this value.

Fixes #3262
2017-04-07 20:18:31 +02:00
Bjørn Erik Pedersen 3c405f5172 all: Document the Output Formats feature
This commit also adds a new command, docshelper, with some utility funcs that adds a JSON datafiles to /docs/data that would be a pain to create and maintain by hand.

Fixes #3242
2017-04-07 10:52:16 +02:00
Bjørn Erik Pedersen c4a1165587 all: Handle all errors
As reported by `errcheck`.
2017-04-06 20:35:26 +02:00
Bjørn Erik Pedersen a883948c4f Register all media types when in server mode
Fixes #3274
2017-04-04 18:05:19 +02:00
Bjørn Erik Pedersen 04d80e6e87 commands, helpers: Add correct verbose log level to the global loggers
We still use those in some cases.
2017-04-04 15:12:30 +02:00
Bjørn Erik Pedersen ee4a33b14f commands: Fix broken commandeer 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 15b64d51da all: Propagate baseURL error to the callers 2017-03-27 15:43:56 +02:00