Skip to content

Commit cf1d8d3

Browse files
mjangcallahad
andauthored
Include a "standard" link to the list of discussions (#153)
Co-authored-by: Mike Jang <[email protected]> Co-authored-by: Dan Callahan <[email protected]>
1 parent 4f116f7 commit cf1d8d3

File tree

4 files changed

+35
-7
lines changed

4 files changed

+35
-7
lines changed

source/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
""".format(release_date)
3333

3434
edit_on_github_project = 'nginx/unit-docs'
35+
edit_on_github_discussion = 'nginx/unit'
3536
edit_on_github_branch = 'main'
3637

3738
exclude_patterns = ['include']

source/exts/github.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
layout.html:
1010
{% if edit_on_github_url %}
11-
<div class="nxt_github_link">
11+
<div class="nxt_edit_link">
1212
<a href="{{ edit_on_github_url }}"><div></div>Edit this page</a>
1313
</div>
1414
{% endif %}

source/theme/layout.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ <h1>
119119
<div id="content">
120120
{% block body %} {% endblock %}
121121
{% if edit_on_github_url %}
122-
<div class="nxt_github_link"><a href="{{ edit_on_github_url }}"><div></div>Edit this page</a></div>
122+
<div class="nxt_edit_link"><a href="{{ edit_on_github_url }}"><div></div>Edit this page</a></div>
123+
{% endif %}
124+
{% if edit_on_github_url %}
125+
<div class="nxt_discuss_link"><a href="https://github.com/nginx/unit/discussions/"><div></div>Discuss on GitHub</a></div>
123126
{% endif %}
124127
<p id="footer">
125128
© {{copyright}} <a href="https://www.nginx.com/">{{author}}</a>

source/theme/static/style.css

+29-5
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ iframe {
697697
visibility: hidden;
698698
}
699699
/* GitHub link */
700-
.nxt_github_link {
700+
.nxt_discuss_link {
701701
position: relative;
702702
font-size: .9em;
703703
right: 0;
@@ -706,7 +706,23 @@ iframe {
706706
display: block;
707707
text-align: right;
708708
}
709-
.nxt_github_link div {
709+
.nxt_discuss_link div {
710+
display: inline-block;
711+
height: 1em;
712+
margin: 0 .3em -.2em 0;
713+
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176c0 38.6 14.7 74.3 39.6 103.4c-3.5 9.4-8.7 17.7-14.2 24.7c-4.8 6.2-9.7 11-13.3 14.3c-1.8 1.6-3.3 2.9-4.3 3.7c-.5 .4-.9 .7-1.1 .8l-.2 .2 0 0 0 0C1 327.2-1.4 334.4 .8 340.9S9.1 352 16 352c21.8 0 43.8-5.6 62.1-12.5c9.2-3.5 17.8-7.4 25.3-11.4C134.1 343.3 169.8 352 208 352zM448 176c0 112.3-99.1 196.9-216.5 207C255.8 457.4 336.4 512 432 512c38.2 0 73.9-8.7 104.7-23.9c7.5 4 16 7.9 25.2 11.4c18.3 6.9 40.3 12.5 62.1 12.5c6.9 0 13.1-4.5 15.2-11.1c2.1-6.6-.2-13.8-5.8-17.9l0 0 0 0-.2-.2c-.2-.2-.6-.4-1.1-.8c-1-.8-2.5-2-4.3-3.7c-3.6-3.3-8.5-8.1-13.3-14.3c-5.5-7-10.7-15.4-14.2-24.7c24.9-29 39.6-64.7 39.6-103.4c0-92.8-84.9-168.9-192.6-175.5c.4 5.1 .6 10.3 .6 15.5z"/></svg>');
714+
}
715+
/* Edit link */
716+
.nxt_edit_link {
717+
position: relative;
718+
font-size: .9em;
719+
right: 0;
720+
bottom: 0;
721+
padding: 0;
722+
display: block;
723+
text-align: right;
724+
}
725+
.nxt_edit_link div {
710726
display: inline-block;
711727
height: 1em;
712728
margin: 0 .3em -.2em 0;
@@ -731,7 +747,9 @@ iframe {
731747
font-weight: bold;
732748
}
733749
@media (min-width: 45em) {
734-
.nxt_github_link {
750+
.nxt_edit_link {
751+
}
752+
.nxt_discuss_link {
735753
}
736754
}
737755
@media (max-width: 45em) {
@@ -766,7 +784,10 @@ iframe {
766784
.nxt_tabs > input.js:checked + label {
767785
order: 1;
768786
}
769-
.nxt_github_link {
787+
.nxt_edit_link {
788+
display: none;
789+
}
790+
.nxt_discuss_link {
770791
display: none;
771792
}
772793
}
@@ -792,7 +813,10 @@ iframe {
792813
background: #343434;
793814
color: #FFFFFF;
794815
}
795-
.nxt_github_link div {
816+
.nxt_edit_link div {
817+
filter: invert(1);
818+
}
819+
.nxt_discuss_link div {
796820
filter: invert(1);
797821
}
798822
#side .toctree-l2 ul:after {

0 commit comments

Comments
 (0)