Optimize url filters

This commit is contained in:
Cotes Chung 2021-01-18 23:27:43 +08:00
parent ab0e3f6ee4
commit 75e9feb687
4 changed files with 7 additions and 7 deletions

View file

@ -13,13 +13,13 @@
</p>
</div>
<script src="{{ site.baseurl }}/assets/js/lib/jquery.disqusloader.min.js"></script>
<script src="{{ '/assets/js/lib/jquery.disqusloader.min.js' | relative_url }}"></script>
<script>
var options = {
scriptUrl: '//{{ site.disqus.shortname }}.disqus.com/embed.js',
disqusConfig: function() {
this.page.url = '{{ site.url | append: site.baseurl | append: page.url }}';
this.page.url = '{{ page.url | absolute_url }}';
this.page.identifier = '{{ page.url }}';
}
};

View file

@ -11,7 +11,7 @@
<span class="share-label text-muted mr-1">{{ site.data.share.label }}</span>
<span class="share-icons">
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
{% assign url = page.url | relative_url | prepend: site.url %}
{% assign url = page.url | absolute_url %}
{% for share in site.data.share.platforms %}
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}

View file

@ -25,7 +25,7 @@
SimpleJekyllSearch({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('search-results'),
json: '{{ site.baseurl }}/assets/js/data/search.json',
json: '{{ '/assets/js/data/search.json' | relative_url }}',
searchResultTemplate: '{{ result_elem | strip_newlines }}',
noResultsText: '{{ not_found }}'
});

View file

@ -12,4 +12,4 @@ User-agent: *
Disallow: /norobots/
Sitemap: {{ site.url | append: site.baseurl }}/sitemap.xml
Sitemap: {{ '/sitemap.xml' | absolute_url }}