Skip to content

Commit

Permalink
Alerts: Change 'Alias' Field To 'Shorturl'
Browse files Browse the repository at this point in the history
Suggested by Saïvann (thanks!)
  • Loading branch information
harding committed Jul 25, 2015
1 parent b21bf33 commit ec6c93e
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -556,16 +556,16 @@ coordination is usually conducted in #bitcoin-dev on Freenode.
#### Basic Alert
1. Open your editor on a file named `_alerts/YYYY-MM-DD-short-title.md`
(the alert will appear as <https://bitcoin.org/YYYY-MM-DD-short-title>).
(the alert will appear as <https://bitcoin.org/en/alert/YYYY-MM-DD-short-title>).
2. Paste the following text into the top of the file:
```
---
## Title displayed on alert page
title: "11/12 March 2013 Chain Fork"
## Short URL for use in P2P network alerts: https://bitcoin.org/<alias>
alias: "chainfork"
## Short URL for use in P2P network alerts: https://bitcoin.org/<shorturl>
shorturl: "chainfork"
## Active alerts will display the banner (below) on all bitcoin.org content pages
active: true
## Banner displayed if 'active: true'. Can use HTML formatting
Expand Down Expand Up @@ -611,7 +611,7 @@ coordination is usually conducted in #bitcoin-dev on Freenode.
displayed on the live site. The site build aborts and starts over
when new commits are found.
- Give the `alias` URL (`bitcoin.org/<alias>`) to the P2P alert message
- Give the `shorturl` URL (`bitcoin.org/<shorturl>`) to the P2P alert message
key holders to use in any alert messages they send.
- Proceed to the next section to improve the alert.
Expand All @@ -628,8 +628,8 @@ The following fields may be defined in the the alert YAML header:
---
## (Required; HTML text) Title displayed on alert page
title: "11/12 March 2013 Chain Fork"
## (Optional; display ASCII only) Short URL for use in P2P network alerts: https://bitcoin.org/<alias>
alias: "chainfork"
## (Optional; display ASCII only) Short URL for use in P2P network alerts: https://bitcoin.org/<shorturl>
shorturl: "chainfork"
## (Optional; default=false) Active alerts will display the banner (below) on all bitcoin.org content pages
active: true
## (Optional; HTML text) Banner displayed if 'active: true'. Can use HTML formatting
Expand Down
2 changes: 1 addition & 1 deletion _alerts/2012-02-18-protocol-change.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "February 20, 2012 Protocol Changes"
alias: "feb20"
shorturl: "feb20"
active: false
banner: ""
---
Expand Down
2 changes: 1 addition & 1 deletion _alerts/2012-03-16-critical-vulnerability.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Potentially Critical Security Vulnerability"
alias: "critfix"
shorturl: "critfix"
active: false
banner: ""
---
Expand Down
2 changes: 1 addition & 1 deletion _alerts/2012-05-14-dos.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "CVE-2012-2459: Critical Vulnerability (denial-of-service)"
alias: "dos"
shorturl: "dos"
active: false
banner: ""
---
Expand Down
2 changes: 1 addition & 1 deletion _alerts/2013-03-11-chain-fork.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "11/12 March 2013 Chain Fork Information"
alias: "chainfork"
shorturl: "chainfork"
active: false
banner: ""
---
Expand Down
2 changes: 1 addition & 1 deletion _alerts/2013-03-15-upgrade-deadline.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "15 May 2013 Upgrade Deadline"
alias: "may15"
shorturl: "may15"
active: false
banner: ""
---
Expand Down
2 changes: 1 addition & 1 deletion _alerts/2013-08-11-android.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Android Security Vulnerability"
active: false
alias: "android"
shorturl: "android"
banner: ""
---

Expand Down
2 changes: 1 addition & 1 deletion _alerts/2014-04-11-heartbleed.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "OpenSSL Heartbleed vulnerability"
alias: "heartbleed"
shorturl: "heartbleed"
active: false
banner: ""
---
Expand Down
2 changes: 1 addition & 1 deletion _alerts/2015-07-04-spv-mining.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Some Miners Generating Invalid Blocks"
alias: "spv-mining"
shorturl: "spv-mining"
active: false
#banner: "WARNING: many wallets currently vulnerable to double-spending of confirmed transactions (click here to read)"
bannerclass: "alert"
Expand Down
8 changes: 4 additions & 4 deletions _plugins/alerts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#variable is set, allowing a clickable alert banner to be
#displayed in _layouts/base.html .

#If "alias" variable is set in one alert file, a short alias
#If "shorturl" variable is set in one alert file, a short alias
#file for the alert (like /android.html) is generated for
#Bitcoin Core non-clickable alerts.

Expand Down Expand Up @@ -47,9 +47,9 @@ def initialize(site, base, lang, srcdir, src, dstdir, dst, date)
if self.data.has_key?('active') and !self.data['active'].nil? and self.data['active'] == true
site.config['STATUS'] = 1
end
if self.data.has_key?('alias')
site.pages << AlertPage.new(site, base, lang, srcdir, src, '', self.data['alias']+'.'+extension, date)
site.pages << AlertPage.new(site, base, lang, srcdir, src, '', self.data['alias']+'/index.'+extension, date)
if self.data.has_key?('shorturl')
site.pages << AlertPage.new(site, base, lang, srcdir, src, '', self.data['shorturl']+'.'+extension, date)
site.pages << AlertPage.new(site, base, lang, srcdir, src, '', self.data['shorturl']+'/index.'+extension, date)
end
end
end
Expand Down

0 comments on commit ec6c93e

Please sign in to comment.