Skip to content

Commit

Permalink
Allow to disable links using null instead of an empty string (relates…
Browse files Browse the repository at this point in the history
… to #2285)

It feels more natural to use null (https://yaml.org/spec/1.2.2/#10211-null).
  • Loading branch information
marcwrobel committed Jan 13, 2023
1 parent fcb2b39 commit 4481188
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ releases:
# Use this if the link is not predictable (i.e. you can't use changelogTemplate),
# or if the changelogTemplate generated link must be overridden.
# Do not use a localized URL (such as one containing en-us) if possible.
# Use the special value 'null' (unquoted) if you want to disable link for a specific cycle of a
# product having a changelogTemplate.
link: https://example.com/news/2021-12-25/release-1.2.3

# In the following markdown section, ensure that all the above are present:
Expand Down
2 changes: 1 addition & 1 deletion _plugins/product-data-enricher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def set_cycle_discontinued(cycle)
end

def set_cycle_link(page, cycle)
if !cycle['link'] && page['changelogTemplate']
if !cycle.has_key?('link') && page['changelogTemplate']
link = page['changelogTemplate'].gsub('__RELEASE_CYCLE__', cycle['releaseCycle'] || '')
link.gsub!('__CODENAME__', cycle['codename'] || '')
link.gsub!('__LATEST__', cycle['latest'] || '')
Expand Down
20 changes: 10 additions & 10 deletions products/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,61 +88,61 @@ releases:
codename: Jelly Bean
eol: true
releaseDate: 2012-07-09
link: ''
link: null

- releaseCycle: "4"
codename: Ice Cream Sandwich
eol: true
releaseDate: 2011-10-18
link: ''
link: null

- releaseCycle: "3"
codename: Honeycomb
eol: true
releaseDate: 2011-02-22
link: ''
link: null

- releaseCycle: "2.3"
codename: Gingerbread
eol: true
releaseDate: 2010-12-06
link: ''
link: null

- releaseCycle: "2.2"
codename: Froyo
eol: true
releaseDate: 2010-05-20
link: ''
link: null

- releaseCycle: "2.0"
codename: Eclair
eol: true
releaseDate: 2009-10-26
link: ''
link: null

- releaseCycle: "1.6"
codename: Donut
eol: true
releaseDate: 2009-09-15
link: ''
link: null

- releaseCycle: "1.5"
codename: Cupcake
eol: true
releaseDate: 2009-04-27
link: ''
link: null

- releaseCycle: "1.1"
codename: Petit Four
eol: true
releaseDate: 2009-02-09
link: ''
link: null

- releaseCycle: "1.0"
releaseLabel: "__RELEASE_CYCLE__"
eol: true
releaseDate: 2008-09-23
link: ''
link: null

---

Expand Down
22 changes: 10 additions & 12 deletions products/freebsd.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ releases:
- releaseCycle: "stable/13"
releaseDate: 2021-04-13
eol: 2026-01-31
# prevent the link to be generated using the changelogTemplate
link: ""
link: null

- releaseCycle: "releng/12.4"
releaseDate: 2022-12-05
Expand All @@ -49,8 +48,7 @@ releases:
- releaseCycle: "stable/12"
releaseDate: 2018-12-11
eol: 2023-12-31
# prevent the link to be generated using the changelogTemplate
link: ""
link: null

- releaseCycle: "releng/11.4"
eol: 2021-09-30
Expand All @@ -59,7 +57,7 @@ releases:
- releaseCycle: "stable/11"
releaseDate: 2016-10-10
eol: 2021-09-30
link: ""
link: null

- releaseCycle: "releng/10.4"
eol: 2018-10-31
Expand All @@ -84,7 +82,7 @@ releases:
- releaseCycle: "stable/10"
releaseDate: 2014-01-20
eol: 2018-10-31
link: ""
link: null

- releaseCycle: "releng/9.3"
eol: 2016-12-31
Expand All @@ -105,7 +103,7 @@ releases:
- releaseCycle: "stable/9"
releaseDate: 2012-01-10
eol: 2016-12-31
link: ""
link: null

- releaseCycle: "releng/8.4"
eol: 2015-08-01
Expand All @@ -130,7 +128,7 @@ releases:
- releaseCycle: "stable/8"
releaseDate: 2009-11-25
eol: 2015-08-01
link: ""
link: null

- releaseCycle: "releng/7.4"
eol: 2013-02-28
Expand All @@ -155,7 +153,7 @@ releases:
- releaseCycle: "stable/7"
releaseDate: 2008-02-27
eol: 2013-02-28
link: ""
link: null

- releaseCycle: "releng/6.4"
eol: 2010-11-30
Expand All @@ -180,7 +178,7 @@ releases:
- releaseCycle: "stable/6"
releaseDate: 2005-11-04
eol: 2010-11-30
link: ""
link: null

- releaseCycle: "releng/5.5"
eol: 2008-05-31
Expand All @@ -197,7 +195,7 @@ releases:
- releaseCycle: "stable/5"
releaseDate: 2004-11-06
eol: 2008-05-31
link: ""
link: null

- releaseCycle: "releng/4.11"
eol: 2007-01-31
Expand All @@ -206,7 +204,7 @@ releases:
- releaseCycle: "stable/4"
releaseDate: 2000-03-14
eol: 2007-01-31
link: ""
link: null

---

Expand Down

0 comments on commit 4481188

Please sign in to comment.