Skip to content

Commit

Permalink
Updates to pagination, js, page views
Browse files Browse the repository at this point in the history
- Page views #35
- Pagination issue fixed by @sree24 #36
- some js updates from colorlib
  • Loading branch information
balaramadurai committed Mar 3, 2021
1 parent 2008b87 commit cf8633b
Show file tree
Hide file tree
Showing 10 changed files with 254 additions and 152 deletions.
281 changes: 149 additions & 132 deletions assets/style.css

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions layouts/partials/article_footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@
</span>
{{ end }}
{{ end }}

{{ if .Site.Params.Views.enable }}
<div class="views">
<span class="views">
<img src="https://visitor-badge.glitch.me/badge?page_id={{ .Permalink }}" alt="Views"/>
</span>
</div>
{{ end }}
{{ if and (not (eq .Site.DisqusShortname "")) (not .Params.disable_comments) }}
<span class="comments">
<a href="{{ .Permalink }}#disqus_thread">{{with .Site.Data.l10n.articles.comments}}{{.}}{{end}}
Expand Down
12 changes: 6 additions & 6 deletions layouts/partials/footer_js.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
</script>
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
{{ end }}
<script type='text/javascript' src="{{ .Site.BaseURL }}js/jquery.js"></script>
<script type='text/javascript' src="{{ .Site.BaseURL }}js/jquery-migrate.min.js"></script>
<script type='text/javascript' src="{{ .Site.BaseURL }}js/functions.min.js"></script>
<script type='text/javascript' src="{{ .Site.BaseURL }}js/jquery.min.js" id='jquery-core-js'></script>
<script type='text/javascript' src="{{ .Site.BaseURL }}js/jquery-migrate.min.js" id='jquery-migrate-js'</script>
<script type='text/javascript' src="{{ .Site.BaseURL }}js/functions.min.js" id='travelify_functions-js'></script>
<!-- <script type='text/javascript' src="{{ .Site.BaseURL }}js/admin-bar.min.js"></script> -->
<script type='text/javascript' src="{{ .Site.BaseURL }}js/jquery.cycle.all.min.js"></script>
<script type='text/javascript' src="{{ .Site.BaseURL }}js/jquery.cycle.all.min.js" id='jquery_cycle-js'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var travelify_slider_value = {"transition_effect":"fade","transition_delay":"4000","transition_duration":"1000"};
/* ]]> */
</script>
<script type='text/javascript' src="{{ .Site.BaseURL }}js/slider-settings.min.js"></script>
<script type='text/javascript' src="{{ .Site.BaseURL }}js/wp-embed.min.js"></script>
<script type='text/javascript' src="{{ .Site.BaseURL }}js/slider-settings.min.js" id='travelify_slider-js'></script>
<script type='text/javascript' src="{{ .Site.BaseURL }}js/wp-embed.min.js" id='wp-embed-js'></script>
<link rel='stylesheet' id='font-awesome-css' href="{{ .Site.BaseURL }}css/font-awesome.min.css" type='text/css' media='all' />
<!--[if lte IE 8]>
<script type="text/javascript">
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
{{ if .Paginator.HasPrev }}
<li class="previous">
<a class="extend prev" rel="prev" href="{{ .Paginator.Prev.URL | absURL }}">
<a class="extend prev" rel="prev" href="{{ .Paginator.Prev.URL }}">
« {{ with .Site.Data.l10n.pagination.previous }}{{ . }}{{ end }}
</a>
</li>
{{ end }}
{{ if .Paginator.HasNext }}
<li class="next">
<a class="extend next" rel="next" href="{{ .Paginator.Next.URL | absURL }}">
<a class="extend next" rel="next" href="{{ .Paginator.Next.URL }}">
{{ with .Site.Data.l10n.pagination.next }}{{ . }}{{ end }} »
</a>
</li>
Expand Down
6 changes: 4 additions & 2 deletions static/js/jquery-migrate.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions static/js/jquery.cycle.all.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions static/js/jquery.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/js/slider-settings.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 78 additions & 8 deletions static/js/tinynav.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,82 @@
/* Theme front end features */
/*! http://tinynav.viljamis.com v1.2 by @viljamis */
(function ($, window, i) {
$.fn.tinyNav = function (options) {

/* Mobile menu
/*! http://tinynav.viljamis.com v1.1 by @viljamis */
// Default settings
var settings = $.extend({
'active' : 'selected', // String: Set the "active" class
'header' : '', // String: Specify text for "header" and show header instead of the active item
'indent' : '- ', // String: Specify text for indenting sub-items
'label' : '' // String: sets the <label> text for the <select> (if not set, no label will be added)
}, options);

!function(e,t,a){e.fn.tinyNav=function(n){var i=e.extend({active:"current-menu-item",header:!1},n);return this.each(function(){a++;var n=e(this),l="tinynav",r=l+a,o=".l_"+r,c=e("<select/>").addClass(l+" "+r);if(n.is("ul,ol")){var s="";n.addClass("l_"+r).find("a").each(function(){s+='<option value="'+e(this).attr("href")+'">';var t;for(t=0;t<e(this).parents("ul, ol").length-1;t++)s+="- ";s+=e(this).text()+"</option>"}),c.append(s),i.header||c.find(":eq("+e(o+" li").index(e(o+" li."+i.active))+")").attr("selected",!0),c.change(function(){t.location.href=e(this).val()}),e(o).after(c),i.label&&c.before(e("<label/>").attr("for",r).addClass(l+"_label "+r+"_label").append(i.label))}})}}(jQuery,this,0),jQuery(function(){jQuery("#main-nav .root").tinyNav({active:"current-menu-item"})});
return this.each(function () {

/**
* Animated back to top
*/
// Used for namespacing
i++;

jQuery(document).ready(function(){jQuery(".back-to-top").hide();jQuery(function(){jQuery(window).scroll(function(){if(jQuery(this).scrollTop()>1e3){jQuery(".back-to-top").fadeIn()}else{jQuery(".back-to-top").fadeOut()}});jQuery(".back-to-top a").click(function(){jQuery("body,html,header").animate({scrollTop:0},1e3);return false})})})
var $nav = $(this),
// Namespacing
namespace = 'tinynav',
namespace_i = namespace + i,
l_namespace_i = '.l_' + namespace_i,
$select = $('<select/>').attr("id", namespace_i).addClass(namespace + ' ' + namespace_i);

if ($nav.is('ul,ol')) {

if (settings.header !== '') {
$select.append(
$('<option/>').text(settings.header)
);
}

// Build options
var options = '';

$nav
.addClass('l_' + namespace_i)
.find('a')
.each(function () {
options += '<option value="' + $(this).attr('href') + '">';
var j;
for (j = 0; j < $(this).parents('ul, ol').length - 1; j++) {
options += settings.indent;
}
options += $(this).text() + '</option>';
});

// Append options into a select
$select.append(options);

// Select the active item
if (!settings.header) {
$select
.find(':eq(' + $(l_namespace_i + ' li')
.index($(l_namespace_i + ' li.' + settings.active)) + ')')
.attr('selected', true);
}

// Change window location
$select.change(function () {
window.location.href = $(this).val();
});

// Inject select
$(l_namespace_i).after($select);

// Inject label
if (settings.label) {
$select.before(
$("<label/>")
.attr("for", namespace_i)
.addClass(namespace + '_label ' + namespace_i + '_label')
.append(settings.label)
);
}

}

});

};
})(jQuery, this, 0);
3 changes: 2 additions & 1 deletion static/js/wp-embed.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cf8633b

Please sign in to comment.