Commit graph

9 commits

Author SHA1 Message Date
Anthony Fok
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
Anthony Fok
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
Austin Ziegler
c1942e915a Change permalink validation and substitution. 2014-11-02 00:43:01 -04:00
spf13
5dfc1dedb8 Big refactor of how source files are used. Also added default destination extension option. 2014-10-16 20:20:09 -04:00
Joel Scoble
4b9e4c90d9 #462 fix, remove leading and trailing dashes from urlized slug. includes test changes 2014-10-07 17:05:11 -04:00
Lorenzo Bolla
e98f0014f2 Allow to use filename in permalinks 2014-05-28 17:59:49 -04:00
tummychow
2e954d8551 Fix permalinks to subdomains
If you don't have access to the root domain of your site (eg a GitHub project
page) and you try to generate custom permalinks, they must begin with a slash.
Go's URL resolution library sees the leading slash and thinks "this URL starts
at the root", just like a filesystem - so it discards your subdomain and maps
all custom permalinks from the root of your site. Fine if you control the root
domain, not so useful if you don't.

Removing the check for a leading slash fixes this problem. You can now specify
custom permalinks that do not start with a slash, and they will map safely
regardless of what subdomain you upload the generated site under.

Tests have been updated for this commit so that they continue to function.
2014-04-26 23:01:28 -06:00
spf13
44d57fdc0c Reorganize helpers 2013-12-05 09:29:41 -05:00
Phil Pennock
07978e4a49 configurable permalinks support
A sample config.yaml for a site might contain:

```yaml
permalinks:
  post: /:year/:month/:title/
```

Then, any article in the `post` section, will have the canonical URL
formed via the permalink specification given.

Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-11-18 13:32:56 -08:00