Commit graph

647 commits

Author SHA1 Message Date
Bjørn Erik Pedersen
e26a8b242a
commands: Make the list commands non-global
See #4598
2018-04-11 09:48:56 +02:00
Bjørn Erik Pedersen
2a2c983867
commands: Make the import commands non-global
See #4598
2018-04-11 09:48:56 +02:00
Bjørn Erik Pedersen
15b1e269ad
comands: Make the config command non-global
See #4598
2018-04-11 09:48:56 +02:00
Bjørn Erik Pedersen
56a1308044
commands: Make the new commands non-global
See #4598
2018-04-11 09:48:56 +02:00
Bjørn Erik Pedersen
4b780ca778
commands: Make convert command non-global
See #4598
2018-04-11 09:48:56 +02:00
Bjørn Erik Pedersen
7bc5e89fba
commands: Make more commands non-global
See #4598
2018-04-11 09:48:56 +02:00
Bjørn Erik Pedersen
fdf1d94ebc
commands: Make benchmark non-global
See #4598
2018-04-11 09:48:56 +02:00
Bjørn Erik Pedersen
1157fef859
commands: Start of flag cleaning
See #4598
2018-04-11 09:48:55 +02:00
Bjørn Erik Pedersen
e614d8a57c
commands: Use short date format in CLI docs
To make it possible to compare the output.

See #4598
2018-04-11 09:48:34 +02:00
hugoreleaser
d7f47b780c releaser: Prepare repository for 0.39-DEV
[ci skip]
2018-04-09 08:19:32 +00:00
hugoreleaser
62e7588262 releaser: Bump versions for release of 0.38.2
[ci skip]
2018-04-09 08:17:14 +00:00
Bjørn Erik Pedersen
719251c1af
Bump the debouncer dependency
No practical difference.
2018-04-08 10:20:39 +02:00
Bjørn Erik Pedersen
080302eb87
Fix handling of --contentDir etc. flag
We need to revisit the commands package re globals and tests, but this should fix the init order of flags and languages.

Fixes #4589
2018-04-07 16:40:45 +02:00
hugoreleaser
e7d87e2410 releaser: Prepare repository for 0.39-DEV
[ci skip]
2018-04-05 16:39:05 +00:00
hugoreleaser
3a96fa40bf releaser: Bump versions for release of 0.38.1
[ci skip]
2018-04-05 16:35:25 +00:00
Bjørn Erik Pedersen
730b66b652
commands: Handle mass content etc. edits in server mode
Fixes #4563
2018-04-04 09:29:59 +02:00
hugoreleaser
20e9c08e1f releaser: Bump versions for release of 0.38
[ci skip]
2018-04-02 11:03:32 +00:00
Bjørn Erik Pedersen
eb42774e58
Add support for a content dir set per language
A sample config:

```toml
defaultContentLanguage = "en"
defaultContentLanguageInSubdir = true

[Languages]
[Languages.en]
weight = 10
title = "In English"
languageName = "English"
contentDir = "content/english"

[Languages.nn]
weight = 20
title = "På Norsk"
languageName = "Norsk"
contentDir = "content/norwegian"
```

The value of `contentDir` can be any valid path, even absolute path references. The only restriction is that the content dirs cannot overlap.

The content files will be assigned a language by

1. The placement: `content/norwegian/post/my-post.md` will be read as Norwegian content.
2. The filename: `content/english/post/my-post.nn.md` will be read as Norwegian even if it lives in the English content folder.

The content directories will be merged into a big virtual filesystem with one simple rule: The most specific language file will win.
This means that if both `content/norwegian/post/my-post.md` and `content/english/post/my-post.nn.md` exists, they will be considered duplicates and the version inside `content/norwegian` will win.

Note that translations will be automatically assigned by Hugo by the content file's relative placement, so `content/norwegian/post/my-post.md` will be a translation of `content/english/post/my-post.md`.

If this does not work for you, you can connect the translations together by setting a `translationKey` in the content files' front matter.

