mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-13 14:12:23 -04:00
Adjust deprecation handling
This commit is contained in:
parent
f7e19a25b5
commit
88b21fae0a
@ -306,13 +306,9 @@ When deprecating a function or method, add this to front matter:
|
||||
|
||||
{{< code-toggle file=content/something/foo.md fm=true >}}
|
||||
expiryDate: 2024-10-30
|
||||
_build:
|
||||
list: never
|
||||
{{< /code-toggle >}}
|
||||
|
||||
Set the `expiryDate` to one year from the date of deprecation, and add a brief front matter comment to explain the settings.
|
||||
|
||||
Users will be able to search for the page, but the page will not appear in any list views, including section menus.
|
||||
Set the `expiryDate` to one year from the date of deprecation, and add a brief front matter comment to explain the setting.
|
||||
|
||||
## GitHub workflow
|
||||
|
||||
|
@ -7,10 +7,7 @@ action:
|
||||
related: []
|
||||
returnType: string
|
||||
signatures: [SITE.DisqusShortname]
|
||||
# deprecated 2023-10-30
|
||||
expiryDate: 2024-10-30
|
||||
_build:
|
||||
list: never
|
||||
expiryDate: 2024-10-30 # deprecated 2023-10-30
|
||||
---
|
||||
|
||||
{{% deprecated-in 0.120.0 %}}
|
||||
|
@ -7,10 +7,7 @@ action:
|
||||
related: []
|
||||
returnType: string
|
||||
signatures: [SITE.GoogleAnalytics]
|
||||
# deprecated 2023-10-30
|
||||
expiryDate: 2024-10-30
|
||||
_build:
|
||||
list: never
|
||||
expiryDate: 2024-10-30 # deprecated 2023-10-30
|
||||
---
|
||||
|
||||
{{% deprecated-in 0.120.0 %}}
|
||||
|
@ -7,10 +7,7 @@ action:
|
||||
related: []
|
||||
returnType: bool
|
||||
signatures: [SITE.IsDevelopment]
|
||||
# deprecated 2023-10-30
|
||||
expiryDate: 2024-10-30
|
||||
_build:
|
||||
list: never
|
||||
expiryDate: 2024-10-30 # deprecated 2023-10-30
|
||||
---
|
||||
|
||||
{{% deprecated-in 0.120.0 %}}
|
||||
@ -18,3 +15,7 @@ Use [`hugo.IsDevelopment`] instead.
|
||||
|
||||
[`hugo.IsDevelopment`]: /functions/hugo/isdevelopment
|
||||
{{% /deprecated-in %}}
|
||||
|
||||
```go-html-template
|
||||
{{ .Site.IsDevelopment }} → true/false
|
||||
```
|
||||
|
@ -7,10 +7,7 @@ action:
|
||||
related: []
|
||||
returnType: bool
|
||||
signatures: [SITE.IsServer]
|
||||
# deprecated 2023-10-30
|
||||
expiryDate: 2024-10-30
|
||||
_build:
|
||||
list: never
|
||||
expiryDate: 2024-10-30 # deprecated 2023-10-30
|
||||
---
|
||||
|
||||
{{% deprecated-in 0.120.0 %}}
|
||||
@ -18,3 +15,7 @@ Use [`hugo.IsServer`] instead.
|
||||
|
||||
[`hugo.IsServer`]: /functions/hugo/isserver
|
||||
{{% /deprecated-in %}}
|
||||
|
||||
```go-html-template
|
||||
{{ .Site.IsServer }} → true/false
|
||||
```
|
||||
|
@ -16,13 +16,13 @@ When a project _deprecates_ something, they are telling its users:
|
||||
2. Use Thing Two instead.
|
||||
3. We're going to remove Thing One at some point in the future.
|
||||
|
||||
[article]: https://en.wikipedia.org/wiki/Deprecation
|
||||
[reasons for deprecation]: https://en.wikipedia.org/wiki/Deprecation
|
||||
|
||||
Think of deprecation as a statement of intent. This Wikipedia [article] describes common reasons for deprecation:
|
||||
Common [reasons for deprecation]:
|
||||
|
||||
- The feature has been replaced by a more powerful alternative.
|
||||
- The feature contains a design flaw.
|
||||
- The feature is considered extraneous, and will be removed in the future in order to simplify the system as a whole.
|
||||
- A feature has been replaced by a more powerful alternative.
|
||||
- A feature contains a design flaw.
|
||||
- A feature is considered extraneous, and will be removed in the future in order to simplify the system as a whole.
|
||||
- A future version of the software will make major structural changes, making it impossible or impractical to support older features.
|
||||
- Standardization or increased consistency in naming.
|
||||
- A feature that once was available only independently is now combined with its co-feature.
|
||||
|
14
layouts/shortcodes/deprecated-in.html
Normal file
14
layouts/shortcodes/deprecated-in.html
Normal file
@ -0,0 +1,14 @@
|
||||
{{ $_hugo_config := `{ "version": 1 }` }}
|
||||
|
||||
{{ with .Get 0 }}
|
||||
{{ $version := printf "v%v" (strings.TrimLeft "vV" .) }}
|
||||
{{ $href := printf "https://github.com/gohugoio/hugo/releases/tag/%s" $version }}
|
||||
<aside>
|
||||
<div class="admonition-content bl bw2 b--dark-red" >
|
||||
<p>Deprecated in <a href="{{ $href }}">{{ $version }}</a>.</p>
|
||||
{{ $.Inner }}
|
||||
</div>
|
||||
</aside>
|
||||
{{ else }}
|
||||
{{ errorf "The %q shortcode requires a single positional parameter indicating version. See %s" .Name .Position }}
|
||||
{{ end }}
|
Loading…
x
Reference in New Issue
Block a user