Skip to content

Commit c1d1b15

Browse files
lsolesenmmistakes
authored andcommittedAug 22, 2017
Do not print the comments form (mmistakes#1195)
Add `.page__comments-form` to "non-printing" selectors in print styles
1 parent 2bc2a7c commit c1d1b15

File tree

2 files changed

+43
-40
lines changed

2 files changed

+43
-40
lines changed
 

‎_includes/comments.html

+41-39
Original file line numberDiff line numberDiff line change
@@ -47,49 +47,51 @@ <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_titl
4747
<!-- End static comments -->
4848

4949
<!-- Start new comment form -->
50-
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4>
51-
<p class="small">{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} <span class="required">*</span></p>
52-
<form id="new_comment" class="page__comments-form js-form form" method="post" action="https://api.staticman.net/v1/entry/{{ site.repository }}/{{ site.staticman.branch }}">
53-
<div class="form__spinner">
54-
<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i>
55-
<span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span>
56-
</div>
50+
<div class="page__comments-form">
51+
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4>
52+
<p class="small">{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} <span class="required">*</span></p>
53+
<form id="new_comment" class="page__comments-form js-form form" method="post" action="https://api.staticman.net/v1/entry/{{ site.repository }}/{{ site.staticman.branch }}">
54+
<div class="form__spinner">
55+
<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i>
56+
<span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span>
57+
</div>
5758

58-
<fieldset>
59-
<label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label>
60-
<textarea type="text" rows="3" id="comment-form-message" name="fields[message]" tabindex="1"></textarea>
61-
<div class="small help-block"><a href="https://daringfireball.net/projects/markdown/">{{ site.data.ui-text[site.locale].comment_form_md_info | default: "Markdown is supported." }}</a></div>
62-
</fieldset>
63-
<fieldset>
64-
<label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label>
65-
<input type="text" id="comment-form-name" name="fields[name]" tabindex="2" />
66-
</fieldset>
67-
<fieldset>
68-
<label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label>
69-
<input type="email" id="comment-form-email" name="fields[email]" tabindex="3" />
70-
</fieldset>
71-
<fieldset>
72-
<label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label>
73-
<input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/>
74-
</fieldset>
75-
<fieldset class="hidden" style="display: none;">
76-
<input type="hidden" name="options[slug]" value="{{ page.slug }}">
77-
<label for="comment-form-location">Not used. Leave blank if you are a human.</label>
78-
<input type="text" id="comment-form-location" name="fields[hidden]" autocomplete="off"/>
79-
</fieldset>
80-
<!-- Start comment form alert messaging -->
81-
<p class="hidden js-notice">
82-
<strong class="js-notice-text"></strong>
83-
</p>
84-
<!-- End comment form alert messaging -->
85-
<fieldset>
86-
<button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--large">{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}</button>
87-
</fieldset>
88-
</form>
59+
<fieldset>
60+
<label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label>
61+
<textarea type="text" rows="3" id="comment-form-message" name="fields[message]" tabindex="1"></textarea>
62+
<div class="small help-block"><a href="https://daringfireball.net/projects/markdown/">{{ site.data.ui-text[site.locale].comment_form_md_info | default: "Markdown is supported." }}</a></div>
63+
</fieldset>
64+
<fieldset>
65+
<label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label>
66+
<input type="text" id="comment-form-name" name="fields[name]" tabindex="2" />
67+
</fieldset>
68+
<fieldset>
69+
<label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label>
70+
<input type="email" id="comment-form-email" name="fields[email]" tabindex="3" />
71+
</fieldset>
72+
<fieldset>
73+
<label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label>
74+
<input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/>
75+
</fieldset>
76+
<fieldset class="hidden" style="display: none;">
77+
<input type="hidden" name="options[slug]" value="{{ page.slug }}">
78+
<label for="comment-form-location">Not used. Leave blank if you are a human.</label>
79+
<input type="text" id="comment-form-location" name="fields[hidden]" autocomplete="off"/>
80+
</fieldset>
81+
<!-- Start comment form alert messaging -->
82+
<p class="hidden js-notice">
83+
<strong class="js-notice-text"></strong>
84+
</p>
85+
<!-- End comment form alert messaging -->
86+
<fieldset>
87+
<button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--large">{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}</button>
88+
</fieldset>
89+
</form>
90+
</div>
8991
<!-- End new comment form -->
9092
{% endif %}
9193
</section>
9294
{% when "custom" %}
9395
<section id="custom-comments"></section>
9496
{% endcase %}
95-
</div>
97+
</div>

‎_sass/minimal-mistakes/_print.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,12 @@
228228
.pagination,
229229
.ads,
230230
.page__footer,
231+
.page__comments-form,
231232
.author__avatar,
232233
.author__content,
233234
.author__urls-wrapper,
234235
.nav__list,
235236
.adsbygoogle {
236237
display: none !important;
237238
}
238-
}
239+
}

0 commit comments

Comments
 (0)
Please sign in to comment.