Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using locale & language tags from page instead of site #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions _includes/author-profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h3 class="author__name p-name" itemprop="name">
</div>

<div class="author__urls-wrapper">
<button class="btn btn--inverse">{{ site.data.ui-text[site.locale].follow_label | remove: ":" | default: "Follow" }}</button>
<button class="btn btn--inverse">{{ site.data.ui-text[page.locale].follow_label | remove: ":" | default: "Follow" }}</button>
<ul class="author__urls social-icons">
{% if author.location %}
<li itemprop="homeLocation" itemscope itemtype="https://schema.org/Place">
Expand All @@ -42,7 +42,7 @@ <h3 class="author__name p-name" itemprop="name">
{% if author.uri %}
<li>
<a href="{{ author.uri }}" itemprop="url" rel="me">
<i class="fas fa-fw fa-link" aria-hidden="true"></i><span class="label">{{ site.data.ui-text[site.locale].website_label | default: "Website" }}</span>
<i class="fas fa-fw fa-link" aria-hidden="true"></i><span class="label">{{ site.data.ui-text[page.locale].website_label | default: "Website" }}</span>
</a>
</li>
{% endif %}
Expand All @@ -51,7 +51,7 @@ <h3 class="author__name p-name" itemprop="name">
<li>
<a href="mailto:{{ author.email }}" rel="me" class="u-email">
<meta itemprop="email" content="{{ author.email }}" />
<i class="fas fa-fw fa-envelope-square" aria-hidden="true"></i><span class="label">{{ site.data.ui-text[site.locale].email_label | default: "Email" }}</span>
<i class="fas fa-fw fa-envelope-square" aria-hidden="true"></i><span class="label">{{ site.data.ui-text[page.locale].email_label | default: "Email" }}</span>
</a>
</li>
{% endif %}
Expand Down Expand Up @@ -235,7 +235,7 @@ <h3 class="author__name p-name" itemprop="name">
{% if author.vine %}
<li>
<a href="https://vine.co/u/{{ author.vine }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-vine" aria-hidden="true"></i><span class="label">{{ site.data.ui-text[site.locale].email_label | default: "Email" }}</span>
<i class="fab fa-fw fa-vine" aria-hidden="true"></i><span class="label">{{ site.data.ui-text[page.locale].email_label | default: "Email" }}</span>
</a>
</li>
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions _includes/breadcrumbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
{% for crumb in crumbs offset: 1 %}
{% if forloop.first %}
<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ '/' | relative_url }}" itemprop="item"><span itemprop="name">{{ site.data.ui-text[site.locale].breadcrumb_home_label | default: "Home" }}</span></a>
<a href="{{ '/' | relative_url }}" itemprop="item"><span itemprop="name">{{ site.data.ui-text[page.locale].breadcrumb_home_label | default: "Home" }}</span></a>

<meta itemprop="position" content="{{ i }}" />
</li>
<span class="sep">{{ site.data.ui-text[site.locale].breadcrumb_separator | default: "/" }}</span>
<span class="sep">{{ site.data.ui-text[page.locale].breadcrumb_separator | default: "/" }}</span>
{% endif %}
{% if forloop.last %}
<li class="current">{{ page.title }}</li>
Expand All @@ -33,7 +33,7 @@
<a href="{{ crumb | downcase | replace: '%20', '-' | prepend: path_type | prepend: crumb_path | relative_url }}" itemprop="item"><span itemprop="name">{{ crumb | replace: '-', ' ' | replace: '%20', ' ' | capitalize }}</span></a>
<meta itemprop="position" content="{{ i }}" />
</li>
<span class="sep">{{ site.data.ui-text[site.locale].breadcrumb_separator | default: "/" }}</span>
<span class="sep">{{ site.data.ui-text[page.locale].breadcrumb_separator | default: "/" }}</span>
{% endif %}
{% endfor %}
</ol>
Expand Down
2 changes: 1 addition & 1 deletion _includes/category-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% assign categories_sorted = page.categories | sort_natural %}

