mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit 'a024bc7d76fcc5e49e8210f9b0896db9ef21861a'
This commit is contained in:
@@ -7,7 +7,7 @@ action:
|
||||
related: []
|
||||
returnType: string
|
||||
signatures: [SITE.DisqusShortname]
|
||||
expiryDate: 2024-10-30 # deprecated 2023-10-30
|
||||
expiryDate: 2025-10-30 # deprecated 2023-10-30 in v0.120.0
|
||||
---
|
||||
|
||||
{{% deprecated-in 0.120.0 %}}
|
||||
|
@@ -7,7 +7,7 @@ action:
|
||||
related: []
|
||||
returnType: string
|
||||
signatures: [SITE.GoogleAnalytics]
|
||||
expiryDate: 2024-10-30 # deprecated 2023-10-30
|
||||
expiryDate: 2025-10-30 # deprecated 2023-10-30 in v0.120.0
|
||||
---
|
||||
|
||||
{{% deprecated-in 0.120.0 %}}
|
||||
|
@@ -7,7 +7,7 @@ action:
|
||||
related: []
|
||||
returnType: bool
|
||||
signatures: [SITE.IsDevelopment]
|
||||
expiryDate: 2024-10-30 # deprecated 2023-10-30
|
||||
expiryDate: 2025-10-30 # deprecated 2023-10-30 in v0.120.0
|
||||
---
|
||||
|
||||
{{% deprecated-in 0.120.0 %}}
|
||||
@@ -15,7 +15,3 @@ Use [`hugo.IsDevelopment`] instead.
|
||||
|
||||
[`hugo.IsDevelopment`]: /functions/hugo/isdevelopment/
|
||||
{{% /deprecated-in %}}
|
||||
|
||||
```go-html-template
|
||||
{{ .Site.IsDevelopment }} → true/false
|
||||
```
|
||||
|
@@ -7,7 +7,7 @@ action:
|
||||
related: []
|
||||
returnType: bool
|
||||
signatures: [SITE.IsMultiLingual]
|
||||
expiryDate: 2025-03-16 # deprecated 2024-03-16
|
||||
expiryDate: 2026-03-16 # deprecated 2024-03-16 in 0.124.0
|
||||
---
|
||||
|
||||
{{% deprecated-in 0.124.0 %}}
|
||||
@@ -15,27 +15,3 @@ Use [`hugo.IsMultilingual`] instead.
|
||||
|
||||
[`hugo.IsMultilingual`]: /functions/hugo/ismultilingual/
|
||||
{{% /deprecated-in %}}
|
||||
|
||||
Site configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
defaultContentLanguage = 'de'
|
||||
defaultContentLanguageInSubdir = true
|
||||
[languages]
|
||||
[languages.de]
|
||||
languageCode = 'de-DE'
|
||||
languageName = 'Deutsch'
|
||||
title = 'Projekt Dokumentation'
|
||||
weight = 1
|
||||
[languages.en]
|
||||
languageCode = 'en-US'
|
||||
languageName = 'English'
|
||||
title = 'Project Documentation'
|
||||
weight = 2
|
||||
{{< /code-toggle >}}
|
||||
|
||||
Template:
|
||||
|
||||
```go-html-template
|
||||
{{ .Site.IsMultiLingual }} → true
|
||||
```
|
||||
|
@@ -7,7 +7,7 @@ action:
|
||||
related: []
|
||||
returnType: bool
|
||||
signatures: [SITE.IsServer]
|
||||
expiryDate: 2024-10-30 # deprecated 2023-10-30
|
||||
expiryDate: 2025-10-30 # deprecated 2023-10-30 in v0.120.0
|
||||
---
|
||||
|
||||
{{% deprecated-in 0.120.0 %}}
|
||||
@@ -15,7 +15,3 @@ Use [`hugo.IsServer`] instead.
|
||||
|
||||
[`hugo.IsServer`]: /functions/hugo/isserver/
|
||||
{{% /deprecated-in %}}
|
||||
|
||||
```go-html-template
|
||||
{{ .Site.IsServer }} → true/false
|
||||
```
|
||||
|
@@ -7,7 +7,7 @@ action:
|
||||
related: []
|
||||
returnType: time.Time
|
||||
signatures: [SITE.LastChange]
|
||||
expiryDate: 2025-02-19 # deprecated 2024-02-19
|
||||
expiryDate: 2026-02-19 # deprecated 2024-02-19 in v0.123.0
|
||||
---
|
||||
|
||||
{{% deprecated-in 0.123.0 %}}
|
||||
@@ -15,14 +15,3 @@ Use [`.Site.Lastmod`] instead.
|
||||
|
||||
[`.Site.Lastmod`]: /methods/site/lastmod/
|
||||
{{% /deprecated-in %}}
|
||||
|
||||
The `LastChange` method on a `Site` object returns a [`time.Time`] value. Use this with time [functions] and [methods]. For example:
|
||||
|
||||
```go-html-template
|
||||
{{ .Site.LastChange | time.Format ":date_long" }} → January 31, 2024
|
||||
|
||||
```
|
||||
|
||||
[`time.Time`]: https://pkg.go.dev/time#Time
|
||||
[functions]: /functions/time/
|
||||
[methods]: /methods/time/
|
||||
|
@@ -9,7 +9,7 @@ action:
|
||||
signatures: [SITE.Lastmod]
|
||||
---
|
||||
|
||||
{{< new-in 0.123.0 >}}
|
||||
{{< new-in 0.123.0 />}}
|
||||
|
||||
The `Lastmod` method on a `Site` object returns a [`time.Time`] value. Use this with time [functions] and [methods]. For example:
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
---
|
||||
title: Store
|
||||
linktitle: site.Store
|
||||
description: Returns a persistent "scratch pad" on the given site to store and manipulate data.
|
||||
description: Returns a "scratch pad" to store and manipulate data, scoped to the current site.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
@@ -14,12 +13,9 @@ action:
|
||||
toc: true
|
||||
---
|
||||
|
||||
{{< new-in 0.139.0 >}}
|
||||
{{< new-in 0.139.0 />}}
|
||||
|
||||
The `Store` method on a `Site` object creates a persistent [scratch pad](g) to store and manipulate data. To create a locally scoped scratch pad that is not attached to a `Site` object, use the [`newScratch`] function.
|
||||
|
||||
[`Scratch`]: /methods/site/scratch/
|
||||
[`newScratch`]: /functions/collections/newscratch/
|
||||
Use the `Store` method on a `Site` object to create a [scratch pad](g) to store and manipulate data, scoped to the current site. To create a scratch pad with a different [scope](g), refer to the [scope](#scope) section below.
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -104,6 +100,8 @@ Removes the given key.
|
||||
{{ site.Store.Delete "greeting" }}
|
||||
```
|
||||
|
||||
{{% include "_common/scratch-pad-scope.md" %}}
|
||||
|
||||
## Determinate values
|
||||
|
||||
The `Store` method is often used to set scratch pad values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are indeterminate until Hugo renders the page content.
|
||||
|
Reference in New Issue
Block a user