Skip to content

Commit 411907b

Browse files
committed
adding badge color variable
Signed-off-by: Vanessa Sochat <[email protected]>
1 parent 2c33749 commit 411907b

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ markdown: kramdown
5050
# If you add tags to pages, you can link them to some external search
5151
# If you want to disable this, comment the URL.
5252
tag_search_endpoint: https://ask.cyberinfrastructure.org/search?q=
53+
tag_color: danger # danger, success, warning, primary, info, secondary
5354

5455
accentColor: red # purple, green, etc.
5556
themeColor: red # purple, green, blue, orange, purple, grey

_includes/tags.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
{% if site.tag_search_endpoint %}<div style="float:right; margin-bottom:30px">{% for tag in page.tags %}
2-
<span class="badge badge-secondary"><a style="cursor:pointer; color:white" href="{{ site.tag_search_endpoint }}{{ tag }}">{{ tag }}</a></span>
3-
{% endfor %}</div>{% endif %}
4-
1+
{% if site.tag_search_endpoint %}{% if page.tags %}<script>
2+
$('h1').first().append('<div>{% for tag in page.tags %}<span class="badge badge-{{ site.tag_color }}"><a style="cursor:pointer; color:white" href="{{ site.tag_search_endpoint }}{{ tag }}">{{ tag }}</a></span>{% endfor %}</div>')</script>{% endif %}{% endif %}

_layouts/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
</main>
1717
</div>
1818
{% include footer.html %}
19+
{% include tags.html %}
1920
{% include scrolltop.html %}
2021
</body>
2122
</html>

_layouts/page.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<div class="md-content">
55
<article class="md-content__inner md-typeset">
66
{{ content }}
7-
{% include tags.html %}
87
{% include toc.html %}
98
{% include editable.html %}
109
</article>

0 commit comments

Comments
 (0)