<p class="page__taxonomy">
<strong><i class="fas fa-fw fa-folder-open" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].categories_label | default: "Categories:" }} </strong>
<strong><i class="fas fa-fw fa-folder-open" aria-hidden="true"></i> {{ site.data.ui-text[page.locale].categories_label | default: "Categories:" }} </strong>
<span itemprop="keywords">
{% for category_word in categories_sorted %}
<a href="{{ category_word | slugify | prepend: path_type | prepend: site.category_archive.path | relative_url }}" class="page__taxonomy-item p-category" rel="tag">{{ category_word }}</a>{% unless forloop.last %}<span class="sep">, </span>{% endunless %}
Expand Down
10 changes: 5 additions & 5 deletions _includes/comments-providers/staticman.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
var form = this;

$(form).addClass('disabled');
$('#comment-form-submit').html('<i class="fas fa-spinner fa-spin fa-fw"></i> {{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}');
$('#comment-form-submit').html('<i class="fas fa-spinner fa-spin fa-fw"></i> {{ site.data.ui-text[page.locale].loading_label | default: "Loading..." }}');

$.ajax({
type: $(this).attr('method'),
url: $(this).attr('action'),
data: $(this).serialize(),
contentType: 'application/x-www-form-urlencoded',
success: function (data) {
$('#comment-form-submit').html('{{ site.data.ui-text[site.locale].comment_btn_submitted | default: "Submitted" }}');
$('#comment-form-submit').html('{{ site.data.ui-text[page.locale].comment_btn_submitted | default: "Submitted" }}');
$('.page__comments-form .js-notice').removeClass('notice--danger');
$('.page__comments-form .js-notice').addClass('notice--success');
showAlert('{{ site.data.ui-text[site.locale].comment_success_msg | default: "Thanks for your comment! It will show on the site once it has been approved." }}');
showAlert('{{ site.data.ui-text[page.locale].comment_success_msg | default: "Thanks for your comment! It will show on the site once it has been approved." }}');
},
error: function (err) {
console.log(err);
$('#comment-form-submit').html('{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}');
$('#comment-form-submit').html('{{ site.data.ui-text[page.locale].comment_btn_submit | default: "Submit Comment" }}');
$('.page__comments-form .js-notice').removeClass('notice--success');
$('.page__comments-form .js-notice').addClass('notice--danger');
showAlert('{{ site.data.ui-text[site.locale].comment_error_msg | default: "Sorry, there was an error with your submission. Please make sure all required fields have been completed and try again." }}');
showAlert('{{ site.data.ui-text[page.locale].comment_error_msg | default: "Sorry, there was an error with your submission. Please make sure all required fields have been completed and try again." }}');
$(form).removeClass('disabled');
}
});
Expand Down
10 changes: 5 additions & 5 deletions _includes/comments-providers/staticman_v2.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
var form = this;

$(form).addClass('disabled');
$('#comment-form-submit').html('<i class="fas fa-spinner fa-spin fa-fw"></i> {{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}');
$('#comment-form-submit').html('<i class="fas fa-spinner fa-spin fa-fw"></i> {{ site.data.ui-text[page.locale].loading_label | default: "Loading..." }}');

$.ajax({
type: $(this).attr('method'),
url: $(this).attr('action'),
data: $(this).serialize(),
contentType: 'application/x-www-form-urlencoded',
success: function (data) {
$('#comment-form-submit').html('{{ site.data.ui-text[site.locale].comment_btn_submitted | default: "Submitted" }}');
$('#comment-form-submit').html('{{ site.data.ui-text[page.locale].comment_btn_submitted | default: "Submitted" }}');
$('.page__comments-form .js-notice').removeClass('notice--danger');
$('.page__comments-form .js-notice').addClass('notice--success');
showAlert('{{ site.data.ui-text[site.locale].comment_success_msg | default: "Thanks for your comment! It will show on the site once it has been approved." }}');
showAlert('{{ site.data.ui-text[page.locale].comment_success_msg | default: "Thanks for your comment! It will show on the site once it has been approved." }}');
},
error: function (err) {
console.log(err);
$('#comment-form-submit').html('{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}');
$('#comment-form-submit').html('{{ site.data.ui-text[page.locale].comment_btn_submit | default: "Submit Comment" }}');
$('.page__comments-form .js-notice').removeClass('notice--success');
$('.page__comments-form .js-notice').addClass('notice--danger');
showAlert('{{ site.data.ui-text[site.locale].comment_error_msg | default: "Sorry, there was an error with your submission. Please make sure all required fields have been completed and try again." }}');
showAlert('{{ site.data.ui-text[page.locale].comment_error_msg | default: "Sorry, there was an error with your submission. Please make sure all required fields have been completed and try again." }}');
$(form).removeClass('disabled');
}
});
Expand Down
42 changes: 21 additions & 21 deletions _includes/comments.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="page__comments">
{% capture comments_label %}{{ site.data.ui-text[site.locale].comments_label | default: "Comments" }}{% endcapture %}
{% capture comments_label %}{{ site.data.ui-text[page.locale].comments_label | default: "Comments" }}{% endcapture %}
{% case site.comments.provider %}
{% when "discourse" %}
<h4 class="page__comments-title">{{ comments_label }}</h4>
Expand All @@ -16,7 +16,7 @@ <h4 class="page__comments-title">{{ comments_label }}</h4>
<!-- Start static comments -->
<div class="js-comments">
{% if site.data.comments[page.slug] %}
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}</h4>
<h4 class="page__comments-title">{{ site.data.ui-text[page.locale].comments_title | default: "Comments" }}</h4>
{% assign comments = site.data.comments[page.slug] %}

