1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

37 Commits

Author SHA1 Message Date
bep
bef0f281d1 Make sure that complete server URL is logged on startup
Fixes #1113
2015-05-09 08:03:06 +02:00
2bfa9fb72b Make server bind interface configurable.
Bind by default to 127.0.0.1. Previously it always bound to all interfaces.

Always have log message display that the server is available on the
interface to which it is bound, instead of the baseUrl.

Fixes #1097
2015-05-07 22:04:40 +02:00
99a18b21fc List directories being watched when server is run
Fixes part of issue 1030. Previously hugo only listed the content
directory as being watched. Now we list all files being watched
according to `commands.getDirList()`. We also introduce a RemoveSubpaths
function and test in the helpers module to reduce noise in the command
line output by not showing subdirectories of ones already being watched.

For example, instead of:
`Watching for changes in $HOME/blog/content`
We get:
`Watching for changes in
$HOME/blog/{data,content,layouts,static,themes/my-theme}`
2015-04-02 12:52:08 +02:00
8b8fb417ae More initialism corrections (golint)
Thanks to @bep's new, brilliant helpers.Deprecated() function,
the following functions or variables are transitioned to their
new names, preserving backward compatibility for v0.14
and warning the user of upcoming obsolescence in v0.15:

 * .Url → .URL (for node, menu and paginator)
 * .Site.BaseUrl → .Site.BaseURL
 * .Site.Indexes → .Site.Taxonomies
 * .Site.Recent → .Site.Pages
 * getJson → getJSON
 * getCsv → getCSV
 * safeHtml → safeHTML
 * safeCss → safeCSS
 * safeUrl → safeURL

Also fix related initialisms in strings and comments.

Continued effort in fixing #959.
2015-03-18 11:30:37 +01:00
67df33f500 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 #959.
2015-03-11 21:55:00 +01:00
664fd99135 Change "ctrl+c" to "Ctrl+C" 2015-02-11 01:11:50 -07:00
60c6faa317 Revert "Try to fix mysterious test failures on Travis"
This reverts commit 71fe85df9b7193f790fbb5e3af415b176fdb6a4f.

See https://github.com/PuerkitoBio/purell/pull/5
for the cause of the mysterious `go test -v ./...` failure.
2015-01-22 17:46:47 -07:00
bep
71fe85df9b Try to fix mysterious test failures on Travis 2015-01-23 00:36:47 +01:00
1cbdd3e59d Ensure that BaseUrl used in hugo server ends with /
Fixes #793, #799
2015-01-15 18:02:19 -07:00
c6f4b09f65 always use http scheme for localhost
fixes #758
2015-01-01 23:57:29 +01:00
e3433e6afb Fix long descriptions of benchmark and serve commands 2014-12-24 04:40:48 -07:00
bep
8cb435f1f4 Fix redirect-loop for Hugo server
An extra slash was added to the path if baseUrl had a sub-directory, causing infinite redirect loop in Go's HTTP server.

Fixes #510
2014-11-01 22:49:26 -04:00
2b412d4ac7 fixed server reporting Web Server is available at https://localhost:1313 when server always serve http 2014-11-01 22:33:43 -04:00
141f3e19e0 Migrating Hugo to Afero for filesystem calls. 2014-11-01 11:57:29 -04:00
fb82f00f9d handle https prefixes in baseUrl 2014-10-07 17:18:45 -04:00
26e44506e9 adding memstat option to server 2014-09-22 09:45:05 -04:00
a31edb3388 Support subdir in baseurl.
Mainly this was a change to helpers.MakePermalink, but to get the local server to run correctly,
we needed to redirect the path of the request from /foo to /.  In addition, I added tests for the
server's code for fixing up the base url with different config file & CLI options.
2014-08-25 11:51:51 -04:00
657e4a46e8 it's/its 2014-07-26 23:43:21 -07:00
7a8b754cad Fixed #301. LiveReload works on any port now. 2014-05-28 19:01:24 -04:00
be1ee22032 Proper integration of live reload with automatic injection 2014-05-16 17:49:27 -04:00
60ed5bda2b Live reloading is working! Still need to incorporate cleanly. 2014-05-16 11:48:59 -04:00
296d218e67 Better handling of when the specified port is already in use 2014-05-15 17:41:03 -04:00
0053be979a Correctly print server URL when base-url is specified in the command line
When running hugo server like:

    $ hugo server -s docs -b myhostname

the printed output now directs to http://myhostname:1313 instead of
(invariably) http://localhost:1313.

As per server(), BaseUrl is never empty, and the required value is always
found in Viper.
2014-05-09 23:27:21 -04:00
62dd1d45c1 Hugo config abstracted into a general purpose config library called "Viper".
Hugo casting now in own library called "cast"
2014-04-05 01:40:33 -04:00
e50b9d8ac1 Adding support for logging & verbose logging. Consolidation of error handling. Integration of jWalterWeatherman library. Fixed #137 2014-03-31 13:23:34 -04:00
6dd2e9a49a gofmt all go code 2014-01-29 18:03:35 -05:00
ff9f6e1b2a Fix panic with HTTP serve initialization problems. 2014-01-28 23:44:43 -05:00
5550c4148e Added append-port flag 2013-12-28 22:01:36 -05:00
e5aa08ff0c If baseurl is set then print that on the command line, else leave as default of localhost
Conflicts:
	commands/server.go
2013-12-28 14:02:10 -05:00
1abc2f0b86 properly use non-localhost BaseUrl in server command 2013-12-16 17:39:59 -05:00
b580a25d1f Better error handling when rendering error found when in watch mode
In watch mode it should continue to watch for changes, in any other mode it should exit with a -1 error code so can check for success when scripting
2013-10-25 18:03:14 -04:00
0318f7c149 Clean up server & build site logic. Fixed #94 2013-10-09 18:53:46 -04:00
e6ace71fec server command now builds prior to serving 2013-10-09 18:24:40 -04:00
be7ba0e98f server defaults to localhost unless overridden by command line flags 2013-10-04 16:03:13 -04:00
18f2b82658 Switching to the rjson library which is more friendly to human generated json. 2013-10-01 22:45:24 -04:00
3ae8dda203 Restoring build and watch functionality 2013-09-30 22:38:32 -04:00
94d7fe52f8 Change the interface to use commands and flags instead of just flags.
Better organization of main (controller style) code.
2013-09-29 02:10:29 -04:00