Fixes #4523
Fixes #4552
Fixes #4553
2018-04-02 08:06:21 +02:00
Bjørn Erik Pedersen
e9c7b6205f
Allow themes to define output formats, media types and params
This allows a `config.toml` (or `yaml`, ´yml`, or `json`)  in the theme to set:

1) `params` (but cannot override params in project. Will also get its own "namespace", i.e. `{{ .Site.Params.mytheme.my_param }}` will be the same as `{{ .Site.Params.my_param }}` providing that the main project does not define a param with that key.
2) `menu` -- but cannot redefine/add menus in the project. Must create its own menus with its own identifiers.
3) `languages` -- only `params` and `menu`. Same rules as above.
4) **new** `outputFormats`
5) **new** `mediaTypes`

This should help with the "theme portability" issue and people having to copy and paste lots of setting into their projects.

Fixes #4490
2018-03-21 09:22:19 +01:00
Bjørn Erik Pedersen
3d1a6e109c
hugolib: Add ConfigSourceDescriptor
To prepare for config in themes

See #4490
2018-03-20 21:30:43 +01:00
Bjørn Erik Pedersen
b6798ee867
Bump some deprecations 2018-03-20 21:13:44 +01:00
Bjørn Erik Pedersen
f0052b6d0f
commands: Recover from error in server
Issue introduced some days ago.

Fixes #4516
2018-03-18 12:54:06 +01:00
hugoreleaser
9ac6206584 releaser: Prepare repository for 0.38-DEV
[ci skip]
2018-03-07 17:58:48 +00:00
hugoreleaser
c29a2ed2f5 releaser: Bump versions for release of 0.37.1
[ci skip]
2018-03-07 17:56:23 +00:00
Bjørn Erik Pedersen
50a03a5acc
commands: Do not print build total when --quiet is set
Fixes #4456
2018-02-27 21:04:39 +01:00
hugoreleaser
1f1c562b9c releaser: Bump versions for release of 0.37
[ci skip]
2018-02-27 09:15:23 +00:00
Bjørn Erik Pedersen
55bd46a633
commands: Remove ERROR on missing baseURL
That logic fails in multi-host mode when no baseURL is set on top level.

Fixes #4397
2018-02-21 10:30:00 +01:00
Bjørn Erik Pedersen
772128485a Run gofmt -s with Go 1.10
See #4434
2018-02-21 09:59:33 +01:00
hugoreleaser
4bc8727fc6 releaser: Bump versions for release of 0.36
[ci skip]
2018-02-05 15:22:26 +00:00
hugoreleaser
58188807aa releaser: Bump versions for release of 0.35
[ci skip]
2018-01-31 10:44:41 +00:00
Bjørn Erik Pedersen
feeed073c3
commands: Remove some now superflous Fast Render Mode code
Updates #4339
2018-01-30 10:49:24 +01:00
Robert Basic
2fa70c9344 command: Remove undraft command
According to @bep, it is easier to undraft content by
editing manually the frontmatter of said content by
setting the draft flag to `false`, or removing it completely,
than to rely on the undraft command which is a source of
many bugs.

Fixes #4353
2018-01-29 16:56:35 +01:00
Bjørn Erik Pedersen
b6f3f087aa
commands: Mark deprecated flags in the CLI help
See #4347
2018-01-29 14:07:46 +01:00
Bjørn Erik Pedersen
f08ea02d24
commands: Deprecate CLI flags canonifyURLs, pluralizeListTitles, preserveTaxonomyNames, uglyURLs
You can of course still set them in site config.

Fixes #4347
2018-01-28 17:22:08 +01:00
Colin Seymour
3752348ef1 Only set 'url' if permalink in metadata and remove duplicate confirm msg
The current behaviour addes a `url` attribute to the frontmatter of all posts imported from Jeklly and assumes the desired permalink structure is /:year/:month/:day/:title/. This may be the case for most peeps, but poses a problem for those that don't use this permalink structure as the `url` attribute takes precedence over the `permalink` attribute in the site-wide configuration meaning it can't be overruled.

This changes the behaviour to only set the `url` attribute if the `permalink` attribute is set in the Jekyll frontmatter.

The duplication of the confirmation message is also removed.

Tests have been updated to reflect this change in behaviour.

Fixes #1887
2018-01-28 11:24:31 +01:00
Bjørn Erik Pedersen
ed4a00e46f
commands: Fix baseURL server regression for multilingual sites
This was introduced in 6413559f75 a couple of days ago, and demonstrates that we really need better tests for the server/commands package.

Fixes #4333
2018-01-27 10:58:30 +01:00
Bjørn Erik Pedersen
6413559f75 Add a way to disable one or more languages
This commit adds a new config setting:

```toml
disableLanguages = ["fr"]
```

If this is a multilingual site:

* No site for the French language will be created
* French content pages will be ignored/not read
* The French language configuration (menus etc.) will also be ignored

This makes it possible to start translating new languages and turn it on when you're happy etc.

Fixes #4297
Fixed #4329
2018-01-26 14:04:14 +01:00
Vas Sudanagunta
91bb774ae4 Support pages without front matter
* Page without front matter now treated same as a page with empty front matter.
* Test cases added to cover this and repro issue #4320.
* Type safety of front matter code improved.

Fixes #4320
2018-01-26 09:17:27 +01:00
Bjørn Erik Pedersen
d418c2c2ea
Remove and update deprecation status 2018-01-25 10:22:11 +01:00
hugoreleaser
2228d3e289 releaser: Bump versions for release of 0.34
[ci skip]
2018-01-22 12:06:38 +00:00
hugoreleaser
c6b9037294 releaser: Bump versions for release of 0.33
[ci skip]
2018-01-18 10:13:30 +00:00
Bjørn Erik Pedersen
d4f8f88e67
commands: And now really fix the server watch logic
See #4275
2018-01-15 10:02:17 +01:00
Bjørn Erik Pedersen
4e524ffcff
commands: Fix server without watch
This was broken in Hugo 0.30.

Fixes #4275
2018-01-14 20:58:52 +01:00
Bjørn Erik Pedersen
13d53b31f1
commands: Remove superflous BuildDate logic
Fixes #4272
2018-01-14 20:08:28 +01:00
hugoreleaser
27c77e1ab9 releaser: Prepare repository for 0.33-DEV
[ci skip]
2018-01-11 09:00:51 +00:00
hugoreleaser
a97ef61bad releaser: Bump versions for release of 0.32.4
[ci skip]
2018-01-11 08:58:01 +00:00
Alexander Borsuk
5235a5bf5e Correct fix for --cleanDestinationDir flag
Fixes #4246
Fixes #4248
2018-01-10 18:26:42 +01:00
Alexander Borsuk
1921a70ab1 Revert "Remove the --cleanDestinationDir flag", there is a better fix.
This reverts commit 768ec5df9f.
2018-01-10 18:26:42 +01:00
Bjørn Erik Pedersen
768ec5df9f
Remove the --cleanDestinationDir flag
This is no longer supported. Since Hugo 0.32 we do static sync and build in parallel.

Closes #4246
2018-01-10 09:34:40 +01:00
hugoreleaser
238e7f7fbe releaser: Prepare repository for 0.33-DEV
[ci skip]
2018-01-08 11:12:41 +00:00
hugoreleaser
fdec5e3084 releaser: Bump versions for release of 0.32.3
[ci skip]
2018-01-08 11:10:08 +00:00
Bjørn Erik Pedersen
6feb138785
commands: Report build time on config.toml change
Fixes #4232
See #4224
2018-01-06 10:54:16 +01:00
Bjørn Erik Pedersen
059e8458d6
Fix hugo benchmark --renderToMemory
Fixes #4218
2018-01-06 10:37:04 +01:00
hugoreleaser
54a89cde69 releaser: Prepare repository for 0.33-DEV
[ci skip]
2018-01-03 09:56:18 +00:00
hugoreleaser
865877cd05 releaser: Bump versions for release of 0.32.2
[ci skip]
2018-01-03 09:54:04 +00:00
hugoreleaser
3dd8c1c026 releaser: Prepare repository for 0.33-DEV
[ci skip]
2018-01-02 09:10:11 +00:00
hugoreleaser
54ef60b03a releaser: Bump versions for release of 0.32.1
[ci skip]
2018-01-02 09:07:55 +00:00
Bjørn Erik Pedersen
d36d71edd3
commands: Fix broken hugo --renderToMemory
The `--renderToMemory` flag stopped working on `hugo` in 0.32.

Note that this is only useful for benchmark testing, as there is no easy way to actually view the result.

Fixes #4212
2018-01-02 09:40:58 +01:00
hugoreleaser
82db039436 releaser: Bump versions for release of 0.32
[ci skip]
2017-12-31 09:24:45 +00:00
Bjørn Erik Pedersen
72903be587
commands: Make sure all language homes are always re-rendered in fast render mode
Fixes #4125
2017-12-29 09:37:37 +01:00
Bjørn Erik Pedersen
3cdf19e9b7
Implement Page bundling and image handling
This commit is not the smallest in Hugo's history.

Some hightlights include:

* Page bundles (for complete articles, keeping images and content together etc.).
* Bundled images can be processed in as many versions/sizes as you need with the three methods `Resize`, `Fill` and `Fit`.
* Processed images are cached inside `resources/_gen/images` (default) in your project.
* Symbolic links (both files and dirs) are now allowed anywhere inside /content
* A new table based build summary
* The "Total in nn ms" now reports the total including the handling of the files inside /static. So if it now reports more than you're used to, it is just **more real** and probably faster than before (see below).

A site building  benchmark run compared to `v0.31.1` shows that this should be slightly faster and use less memory:

```bash
▶ ./benchSite.sh "TOML,num_langs=.*,num_root_sections=5,num_pages=(500|1000),tags_per_page=5,shortcodes,render"

benchmark                                                                                                         old ns/op     new ns/op     delta
BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4      101785785     78067944      -23.30%
BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4     185481057     149159919     -19.58%
BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4      103149918     85679409      -16.94%
BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4     203515478     169208775     -16.86%

benchmark                                                                                                         old allocs     new allocs     delta
BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4      532464         391539         -26.47%
BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4     1056549        772702         -26.87%
BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4      555974         406630         -26.86%
BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4     1086545        789922         -27.30%

benchmark                                                                                                         old bytes     new bytes     delta
BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4      53243246      43598155      -18.12%
BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4     105811617     86087116      -18.64%
BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4      54558852      44545097      -18.35%
BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4     106903858     86978413      -18.64%
```

Fixes #3651
Closes #3158
Fixes #1014
Closes #2021
Fixes #1240
Updates #3757
2017-12-27 18:44:47 +01:00
hugoreleaser
8a8ba63c7e releaser: Prepare repository for 0.32-DEV
[ci skip]
2017-11-27 11:27:33 +00:00
hugoreleaser
aa68205d16 releaser: Bump versions for release of 0.31.1
[ci skip]
2017-11-27 11:26:08 +00:00
Bjørn Erik Pedersen
8afd7d9ceb commands: Fix broken --appendPort=false
Also make sure to log the correct server URL to the console.

Fixes #4111
2017-11-24 11:29:01 +01:00
hugoreleaser
f4b416bbef releaser: Bump versions for release of 0.31
[ci skip]
2017-11-20 10:28:21 +00:00
Bjørn Erik Pedersen
60dfb9a6e0 Add support for multiple staticDirs
This commit adds support for multiple statDirs both on the global and language level.

A simple `config.toml` example:

```bash
staticDir = ["static1", "static2"]
[languages]
[languages.no]
staticDir = ["staticDir_override", "static_no"]
baseURL = "https://example.no"
languageName = "Norsk"
weight = 1
title = "På norsk"

[languages.en]
staticDir2 = "static_en"
baseURL = "https://example.com"
languageName = "English"
weight = 2
title = "In English"
```

In the above, with no theme used:

the English site will get its static files as a union of "static1", "static2" and "static_en". On file duplicates, the right-most version will win.
the Norwegian site will get its static files as a union of "staticDir_override" and "static_no".

This commit also concludes the Multihost support in #4027.

Fixes #36
Closes #4027
2017-11-17 11:01:46 +01:00
Bjørn Erik Pedersen
2e0465764b Add multilingual multihost support
This commit adds multihost support when more than one language is configured and `baseURL` is set per language.

Updates #4027
2017-11-17 11:01:46 +01:00
Bjørn Erik Pedersen
bb048d811d
Use ms precision for static change logging 2017-11-15 08:52:29 +01:00
hugoreleaser
1d52bfbb47 releaser: Prepare repository for 0.31-DEV
[ci skip]
2017-10-19 11:35:38 +00:00
hugoreleaser
bf633ea2f2 releaser: Bump versions for release of 0.30.2
[ci skip]
2017-10-19 11:34:09 +00:00
Bjørn Erik Pedersen
3164103310
commands: Support Fast Render mode with sub-path in baseURL
Fixes #3981
2017-10-19 10:09:04 +02:00
hugoreleaser
bc53cd7b15 releaser: Prepare repository for 0.31-DEV
[ci skip]
2017-10-19 05:43:34 +00:00
hugoreleaser
89a3f47a21 releaser: Bump versions for release of 0.30.1
[ci skip]
2017-10-19 05:41:50 +00:00
Bjørn Erik Pedersen
fa53b13ca0
Fix hugo -w
Fixes #3980
2017-10-18 18:35:25 +02:00
hugoreleaser
811f381e23 releaser: Bump versions for release of 0.30
[ci skip]
2017-10-16 08:39:00 +00:00
Bjørn Erik Pedersen
60bd332c1f Only re-render the view(s) you're working on
Hugo already, in its server mode,  support partial rebuilds. To put it simply: If you change `about.md`, only that content page is read and processed, then Hugo does some processing (taxonomies etc.) and the full site is rendered.
This commit covers the rendering part: We now only re-render the pages you work on, i.e. the last n pages you watched in the browser (which obviously also includes the  page in the example above).

To be more specific: When you are running the hugo server in watch (aka. livereload) mode, and change a template or a content file, then we do a partial re-rendering of the following:

* The current content page (if it is a content change)
* The home page
* Up to the last 10 pages you visited on the site.

This should in most cases be enough, but if you navigate to something completely different, you may see stale content. Doing an edit will then refresh that page.

Note that this feature is enabled by default. To turn it off, run `hugo server --disableFastRender`.

Fixes #3962
See  #1643
2017-10-14 13:40:43 +02:00
Michael Henderson
15ec031d98 Add correct config file name to verbose server log
Server logging uses the wrong variable when displaying
the configuration file name. This update changes the
log to use the `config` variable.
2017-10-10 07:47:35 +02:00
Bjørn Erik Pedersen
5800a20a25 metrics: Detect partialCached candidates
This commit adds a "cache potential" column when running `hugo --templateMetrics --templateMetricsHints`.

This is only calculated when `--templateMetricsHints` is set, as these calculations has an negative effect on the other timings.

This gives a value for partials only, and is a number between 0-100 that indicates if `partial` can be replaced with `partialCached`.

100 means that all execution of the same partial resulted in the same output.

You should do  some manual research before going "all cache".
2017-10-07 18:00:07 +02:00
hugoreleaser
396759a09b releaser: Bump versions for release of 0.29
[ci skip]
2017-09-26 19:23:15 +00:00
Cameron Moore
b4a14c25fe metrics: Add simple template metrics feature 2017-09-26 20:03:04 +02:00
Bjørn Erik Pedersen
e94d4f0177 commands: Make noHTTPCache default false
The other way was a mistake.
2017-09-26 19:59:15 +02:00
hugoreleaser
9e850c1f64 releaser: Bump versions for release of 0.28
[ci skip]
2017-09-25 07:59:12 +00:00
Bjørn Erik Pedersen
fb33d8286d Use Chroma as new default syntax highlighter
If you want to use Pygments, set `pygmentsUseClassic=true` in your site config.

Fixes #3888
2017-09-25 08:59:02 +02:00
Bjørn Erik Pedersen
80c7ea60a0 Make noHTTPCache default on
This is a development server, so that makes the most sense.

See #3897
2017-09-23 21:17:51 +02:00
Bjørn Erik Pedersen
b180477631 Add liveReloadPort flag to server
This makes live reloading behind a HTTPS proxy working, as in the example below using the service from https://ngrok.com:

```
hugo server -b https://ba6sdfe72.ngrok.io --appendPort=false --liveReloadPort=443 --navigateToChanged
```

Fixes #3882
2017-09-23 17:08:48 +02:00
Bjørn Erik Pedersen
173b544982 commands: Remove superflous space 2017-09-22 20:05:19 +02:00
Bjørn Erik Pedersen
df411ec81a commands: Rename noHttpCache to noHTTPCache 2017-09-22 17:23:15 +02:00
Bjørn Erik Pedersen
0b34af2161 Add noHttpCache to hugo server
Fixes #3897
2017-09-22 17:13:21 +02:00
hugoreleaser
5c3b210368 releaser: Prepare repository for 0.28-DEV
[ci skip]
2017-09-13 13:13:28 +02:00
hugoreleaser
18126434f1 releaser: Bump versions for release of 0.27.1
[ci skip]
2017-09-13 11:03:59 +00:00
hugoreleaser
828eb70fa6 releaser: Bump versions for release of 0.27
[ci skip]
2017-09-11 05:32:02 +00:00
Bjørn Erik Pedersen
d2249c5099 Set up Hugo release flow on CircleCI
This rewrites the release logic to use CircleCI 2.0 and its approve workflow in combination with the state of the release notes to determine what to do next.

Fixes #3779
2017-09-10 17:14:02 +02:00
Bjørn Erik Pedersen
b36f6e31e0 releaser: Bump versions for release of 0.26
[ci skip]
2017-08-07 09:05:07 +02:00
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
Albert Nigmatzianov
9f0b02b898 commands: Fix case of createpath in new.go 2017-03-24 22:19:03 +01:00
Eamonn
559b4007f7 commands: Keep "." directories on cleanDestinationDir
Fixes #3208
2017-03-21 13:10:31 +01:00
Stefan Buynov
9dfb9c1445 Case insensitive translation of the 'more' tag when importing from Jekyll 2017-03-18 16:16:25 +01:00
Anthony Kong
62efcdfed4 commands: Improve jekyll import date format
Allow both yyyy-mm-dd and yyyy-m-d formats in jekyll markdown
file names.
2017-03-13 12:50:57 +01:00
Bjørn Erik Pedersen
5f443bd45b commands: t.Error => t.Errorf 2017-03-11 19:07:32 +01:00
Cameron Moore
f039e3be9e parser: Refactor frontmatter parser and add tests
Lots of cleanups here:

- Refactor InterfaceToConfig and InterfaceToFrontMatter to use io.Writer.
- Simplify InterfaceToFrontMatter by wrapping InterfaceToConfig.
- Export FrontmatterType since we return it in DetectFrontMatter.
- Refactor removeTOMLIdentifier to avoid blindly replacing "+++".
- Update HandleJSONMetaData to return an empty map on nil input.
- Updates vendored goorgeous package and test for org-mode frontmatter.
- Add tests and godoc comments.

Coverage for parser package increased from 45.2% to 85.2%.
2017-03-11 17:52:25 +01:00
Albert Nigmatzianov
48120ccfd2 all: Fix some govet complaints 2017-03-09 14:18:12 +01:00