~xdavidwu/xdavidwu.link

294f8dc7d5b96c930fc9694ec6d8c500cc3977c4 — Lars Olesen 7 years ago b562ea9
Do not print the comments form (#1195)

Add `.page__comments-form` to "non-printing" selectors in print styles
2 files changed, 43 insertions(+), 40 deletions(-)

M _includes/comments.html
M _sass/minimal-mistakes/_print.scss
M _includes/comments.html => _includes/comments.html +41 -39
@@ 47,49 47,51 @@
            <!-- End static comments -->

            <!-- Start new comment form -->
            <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4>
            <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>
            <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 }}">
              <div class="form__spinner">
                <i class="fa fa-spinner fa-spin fa-3x fa-fw"></i>
                <span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span>
              </div>
            <div class="page__comments-form">
              <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4>
              <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>
              <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 }}">
                <div class="form__spinner">
                  <i class="fa fa-spinner fa-spin fa-3x fa-fw"></i>
                  <span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span>
                </div>

              <fieldset>
                <label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label>
                <textarea type="text" rows="3" id="comment-form-message" name="fields[message]" tabindex="1"></textarea>
                <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>
              </fieldset>
              <fieldset>
                <label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label>
                <input type="text" id="comment-form-name" name="fields[name]" tabindex="2" />
              </fieldset>
              <fieldset>
                <label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label>
                <input type="email" id="comment-form-email" name="fields[email]" tabindex="3" />
              </fieldset>
              <fieldset>
                <label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label>
                <input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/>
              </fieldset>
              <fieldset class="hidden" style="display: none;">
                <input type="hidden" name="options[slug]" value="{{ page.slug }}">
                <label for="comment-form-location">Not used. Leave blank if you are a human.</label>
                <input type="text" id="comment-form-location" name="fields[hidden]" autocomplete="off"/>
              </fieldset>
              <!-- Start comment form alert messaging -->
              <p class="hidden js-notice">
                <strong class="js-notice-text"></strong>
              </p>
              <!-- End comment form alert messaging -->
              <fieldset>
                <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>
              </fieldset>
            </form>
                <fieldset>
                  <label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label>
                  <textarea type="text" rows="3" id="comment-form-message" name="fields[message]" tabindex="1"></textarea>
                  <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>
                </fieldset>
                <fieldset>
                  <label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label>
                  <input type="text" id="comment-form-name" name="fields[name]" tabindex="2" />
                </fieldset>
                <fieldset>
                  <label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label>
                  <input type="email" id="comment-form-email" name="fields[email]" tabindex="3" />
                </fieldset>
                <fieldset>
                  <label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label>
                  <input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/>
                </fieldset>
                <fieldset class="hidden" style="display: none;">
                  <input type="hidden" name="options[slug]" value="{{ page.slug }}">
                  <label for="comment-form-location">Not used. Leave blank if you are a human.</label>
                  <input type="text" id="comment-form-location" name="fields[hidden]" autocomplete="off"/>
                </fieldset>
                <!-- Start comment form alert messaging -->
                <p class="hidden js-notice">
                  <strong class="js-notice-text"></strong>
                </p>
                <!-- End comment form alert messaging -->
                <fieldset>
                  <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>
                </fieldset>
              </form>
            </div>
            <!-- End new comment form -->
          {% endif %}
        </section>
      {% when "custom" %}
        <section id="custom-comments"></section>
  {% endcase %}
</div>
\ No newline at end of file
</div>

M _sass/minimal-mistakes/_print.scss => _sass/minimal-mistakes/_print.scss +2 -1
@@ 228,6 228,7 @@
  .pagination,
  .ads,
  .page__footer,
  .page__comments-form,
  .author__avatar,
  .author__content,
  .author__urls-wrapper,


@@ 235,4 236,4 @@
  .adsbygoogle {
    display: none !important;
  }
}
\ No newline at end of file
}