From b9bdfd40a61a18c3d60b66ed7c0665ad8e414ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 16 Jul 2017 15:32:31 +0200 Subject: [PATCH] Prefix methods with a "." Not optimal, but it at least indicates that they need a context (Page etc.) and cannot be called alone. --- content/functions/GetPage.md | 3 +-- content/functions/NumFmt.md | 6 ++---- content/functions/abslangurl.md | 3 +-- content/functions/absurl.md | 3 +-- content/functions/adddate.md | 5 ++--- content/functions/after.md | 1 - content/functions/apply.md | 1 - content/functions/base64.md | 1 - content/functions/chomp.md | 1 - content/functions/countrunes.md | 1 - content/functions/countwords.md | 1 - content/functions/dateformat.md | 1 - content/functions/default.md | 1 - content/functions/delimit.md | 1 - content/functions/dict.md | 1 - content/functions/echoparam.md | 4 ++-- content/functions/emojify.md | 1 - content/functions/findRe.md | 3 +-- content/functions/format.md | 3 +-- content/functions/get.md | 3 +-- content/functions/getenv.md | 1 - content/functions/haschildren.md | 3 +-- content/functions/hasmenucurrent.md | 3 +-- content/functions/ismenucurrent.md | 2 +- content/functions/math.md | 3 +-- content/functions/param.md | 5 ++--- content/functions/scratch.md | 2 +- content/functions/unix.md | 7 ++----- 28 files changed, 21 insertions(+), 49 deletions(-) diff --git a/content/functions/GetPage.md b/content/functions/GetPage.md index 2fe2072a1..c1966c784 100644 --- a/content/functions/GetPage.md +++ b/content/functions/GetPage.md @@ -1,6 +1,5 @@ --- -title: getpage -linktitle: GetPage +title: .GetPage description: Looks up the index page (`_index.md`) of a given `Kind` and `path`. godocref: date: 2017-02-01 diff --git a/content/functions/NumFmt.md b/content/functions/NumFmt.md index f6b8fb52d..4dfd2012b 100644 --- a/content/functions/NumFmt.md +++ b/content/functions/NumFmt.md @@ -1,6 +1,5 @@ --- -title: numfmt -linktitle: NumFmt +title: lang.NumFmt description: "Formats a number with a given precision using the requested `decimal`, `grouping`, and `negative` characters." godocref: "" workson: [] @@ -13,8 +12,7 @@ menu: docs: parent: "functions" toc: false -ns: "lang" -signature: ["NumFmt "] +signature: ["lang.NumFmt "] workson: [] hugoversion: relatedfuncs: [] diff --git a/content/functions/abslangurl.md b/content/functions/abslangurl.md index 52b1df4d1..982508cad 100644 --- a/content/functions/abslangurl.md +++ b/content/functions/abslangurl.md @@ -1,6 +1,5 @@ --- -title: abslangurl -linktitle: absLangURL +title: absLangURL description: Adds the absolute URL with correct language prefix according to site configuration for multilingual. godocref: date: 2017-02-01 diff --git a/content/functions/absurl.md b/content/functions/absurl.md index ce3355ace..6b663fd9d 100644 --- a/content/functions/absurl.md +++ b/content/functions/absurl.md @@ -1,6 +1,5 @@ --- -title: absurl -linktitle: absURL +title: absURL description: Given a string, prepends the full absolute URL according to position in file structure and the configured baseURL. godocref: date: 2017-02-01 diff --git a/content/functions/adddate.md b/content/functions/adddate.md index e95415a0c..40fefc872 100644 --- a/content/functions/adddate.md +++ b/content/functions/adddate.md @@ -1,6 +1,5 @@ --- -title: adddate -linktitle: AddDate +title: .AddDate description: Returns the time corresponding to adding the given number of years, months, and days passed to the function. godocref: https://golang.org/pkg/time/#Time.AddDate date: 2017-02-01 @@ -11,7 +10,7 @@ menu: docs: parent: "functions" #tags: [dates,time] -signature: ["AddDate YEARS MONTHS DAYS"] +signature: [".AddDate YEARS MONTHS DAYS"] workson: [times] hugoversion: relatedfuncs: [now] diff --git a/content/functions/after.md b/content/functions/after.md index f81d6758f..55041086e 100644 --- a/content/functions/after.md +++ b/content/functions/after.md @@ -1,6 +1,5 @@ --- title: after -linktitle: after description: Slices an array to only the items after the Nth item. godocref: date: 2017-02-01 diff --git a/content/functions/apply.md b/content/functions/apply.md index 8bd4a21b6..c5a372e01 100644 --- a/content/functions/apply.md +++ b/content/functions/apply.md @@ -1,6 +1,5 @@ --- title: apply -linktitle: apply description: Given a map, array, or slice, `description` returns a new slice with a function applied over it. godocref: date: 2017-02-01 diff --git a/content/functions/base64.md b/content/functions/base64.md index 2d64c1d7b..772f041c7 100644 --- a/content/functions/base64.md +++ b/content/functions/base64.md @@ -1,6 +1,5 @@ --- title: base64 -linktitle: base64 description: base64Encode and base64Decode let you easily decode content with a base64 encoding and vice versa through pipes. godocref: date: 2017-02-01 diff --git a/content/functions/chomp.md b/content/functions/chomp.md index d12e257e8..fdc6a5fd3 100644 --- a/content/functions/chomp.md +++ b/content/functions/chomp.md @@ -1,6 +1,5 @@ --- title: chomp -linktitle: chomp description: Removes any trailing newline characters. godocref: Removes any trailing newline characters. date: 2017-02-01 diff --git a/content/functions/countrunes.md b/content/functions/countrunes.md index 3e62e3132..ae078cb40 100644 --- a/content/functions/countrunes.md +++ b/content/functions/countrunes.md @@ -1,6 +1,5 @@ --- title: countrunes -linktitle: countrunes description: Determines the number of runes in a string and excludes any whitespace. godocref: date: 2017-02-01 diff --git a/content/functions/countwords.md b/content/functions/countwords.md index 2e4e39930..b4ca1418a 100644 --- a/content/functions/countwords.md +++ b/content/functions/countwords.md @@ -1,6 +1,5 @@ --- title: countwords -linktitle: countwords description: Counts the number of words in a string that has been passed to it. godocref: date: 2017-02-01 diff --git a/content/functions/dateformat.md b/content/functions/dateformat.md index 53bc052bc..8f384060f 100644 --- a/content/functions/dateformat.md +++ b/content/functions/dateformat.md @@ -1,6 +1,5 @@ --- title: dateFormat -linktitle: description: Converts the textual representation of the `datetime` into the specified format. godocref: https://golang.org/pkg/time/ date: 2017-02-01 diff --git a/content/functions/default.md b/content/functions/default.md index 64036724d..f89f68874 100644 --- a/content/functions/default.md +++ b/content/functions/default.md @@ -1,6 +1,5 @@ --- title: default -linktitle: default description: Allows setting a default value that can be returned if a first value is not set. qref: "Returns a default value if a value is not set when checked." godocref: diff --git a/content/functions/delimit.md b/content/functions/delimit.md index 93cd4cb26..e6e3362a9 100644 --- a/content/functions/delimit.md +++ b/content/functions/delimit.md @@ -1,6 +1,5 @@ --- title: delimit -linktitle: delimit description: Loops through any array, slice, or map and returns a string of all the values separated by a delimiter. godocref: workson: [] diff --git a/content/functions/dict.md b/content/functions/dict.md index 4946818e3..c04d9dc80 100644 --- a/content/functions/dict.md +++ b/content/functions/dict.md @@ -1,6 +1,5 @@ --- title: dict -linktitle: dict description: Creates a dictionary `(map[string, interface{})` that expects parameters added in a value:object fashion. godocref: workson: [] diff --git a/content/functions/echoparam.md b/content/functions/echoparam.md index 7e9d53828..3c207097f 100644 --- a/content/functions/echoparam.md +++ b/content/functions/echoparam.md @@ -1,6 +1,5 @@ --- -title: echoparam -linktitle: echoParam +title: echoParam description: Prints a parameter if it is set. godocref: date: 2017-02-01 @@ -20,6 +19,7 @@ draft: false aliases: [] --- + `echoParam` prints a parameter if it is set. ``` diff --git a/content/functions/emojify.md b/content/functions/emojify.md index 57241661b..d43f21cb2 100644 --- a/content/functions/emojify.md +++ b/content/functions/emojify.md @@ -1,6 +1,5 @@ --- title: emojify -linktitle: description: Runs a string through the Emoji emoticons processor. godocref: date: 2017-02-01 diff --git a/content/functions/findRe.md b/content/functions/findRe.md index 8b745b569..d5bc7ccd0 100644 --- a/content/functions/findRe.md +++ b/content/functions/findRe.md @@ -1,6 +1,5 @@ --- -title: findre -linktitle: findRE +title: findRE description: Returns a list of strings that match the regular expression. godocref: date: 2017-02-01 diff --git a/content/functions/format.md b/content/functions/format.md index 8b501d046..5e5a86967 100644 --- a/content/functions/format.md +++ b/content/functions/format.md @@ -1,6 +1,5 @@ --- -title: format -linktitle: Format +title: .Format description: Formats built-in Hugo dates---`.Date`, `.PublishDate`, and `.LastMod`---according to Go's layout string. godocref: https://golang.org/pkg/time/#example_Time_Format date: 2017-02-01 diff --git a/content/functions/get.md b/content/functions/get.md index d45f6ed21..d94d52a84 100644 --- a/content/functions/get.md +++ b/content/functions/get.md @@ -1,6 +1,5 @@ --- -title: get -linktitle: Get +title: .Get description: Accesses positional and ordered parameters in shortcode declaration. godocref: date: 2017-02-01 diff --git a/content/functions/getenv.md b/content/functions/getenv.md index c8086ac86..340e9b7c6 100644 --- a/content/functions/getenv.md +++ b/content/functions/getenv.md @@ -1,6 +1,5 @@ --- title: getenv -linktitle: getenv description: Returns the value of an environment variable. godocref: date: 2017-02-01 diff --git a/content/functions/haschildren.md b/content/functions/haschildren.md index c313c17a1..7e2b1e474 100644 --- a/content/functions/haschildren.md +++ b/content/functions/haschildren.md @@ -1,6 +1,5 @@ --- -title: haschildren -linktitle: HasChildren +title: .HasChildren description: godocref: date: 2017-02-01 diff --git a/content/functions/hasmenucurrent.md b/content/functions/hasmenucurrent.md index c022f15de..d82e44dbb 100644 --- a/content/functions/hasmenucurrent.md +++ b/content/functions/hasmenucurrent.md @@ -1,6 +1,5 @@ --- -title: hasmenucurrent -linktitle: HasMenuCurrent +title: .HasMenuCurrent description: godocref: date: 2017-02-01 diff --git a/content/functions/ismenucurrent.md b/content/functions/ismenucurrent.md index 330996b72..9e546b07d 100644 --- a/content/functions/ismenucurrent.md +++ b/content/functions/ismenucurrent.md @@ -1,5 +1,5 @@ --- -title: ismenucurrent +title: .IsMenuCurrent linktitle: IsMenuCurrent description: godocref: diff --git a/content/functions/math.md b/content/functions/math.md index 145f808f0..fb6484b01 100644 --- a/content/functions/math.md +++ b/content/functions/math.md @@ -1,6 +1,5 @@ --- -title: math -linktitle: Math +title: Math description: Hugo provides six mathematical operators in templates. godocref: date: 2017-02-01 diff --git a/content/functions/param.md b/content/functions/param.md index c7859fca9..f05edbff6 100644 --- a/content/functions/param.md +++ b/content/functions/param.md @@ -1,6 +1,5 @@ --- -title: param -linktitle: Param +title: .Param description: Calls page or site variables into your template. godocref: date: 2017-02-01 @@ -12,7 +11,7 @@ menu: docs: parent: "functions" toc: -signature: ["Param KEY"] +signature: [".Param KEY"] workson: [] hugoversion: relatedfuncs: [default] diff --git a/content/functions/scratch.md b/content/functions/scratch.md index 5b9e67f07..f69d3b760 100644 --- a/content/functions/scratch.md +++ b/content/functions/scratch.md @@ -1,5 +1,5 @@ --- -title: Scratch +title: .Scratch description: Acts as a "scratchpad" to allow for writable page- or shortcode-scoped variables. godocref: date: 2017-02-01 diff --git a/content/functions/unix.md b/content/functions/unix.md index 6fb64673d..faa45e443 100644 --- a/content/functions/unix.md +++ b/content/functions/unix.md @@ -1,9 +1,6 @@ --- -title: unix -# Set this to draft for now; "unix" is not a function. We need to redo this section with: -# - methods vs functions -# - function namespaces as subsections. -draft: true +title: .Unix +draft: false description: Unix returns the local Time corresponding to the given Unix time, sec seconds and nsec nanoseconds since January 1, 1970 UTC. godocref: https://golang.org/search?q=Unix#Functions date: 2017-02-01