mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 01:36:13 +00:00
Standardize ALERTs between layouts
This commit is contained in:
parent
6c3c65c44a
commit
4ce5098c8c
7 changed files with 40 additions and 25 deletions
17
README.md
17
README.md
|
@ -44,19 +44,22 @@ Each time that a commit needs to be translated in other languages, a link to thi
|
|||
|
||||
### Alerts
|
||||
|
||||
You can easily put a global alert on the website by changing the ALERT and ALERT\_CLASS variables in _config.yml.
|
||||
And you can also set an alert specific to a language by appending the language code to the ALERT.
|
||||
You can easily put an alert on the website by changing the ALERT and ALERT\_CLASS variables in _config.yml.
|
||||
You can both set one fallback alert for all languages and many translated alerts for specific languages.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
ALERT_CLASS: error
|
||||
ALERT: <strong>Security alert:</strong> Please upgrade to 0.3.25 as soon as possible!
|
||||
ALERT_fr: <strong>Alerte de sécurité:</strong> Mettez Bitcoin à jour vers la version 0.3.25 sans délais!
|
||||
ALERT_CLASS:
|
||||
all: <strong>Security alert:</strong> Please upgrade to 0.8.1 as soon as possible!
|
||||
fr: <strong>Alerte de sécurité:</strong> Mettez Bitcoin à jour vers la version 0.8.1 sans délais!
|
||||
ALERT:
|
||||
all: error
|
||||
fr: error
|
||||
```
|
||||
|
||||
will produce an english red alert box for all languages, and a translated red alert box for french language.
|
||||
Possible classes are: error (red), info (blue), success (green) and warning (yellow)
|
||||
This will produce an english red alert box for all languages, and a translated red alert box for french language.
|
||||
Possible classes are: **error** (red), **info** (blue), **success** (green) and **warning** (yellow)
|
||||
|
||||
### Release Notes
|
||||
|
||||
|
|
16
_config.yml
16
_config.yml
|
@ -1,6 +1,18 @@
|
|||
DOWNLOAD_VERSION: 0.8.1
|
||||
ALERT_CLASS:
|
||||
ALERT:
|
||||
|
||||
ALERT_CLASS:
|
||||
all:
|
||||
en:
|
||||
es:
|
||||
fr:
|
||||
nl:
|
||||
|
||||
ALERT:
|
||||
all:
|
||||
en:
|
||||
es:
|
||||
fr:
|
||||
nl:
|
||||
|
||||
langsorder:
|
||||
- id: en
|
||||
|
|
|
@ -10,11 +10,11 @@ cp _layouts/base-en.html _layouts/base-${1}.html
|
|||
sed -i "s_layout: base-en_layout: base-${1}_g" ${1}/*.html
|
||||
sed -i "s_lang: en_lang: ${1}_g" ${1}/*.html
|
||||
sed -i "s_lang: en_lang: ${1}_g" _layouts/base-${1}.html
|
||||
sed -i "s/ALERT_CLASS_en/ALERT_CLASS_${1}/g" _layouts/base-${1}.html
|
||||
sed -i "s/ALERT_en/ALERT_${1}/g" _layouts/base-${1}.html
|
||||
sed -i "/${1}: ${2}/d" _config.yml
|
||||
sed -i "/id: ${1}/d" _config.yml
|
||||
sed -i "/${1}: /d" _config.yml
|
||||
sed -i "/langs:/a - ${1}: ${2}" _config.yml
|
||||
sed -i "s_- ${1}: ${2}_ ${1}: ${2}_g" _config.yml
|
||||
sed -i "/- id: ${1}/d" _config.yml
|
||||
sed -i "/langsorder:/a- id: ${1}" _config.yml
|
||||
sed -i "s_- id:${1}_- id: ${1}_g" _config.yml
|
||||
sed -i "/all:/a- ${1}: " _config.yml
|
||||
sed -i "s_- ${1}_ ${1}_g" _config.yml
|
||||
|
|
|
@ -45,9 +45,9 @@ footer: © Bitcoin Project 2009–2013 Released under the <a href="http://creati
|
|||
<link rel="apple-touch-icon-precomposed" href="/img/logo_ios.png"/>
|
||||
</head>
|
||||
<body>
|
||||
{% if site.ALERT or site.ALERT_en %}
|
||||
{% if site.ALERT_CLASS %}{% assign class = site.ALERT_CLASS%}{% endif %}{% if site.ALERT_CLASS_en %}{% assign class = site.ALERT_CLASS_en%}{% endif %}
|
||||
{% if site.ALERT %}{% assign alert = site.ALERT%}{% endif %}{% if site.ALERT_en %}{% assign alert = site.ALERT_en%}{% endif %}
|
||||
{% if site.ALERT.all or site.ALERT[page.lang] %}
|
||||
{% if site.ALERT_CLASS.all %}{% assign class = site.ALERT_CLASS.all%}{% endif %}{% if site.ALERT_CLASS[page.lang] %}{% assign class = site.ALERT_CLASS[page.lang]%}{% endif %}
|
||||
{% if site.ALERT.all %}{% assign alert = site.ALERT.all%}{% endif %}{% if site.ALERT[page.lang] %}{% assign alert = site.ALERT[page.lang]%}{% endif %}
|
||||
<div class="alert-message {{ class }}">
|
||||
<div><div>{{ alert }}</div></div>
|
||||
</div>
|
||||
|
|
|
@ -43,9 +43,9 @@ footer: © Bitcoin Project 2009–2013 Publicado bajo la <a href="http://creativ
|
|||
<link rel="apple-touch-icon-precomposed" href="/img/logo_ios.png"/>
|
||||
</head>
|
||||
<body>
|
||||
{% if site.ALERT or site.ALERT_es %}
|
||||
{% if site.ALERT_CLASS %}{% assign class = site.ALERT_CLASS%}{% endif %}{% if site.ALERT_CLASS_es %}{% assign class = site.ALERT_CLASS_es%}{% endif %}
|
||||
{% if site.ALERT %}{% assign alert = site.ALERT%}{% endif %}{% if site.ALERT_es %}{% assign alert = site.ALERT_es%}{% endif %}
|
||||
{% if site.ALERT.all or site.ALERT[page.lang] %}
|
||||
{% if site.ALERT_CLASS.all %}{% assign class = site.ALERT_CLASS.all%}{% endif %}{% if site.ALERT_CLASS[page.lang] %}{% assign class = site.ALERT_CLASS[page.lang]%}{% endif %}
|
||||
{% if site.ALERT.all %}{% assign alert = site.ALERT.all%}{% endif %}{% if site.ALERT[page.lang] %}{% assign alert = site.ALERT[page.lang]%}{% endif %}
|
||||
<div class="alert-message {{ class }}">
|
||||
<div><div>{{ alert }}</div></div>
|
||||
</div>
|
||||
|
|
|
@ -43,9 +43,9 @@ footer: © Bitcoin Project 2009–2013 Publié sous la <a href="http://creativec
|
|||
<link rel="apple-touch-icon-precomposed" href="/img/logo_ios.png"/>
|
||||
</head>
|
||||
<body>
|
||||
{% if site.ALERT or site.ALERT_fr %}
|
||||
{% if site.ALERT_CLASS %}{% assign class = site.ALERT_CLASS%}{% endif %}{% if site.ALERT_CLASS_fr %}{% assign class = site.ALERT_CLASS_fr%}{% endif %}
|
||||
{% if site.ALERT %}{% assign alert = site.ALERT%}{% endif %}{% if site.ALERT_fr %}{% assign alert = site.ALERT_fr%}{% endif %}
|
||||
{% if site.ALERT.all or site.ALERT[page.lang] %}
|
||||
{% if site.ALERT_CLASS.all %}{% assign class = site.ALERT_CLASS.all%}{% endif %}{% if site.ALERT_CLASS[page.lang] %}{% assign class = site.ALERT_CLASS[page.lang]%}{% endif %}
|
||||
{% if site.ALERT.all %}{% assign alert = site.ALERT.all%}{% endif %}{% if site.ALERT[page.lang] %}{% assign alert = site.ALERT[page.lang]%}{% endif %}
|
||||
<div class="alert-message {{ class }}">
|
||||
<div><div>{{ alert }}</div></div>
|
||||
</div>
|
||||
|
|
|
@ -43,9 +43,9 @@ footer: © Bitcoin Project 2009–2013 Beschikbaar onder de <a href="http://crea
|
|||
<link rel="apple-touch-icon-precomposed" href="/img/logo_ios.png"/>
|
||||
</head>
|
||||
<body>
|
||||
{% if site.ALERT or site.ALERT_nl %}
|
||||
{% if site.ALERT_CLASS %}{% assign class = site.ALERT_CLASS%}{% endif %}{% if site.ALERT_CLASS_nl %}{% assign class = site.ALERT_CLASS_nl%}{% endif %}
|
||||
{% if site.ALERT %}{% assign alert = site.ALERT%}{% endif %}{% if site.ALERT_nl %}{% assign alert = site.ALERT_nl%}{% endif %}
|
||||
{% if site.ALERT.all or site.ALERT[page.lang] %}
|
||||
{% if site.ALERT_CLASS.all %}{% assign class = site.ALERT_CLASS.all%}{% endif %}{% if site.ALERT_CLASS[page.lang] %}{% assign class = site.ALERT_CLASS[page.lang]%}{% endif %}
|
||||
{% if site.ALERT.all %}{% assign alert = site.ALERT.all%}{% endif %}{% if site.ALERT[page.lang] %}{% assign alert = site.ALERT[page.lang]%}{% endif %}
|
||||
<div class="alert-message {{ class }}">
|
||||
<div><div>{{ alert }}</div></div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue