Skip to content

Commit

Permalink
Some minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Mar 11, 2020
1 parent 78fcb3c commit 222b740
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/DATA-FILES.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This method relies on Hexo [Data files](https://hexo.io/docs/data-files.html). B
### Usage

1. Please ensure you are using Hexo 3 (or above).
2. Create an file named `next.yml` in site's `/source/_data` directory (create `_data` directory if it did not exists).
2. Create an file named `next.yml` in site's `/source/_data` directory (create `_data` directory if it does not exist).

<p align="center">And after that steps there are <b>2 variants</b>, need to <b>choose only one</b> of them and <b>resume next steps</b>.</p>

Expand Down
24 changes: 12 additions & 12 deletions layout/_partials/post/post-followme.swig
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
<p>{{ __('follow_me.welcome') }}</p>

<div class="social-list">
{%- for name, value in theme.follow_me %}
{%- set link = value.split('||')[0] | trim %}
{%- set icon = value.split('||')[1] | trim %}
{%- for name, value in theme.follow_me %}
{%- set link = value.split('||')[0] | trim %}
{%- set icon = value.split('||')[1] | trim %}

<div class="social-item">
<a target="_blank" class="social-link" href="{{ link }}">
<span class="icon">
<i class="fa fa-{{ icon }}"></i>
</span>
<div class="social-item">
<a target="_blank" class="social-link" href="{{ link }}">
<span class="icon">
<i class="fa fa-{{ icon }}"></i>
</span>

<span class="label">{{ name }}</span>
</a>
</div>
{%- endfor %}
<span class="label">{{ name }}</span>
</a>
</div>
{%- endfor %}
</div>
</div>
{%- endif %}
2 changes: 1 addition & 1 deletion layout/_partials/sidebar/site-overview.swig
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
{%- if theme.chat.enable and theme.chat.service !== '' %}
<div class="sidebar-button motion-element">
{%- if theme.chat.service == 'chatra' and theme.chatra.enable %}
<a onclick="Chatra('openChat', true)">
<a onclick="Chatra('openChat', true);">
{%- endif %}
{%- if theme.chat.service == 'tidio' and theme.tidio.enable %}
<a onclick="tidioChatApi.open();">
Expand Down
9 changes: 4 additions & 5 deletions source/js/local-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,6 @@ window.addEventListener('DOMContentLoaded', () => {
fetch(CONFIG.root + searchPath)
.then(response => response.text())
.then(res => {
// Remove loading animation
document.getElementById('no-result').innerHTML = '<i class="fa fa-search fa-5x"></i>';
input.focus();

// Get the contents from search data
isfetched = true;
datas = isXml ? [...new DOMParser().parseFromString(res, 'text/xml').querySelectorAll('entry')].map(element => {
Expand All @@ -248,6 +244,8 @@ window.addEventListener('DOMContentLoaded', () => {
data.url = decodeURIComponent(data.url).replace(/\/{2,}/g, '/');
return data;
});
// Remove loading animation
document.getElementById('no-result').innerHTML = '<i class="fa fa-search fa-5x"></i>';
});
};

Expand All @@ -271,7 +269,8 @@ window.addEventListener('DOMContentLoaded', () => {
element.addEventListener('click', () => {
document.body.style.overflow = 'hidden';
document.querySelector('.search-pop-overlay').style.display = 'block';
isfetched ? input.focus() : fetchData();
input.focus();
if (!isfetched) fetchData();
});
});

Expand Down

0 comments on commit 222b740

Please sign in to comment.