<!-- In order to sort by date we must have an array of objects, not an array of arrays, so
Expand All @@ -42,29 +42,29 @@ <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_titl

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

<div class="form-group">
<label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label>
<label for="comment-form-message">{{ site.data.ui-text[page.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>
<div class="small help-block"><a href="https://daringfireball.net/projects/markdown/">{{ site.data.ui-text[page.locale].comment_form_md_info | default: "Markdown is supported." }}</a></div>
</div>
<div class="form-group">
<label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label>
<label for="comment-form-name">{{ site.data.ui-text[page.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label>
<input type="text" id="comment-form-name" name="fields[name]" tabindex="2" />
</div>
<div class="form-group">
<label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label>
<label for="comment-form-email">{{ site.data.ui-text[page.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" />
</div>
<div class="form-group">
<label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label>
<label for="comment-form-url">{{ site.data.ui-text[page.locale].comment_form_website_label | default: "Website (optional)" }}</label>
<input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/>
</div>
<div class="form-group hidden" style="display: none;">
Expand All @@ -85,7 +85,7 @@ <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_labe
</div>
{% endif %}
<div class="form-group">
<button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--primary btn--large">{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}</button>
<button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--primary btn--large">{{ site.data.ui-text[page.locale].comment_btn_submit | default: "Submit Comment" }}</button>
</div>
</form>
</div>
Expand All @@ -99,7 +99,7 @@ <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_labe
<!-- Start static comments -->
<div class="js-comments">
{% if site.data.comments[page.slug] %}
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}</h4>
<h4 class="page__comments-title">{{ site.data.ui-text[page.locale].comments_title | default: "Comments" }}</h4>
{% assign comments = site.data.comments[page.slug] %}

<!-- In order to sort by date we must have an array of objects, not an array of arrays, so
Expand All @@ -125,29 +125,29 @@ <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_titl

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

<div class="form-group">
<label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label>
<label for="comment-form-message">{{ site.data.ui-text[page.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>
<div class="small help-block"><a href="https://daringfireball.net/projects/markdown/">{{ site.data.ui-text[page.locale].comment_form_md_info | default: "Markdown is supported." }}</a></div>
</div>
<div class="form-group">
<label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label>
<label for="comment-form-name">{{ site.data.ui-text[page.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label>
<input type="text" id="comment-form-name" name="fields[name]" tabindex="2" />
</div>
<div class="form-group">
<label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label>
<label for="comment-form-email">{{ site.data.ui-text[page.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" />
</div>
<div class="form-group">
<label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label>
<label for="comment-form-url">{{ site.data.ui-text[page.locale].comment_form_website_label | default: "Website (optional)" }}</label>
<input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/>
</div>
<div class="form-group hidden" style="display: none;">
Expand All @@ -161,7 +161,7 @@ <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_labe
</p>
<!-- End comment form alert messaging -->
<div class="form-group">
<button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--primary btn--large">{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}</button>
<button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--primary btn--large">{{ site.data.ui-text[page.locale].comment_btn_submit | default: "Submit Comment" }}</button>
</div>
</form>
</div>
Expand Down
Loading