Adjust deprecation handling

This commit is contained in:
Joe Mooring 2023-12-29 13:29:34 -08:00 committed by GitHub
parent f7e19a25b5
commit 88b21fae0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 26 deletions

View File

@ -306,13 +306,9 @@ When deprecating a function or method, add this to front matter:
{{< code-toggle file=content/something/foo.md fm=true >}} {{< code-toggle file=content/something/foo.md fm=true >}}
expiryDate: 2024-10-30 expiryDate: 2024-10-30
_build:
list: never
{{< /code-toggle >}} {{< /code-toggle >}}
Set the `expiryDate` to one year from the date of deprecation, and add a brief front matter comment to explain the settings. Set the `expiryDate` to one year from the date of deprecation, and add a brief front matter comment to explain the setting.
Users will be able to search for the page, but the page will not appear in any list views, including section menus.
## GitHub workflow ## GitHub workflow

View File

@ -7,10 +7,7 @@ action:
related: [] related: []
returnType: string returnType: string
signatures: [SITE.DisqusShortname] signatures: [SITE.DisqusShortname]
# deprecated 2023-10-30 expiryDate: 2024-10-30 # deprecated 2023-10-30
expiryDate: 2024-10-30
_build:
list: never
--- ---
{{% deprecated-in 0.120.0 %}} {{% deprecated-in 0.120.0 %}}

View File

@ -7,10 +7,7 @@ action:
related: [] related: []
returnType: string returnType: string
signatures: [SITE.GoogleAnalytics] signatures: [SITE.GoogleAnalytics]
# deprecated 2023-10-30 expiryDate: 2024-10-30 # deprecated 2023-10-30
expiryDate: 2024-10-30
_build:
list: never
--- ---
{{% deprecated-in 0.120.0 %}} {{% deprecated-in 0.120.0 %}}

View File

@ -7,10 +7,7 @@ action:
related: [] related: []
returnType: bool returnType: bool
signatures: [SITE.IsDevelopment] signatures: [SITE.IsDevelopment]
# deprecated 2023-10-30 expiryDate: 2024-10-30 # deprecated 2023-10-30
expiryDate: 2024-10-30
_build:
list: never
--- ---
{{% deprecated-in 0.120.0 %}} {{% deprecated-in 0.120.0 %}}
@ -18,3 +15,7 @@ Use [`hugo.IsDevelopment`] instead.
[`hugo.IsDevelopment`]: /functions/hugo/isdevelopment [`hugo.IsDevelopment`]: /functions/hugo/isdevelopment
{{% /deprecated-in %}} {{% /deprecated-in %}}
```go-html-template
{{ .Site.IsDevelopment }} → true/false
```

View File

@ -7,10 +7,7 @@ action:
related: [] related: []
returnType: bool returnType: bool
signatures: [SITE.IsServer] signatures: [SITE.IsServer]
# deprecated 2023-10-30 expiryDate: 2024-10-30 # deprecated 2023-10-30
expiryDate: 2024-10-30
_build:
list: never
--- ---
{{% deprecated-in 0.120.0 %}} {{% deprecated-in 0.120.0 %}}
@ -18,3 +15,7 @@ Use [`hugo.IsServer`] instead.
[`hugo.IsServer`]: /functions/hugo/isserver [`hugo.IsServer`]: /functions/hugo/isserver
{{% /deprecated-in %}} {{% /deprecated-in %}}
```go-html-template
{{ .Site.IsServer }} → true/false
```

View File

@ -16,13 +16,13 @@ When a project _deprecates_ something, they are telling its users:
2. Use Thing Two instead. 2. Use Thing Two instead.
3. We're going to remove Thing One at some point in the future. 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. - A feature has been replaced by a more powerful alternative.
- The feature contains a design flaw. - A 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 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. - 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. - Standardization or increased consistency in naming.
- A feature that once was available only independently is now combined with its co-feature. - A feature that once was available only independently is now combined with its co-feature.

View 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 }}