mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-05 14:14:41 +00:00
feat: improvements to author list
- Re-refactor code to use Hugo's `GetTerms` function now that Hugo fixed the unordered bug - GetTerms may provide better support for names with unicode or spaces - Use Bootstrap's bundled PopoverJS for *instant* and more legible author note tooltips. - Make author notes more intuitive and mobile friendly - use FA icon with left padding to discern touches. - Add support for highlighting multiple author names (e.g. team members) BREAKING CHANGE: To highlight an author name, add `highlight_name: true` to the author's profile. Close #1750 Fix #1861 Close #1864
This commit is contained in:
1 parent
42793fe7f0
commit
0583f02f70
7 files changed
+7049
-14
No files matched your search
@@ -60,6 +60,9 @@ social:
|
||||
# Enter email to display Gravatar (if Gravatar enabled in Config)
|
||||
email: ""
|
||||
|
||||
# Highlight the author in author lists? (true/false)
|
||||
highlight_name: false
|
||||
|
||||
# Organizational groups that you belong to (for People widget)
|
||||
# Set this to `[]` or comment out if you are not using People widget.
|
||||
user_groups:
|
||||
|
||||
+7033
File diff suppressed because it is too large.
Load diff
-7
@@ -1,7 +0,0 @@
|
||||
/*!
|
||||
* Bootstrap v4.4.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function l(o){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?e(Object(r),!0).forEach(function(t){var e,n,i;e=o,i=r[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(r,t))})}return o}g=g&&g.hasOwnProperty("default")?g.default:g,u=u&&u.hasOwnProperty("default")?u.default:u;var n="transitionend";function o(t){var e=this,n=!1;return g(this).one(_.TRANSITION_END,function(){n=!0}),setTimeout(function(){n||_.triggerTransitionEnd(e)},t),this}var _={TRANSITION_END:"bsTransitionEnd",getUID:function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var e=g(t).css("transition-duration"),n=g(t).css("transition-delay"),i=parseFloat(e),o=parseFloat(n);return i||o?(e=e.split(",")[0],n=n.split(",")[0],1e3*(parseFloat(e)+parseFloat(n))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){g(t).trigger(n)},supportsTransitionEnd:function(){return Boolean(n)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],r=e[i],s=r&&_.isElement(r)?"element":(a=r,{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase());if(!new RegExp(o).test(s))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+s+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"!=typeof t.getRootNode)return t instanceof ShadowRoot?t:t.parentNode?_.findShadowRoot(t.parentNode):null;var e=t.getRootNode();return e instanceof ShadowRoot?e:null},jQueryDetection:function(){if("undefined"==typeof g)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=g.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||4<=t[0])throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};_.jQueryDetection(),g.fn.emulateTransitionEnd=o,g.event.special[_.TRANSITION_END]={bindType:n,delegateType:n,handle:function(t){if(g(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var r="alert",a="bs.alert",c="."+a,h=g.fn[r],f={CLOSE:"close"+c,CLOSED:"closed"+c,CLICK_DATA_API:"click"+c+".data-api"},d="alert",m="fade",p="show",v=function(){function i(t){this._element=t}var t=i.prototype;return t.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},t.dispose=function(){g.removeData(this._element,a),this._element=null},t._getRootElement=function(t){var e=_.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n=n||g(t).closest("."+d)[0]},t._triggerCloseEvent=function(t){var e=g.Event(f.CLOSE);return g(t).trigger(e),e},t._removeElement=function(e){var n=this;if(g(e).removeClass(p),g(e).hasClass(m)){var t=_.getTransitionDurationFromElement(e);g(e).one(_.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(t)}else this._destroyElement(e)},t._destroyElement=function(t){g(t).detach().trigger(f.CLOSED).remove()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(a);e||(e=new i(this),t.data(a,e)),"close"===n&&e[n](this)})},i._handleDismiss=function(e){return function(t){t&&t.preventDefault(),e.close(this)}},s(i,null,[{key:"VERSION",get:function(){return"4.4.1"}}]),i}();g(document).on(f.CLICK_DATA_API,'[data-dismiss="alert"]',v._handleDismiss(new v)),g.fn[r]=v._jQueryInterface,g.fn[r].Constructor=v,g.fn[r].noConflict=function(){return g.fn[r]=h,v._jQueryInterface};var y="button",E="bs.button",C="."+E,T=".data-api",b=g.fn[y],S="active",D="btn",I="focus",w='[data-toggle^="button"]',A='[data-toggle="buttons"]',N='[data-toggle=Line truncated
|
||||
//# sourceMappingURL=bootstrap.min.js.map
|
||||
@@ -757,6 +757,9 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Init. author notes (tooltips).
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
|
||||
});
|
||||
|
||||
// Normalize Bootstrap carousel slide heights.
|
||||
|
||||
@@ -114,8 +114,11 @@ article .article-metadata {
|
||||
|
||||
.article-metadata .author-notes {
|
||||
cursor: help;
|
||||
vertical-align: super;
|
||||
font-size: 0.7em;
|
||||
padding-left: 3px;
|
||||
}
|
||||
|
||||
.article-metadata .author-highlighted {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.article-categories {
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
{{- $profile_page := site.GetPage (printf "/%s/%s" $taxonomy .) -}}
|
||||
{{- $name := $profile_page.Title | default $name_raw -}}
|
||||
{{- if gt $index 0 }}, {{ end -}}
|
||||
<span {{ if site.Params.highlight_superuser | and (eq $profile_page.Params.superuser true) }}class="font-weight-bold"{{end}}>
|
||||
{{- if and $profile_page $link_authors -}}
|
||||
<a href="{{$profile_page.RelPermalink}}">{{$name}}</a>
|
||||
<span {{ if $highlight_name }}class="author-highlighted"{{end}}>
|
||||
{{- if $link_authors -}}
|
||||
<a href="{{.RelPermalink}}">{{.LinkTitle}}</a>
|
||||
{{- else -}}
|
||||
{{$name}}
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- if isset $.Params "author_notes" -}}
|
||||
{{- with (index $.Params.author_notes $index) -}}
|
||||
<span title="{{.}}" class="author-notes">(?)</span>
|
||||
<i class="author-notes fas fa-info-circle" data-toggle="tooltip" title="{{.}}"></i>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
{{ $js_academic := resources.Get "js/wowchemy.js" }}
|
||||
{{ $js_academic_search := resources.Get "js/wowchemy-search.js" }}
|
||||
{{ $js_algolia_search := resources.Get "js/algolia-search.js" }}
|
||||
{{ $js_bootstrap := resources.Get "js/_vendor/bootstrap.min.js" }}
|
||||
{{ $js_bootstrap := resources.Get "js/_vendor/bootstrap.bundle.js" }}
|
||||
{{ $js_bundle := slice $js_bootstrap $js_linebreak $js_academic }}
|
||||
{{ if eq site.Params.search.engine 1 }}
|
||||
{{ $js_bundle = $js_bundle | append $js_academic_search }}
|
||||
|
||||
Reference in new issue
Block a user