diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 6b66959..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Python package - -on: [push] - -jobs: - build: - - runs-on: ubuntu-18.04 - strategy: - max-parallel: 4 - matrix: - python-version: [2.7, 3.5, 3.6, 3.7] - - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r tests/requirements.txt - pelican-themes -i ../attila - - name: Test with pytest - run: | - cd tests - pytest diff --git a/.gitignore b/.gitignore index c53652a..3752df0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ *.pyc *.log output -tests/.cache/ \ No newline at end of file diff --git a/README.adoc b/README.adoc index ea2556d..b6f3129 100644 --- a/README.adoc +++ b/README.adoc @@ -81,20 +81,14 @@ You can set cover images for your blog, article, page, tag, category and author. The is the cover image for your site main index.html. -To set blog cover, set the property `HOME_COVER` in +To set blog cover, set the property `HEADER_COVER` in `pelicanconf.py`: [source,python] ---- -HOME_COVER = '/assets/images/blog_cover.png' +HEADER_COVER = '/assets/images/blog_cover.png' ---- -[NOTE] -==== -HEADER_COVER property is deprecated. Work around will be use HOME_COVER and use cover in individual articles. -This property will be used if there is no cover image set to an article, page, tag, category, author. -==== - [[article-cover]] ==== Article Cover @@ -173,22 +167,17 @@ For more refer link:#author-bio[author] . === Header Color To define a simple header background color, set the property -`HOME_COLOR` in `pelicanconf.py`: +`HEADER_COLOR` in `pelicanconf.py`: [source,python] ---- -HOME_COLOR = 'black' +HEADER_COLOR = 'black' ---- you can use any valid css color. This will be used if there is no cover image set in link:#articles[article] level and site level. - -[NOTE] -==== -HEADER_COLOR property is deprecated. Work around will be use HOME_COLOR and use color in individual articles. -This property will be used if there is no HEADER_COVER and cover image set to an article, page, tag, category, author. -==== +This property will be used if there is no cover image set to an article, page, tag, category, author. [[social-urls]] === Social URLs diff --git a/static/js/script.js b/static/js/script.js index b2e132e..eeafc08 100644 --- a/static/js/script.js +++ b/static/js/script.js @@ -1,150 +1,5 @@ -jQuery(function($) { - - var body = $('body'); - var html = $('html'); - var viewport = $(window); - - /* ========================================================================== - Menu - ========================================================================== */ - - function menu() { - html.toggleClass('menu-active'); - }; - - $('#menu').on({ - 'click': function() { - menu(); - } - }); - - $('.menu-button').on({ - 'click': function() { - menu(); - } - }); - - $('.hidden-close').on({ - 'click': function() { - menu(); - } - }); - - /* ========================================================================== - Parallax cover - ========================================================================== */ - - var cover = $('.cover'); - var coverPosition = 0; - - function prlx() { - if(cover.length >= 1) { - var windowPosition = viewport.scrollTop(); - (windowPosition > 0) ? coverPosition = Math.floor(windowPosition * 0.25) : coverPosition = 0; - cover.css({ - '-webkit-transform' : 'translate3d(0, ' + coverPosition + 'px, 0)', - 'transform' : 'translate3d(0, ' + coverPosition + 'px, 0)' - }); - (viewport.scrollTop() < cover.height()) ? html.addClass('cover-active') : html.removeClass('cover-active'); - } - } - prlx(); - - viewport.on({ - 'scroll': function() { - prlx(); - }, - 'resize': function() { - prlx(); - }, - 'orientationchange': function() { - prlx(); - } - }); - - /* ========================================================================== - Reading Progress - ========================================================================== */ - - var post = $('.post-content'); - - function readingProgress() { - if(post.length >= 1) { - var postBottom = post.offset().top + post.height(); - var windowBottom = viewport.scrollTop() + viewport.height(); - var progress = 100 - (((postBottom - windowBottom) / (postBottom - viewport.height())) * 100); - $('.progress-bar').css('width', progress + '%'); - (progress > 100) ? $('.progress-container').addClass('ready') : $('.progress-container').removeClass('ready'); - } - } - readingProgress(); - - viewport.on({ - 'scroll': function() { - readingProgress(); - }, - 'resize': function() { - readingProgress(); - }, - 'orientationchange': function() { - readingProgress(); - } - }); - - /* ========================================================================== - Gallery - ========================================================================== */ - - function gallery() { - var images = document.querySelectorAll('.kg-gallery-image img'); - images.forEach(function (image) { - var container = image.closest('.kg-gallery-image'); - var width = image.attributes.width.value; - var height = image.attributes.height.value; - var ratio = width / height; - container.style.flex = ratio + ' 1 0%'; - }); - } - gallery(); - - /* ========================================================================== - Style code blocks with highlight and numbered lines - ========================================================================== */ - - function codestyling() { - $('pre code').each(function(i, e) { - hljs.highlightBlock(e); - - if(!$(this).hasClass('language-text')) { - var code = $(this); - var lines = code.html().split(/\n/).length; - var numbers = []; - for (i = 1; i < lines; i++) { - numbers += '' + i + ''; - } - code.parent().append('
' + numbers + '
'); - } - }); - } - codestyling(); - - /* ========================================================================== - Initialize and load Disqus - ========================================================================== */ - - if (typeof disqus === 'undefined') { - $('.post-comments').css({ - 'display' : 'none' - }); - } else { - $('#show-disqus').on('click', function() { - $.ajax({ - type: "GET", - url: "//" + disqus + ".disqus.com/embed.js", - dataType: "script", - cache: true - }); - $(this).parent().addClass('activated'); - }); - } -}); +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b="length"in a&&a.length,c=ea.type(a);return"function"!==c&&!ea.isWindow(a)&&(!(1!==a.nodeType||!b)||("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a))}function d(a,b,c){if(ea.isFunction(b))return ea.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return ea.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(ma.test(b))return ea.filter(b,a,c);b=ea.filter(b,a)}return ea.grep(a,function(a){return ea.inArray(a,b)>=0!==c})}function e(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}function f(a){var b=ua[a]={};return ea.each(a.match(ta)||[],function(a,c){b[c]=!0}),b}function g(){oa.addEventListener?(oa.removeEventListener("DOMContentLoaded",h,!1),a.removeEventListener("load",h,!1)):(oa.detachEvent("onreadystatechange",h),a.detachEvent("onload",h))}function h(){(oa.addEventListener||"load"===event.type||"complete"===oa.readyState)&&(g(),ea.ready())}function i(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(za,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:ya.test(c)?ea.parseJSON(c):c)}catch(e){}ea.data(a,b,c)}else c=void 0}return c}function j(a){var b;for(b in a)if(("data"!==b||!ea.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function k(a,b,c,d){if(ea.acceptData(a)){var e,f,g=ea.expando,h=a.nodeType,i=h?ea.cache:a,j=h?a[g]:a[g]&&g;if(j&&i[j]&&(d||i[j].data)||void 0!==c||"string"!=typeof b)return j||(j=h?a[g]=W.pop()||ea.guid++:g),i[j]||(i[j]=h?{}:{toJSON:ea.noop}),("object"==typeof b||"function"==typeof b)&&(d?i[j]=ea.extend(i[j],b):i[j].data=ea.extend(i[j].data,b)),f=i[j],d||(f.data||(f.data={}),f=f.data),void 0!==c&&(f[ea.camelCase(b)]=c),"string"==typeof b?(e=f[b],null==e&&(e=f[ea.camelCase(b)])):e=f,e}}function l(a,b,c){if(ea.acceptData(a)){var d,e,f=a.nodeType,g=f?ea.cache:a,h=f?a[ea.expando]:ea.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){ea.isArray(b)?b=b.concat(ea.map(b,ea.camelCase)):b in d?b=[b]:(b=ea.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;for(;e--;)delete d[b[e]];if(c?!j(d):!ea.isEmptyObject(d))return}(c||(delete g[h].data,j(g[h])))&&(f?ea.cleanData([a],!0):ca.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}function m(){return!0}function n(){return!1}function o(){try{return oa.activeElement}catch(a){}}function p(a){var b=Ka.split("|"),c=a.createDocumentFragment();if(c.createElement)for(;b.length;)c.createElement(b.pop());return c}function q(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==xa?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==xa?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||ea.nodeName(d,b)?f.push(d):ea.merge(f,q(d,b));return void 0===b||b&&ea.nodeName(a,b)?ea.merge([a],f):f}function r(a){Ea.test(a.type)&&(a.defaultChecked=a.checked)}function s(a,b){return ea.nodeName(a,"table")&&ea.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function t(a){return a.type=(null!==ea.find.attr(a,"type"))+"/"+a.type,a}function u(a){var b=Va.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function v(a,b){for(var c,d=0;null!=(c=a[d]);d++)ea._data(c,"globalEval",!b||ea._data(b[d],"globalEval"))}function w(a,b){if(1===b.nodeType&&ea.hasData(a)){var c,d,e,f=ea._data(a),g=ea._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)ea.event.add(b,c,h[c][d])}g.data&&(g.data=ea.extend({},g.data))}}function x(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!ca.noCloneEvent&&b[ea.expando]){e=ea._data(b);for(d in e.events)ea.removeEvent(b,d,e.handle);b.removeAttribute(ea.expando)}"script"===c&&b.text!==a.text?(t(b).text=a.text,u(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),ca.html5Clone&&a.innerHTML&&!ea.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Ea.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}function y(b,c){var d,e=ea(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:ea.css(e[0],"display");return e.detach(),f}function z(a){var b=oa,c=_a[a];return c||(c=y(a,b),"none"!==c&&c||($a=($a||ea("