commit cae1778de578aaa30521e199e21a765152640709 Author: Aaron Honeycutt Date: Thu Nov 21 17:23:24 2024 -0700 init commit diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9ffe0b5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "themes/kangae"] + path = themes/kangae + url = https://github.com/ayushnix/kangae.git diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..071e5a1 --- /dev/null +++ b/config.toml @@ -0,0 +1,156 @@ +# please refer to +# https://www.getzola.org/documentation/getting-started/configuration/ +# for the complete configuration file + +# [MANDATORY] the URL of the microblog +base_url = "https://kangae.ayushnix.com" + +# [recommended] kangae doesn't use sass for its global stylesheet +compile_sass = false + +# enable this when using kangae as a theme +theme = "kangae" + +# [optional] minify HTML to save space at the cost of readability +minify_html = false + +# [recommended] generate an atom or rss feed +#generate_feed = true + +# [recommended] the name of the feed +# if it's set to 'rss.xml', an RSS feed will be generated +#feed_filename = "atom.xml" + +# [recommended] the title of the website +title = "ahoneybun microblog" + +# [recommended] the description of the website +description = "the personal microblog of ahoneybun" + +# [recommended] the default language of the website +default_language = "en" + +# [recommended] the different kinds of taxonomies for the website +taxonomies = [ + { name = "tags", feed = true } +] + +# ---------------------------------------------------------------------------- # + +# configuration for how the markdown blog posts are rendered +[markdown] + +# [optional] enable syntax highlighting for source code +# syntax highlight, in itself isn't sufficient and if enabled, it needs to +# support both light and dark modes which will add an overhead of approximately +# 6kb of unminified CSS. you can decide if it's worth it or not +highlight_code = false + +# [optional] convert text emoji, such as :smile:,to the actual iconic emoji +render_emoji = true + +# [optional] open external links in a new tab and add `rel="noopener"` +external_links_target_blank = true + +# [optional] tell search engines not to follow external links +external_links_no_follow = false + +# [optional] add `rel=noreferrer` for privacy +external_links_no_referrer = true + +# [optional] change "quote" to “curly” and other style changes +smart_punctuation = false + +# ---------------------------------------------------------------------------- # + +[extra] +# [recommended] your name +author = "Aaron Honeycutt" + +# [recommended] your internet username +username = "ahoneybun" + +# [optional] your 128x128 avatar, preferably svg +avatar = "images/placeholder.png" + +# [optional] the keywords which highlight the type of content on your microblog +keywords = [ "microblog", "linux", "tech support" ] + +# [optional] add custom css +# custom_css = "css/custom.css" + +# [optional] add a web app manifest +# manifest = "/site.webmanifest" + +# [optional] additional links that should be present in the navbar +# `name` and `url` should be present for visibility, `rel` is optional +navbar = [ + { name = "mastodon", url = "https://hachyderm.io/@ahoneybun", rel="me" }, + { name = "github", url = "https://github.com/ahoneybun", rel="me" } +] + +# https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color +# [optional] the light color for the user interface of the web browser +# the default value is written below +# light_theme_color = "#f0f0f0" + +# [optional] the dark color for the user interface of the web browser +# the default value is written below +# dark_theme_color = "#282c34" + +[extra.content_license] +# [recommended] the spdx identifier of the license of content on your microblog +spdx = "CC-BY-NC-ND-4.0" + +# [recommended] the url of the license +url = "https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode.txt" + +[extra.source_license] +# [recommended] the spdx identifier for the license of source code on your microblog +spdx = "0BSD" + +# [recommended] the url of the license +url = "https://spdx.org/licenses/0BSD.html" + +# [recommended] the url of the source code of the microblog itself +src_url = "https://github.com/ayushnix/kangae" + +[extra.opengraph] +# [optional] opengraph image that should be visible when sharing links on social media +# websites and messaging apps +# img = "/images/apple-touch-icon.png" + +# [optional] specifying the alt text is recommended if opengraph img is enabled +# alt = "opengraph image description" + +[extra.favicon] + +# [recommended] a SVG favicon +# svg = "/images/favicon.svg" + +# [recommended] generate a 32px PNG favicon from the SVG +# png = "/images/favicon-32x32.png" + +# [recommended] generate either a 180px or a 192px PNG image +# 180px - if you want to use the size recommended by apple +# 192px - if you want to use a single 192px image both for apple devices and for +# the android web app manifest; the image will be automatically resized to 180px +# for apple devices +# apple = "/images/apple-touch-icon.png" + +[extra.post_footer] + +# [recommended] show a permalink to microblog posts +share = true + +# [optional] show a link which redirects to github discussions for writing comments +# in the example provided below, the URL will be +# https://github.com/ayushnix/kangae/discussions/new?category=general&title=The+Post+Title +discuss_github = true +github_url = "https://github.com/ayushnix/kangae" + +# [optional] other misc urls that should be shown in the post footers +# both `name` and `url` should be defined for visibility +# misc = [ +# { name = "misc", url = "https://misc.xyz" } +# ] diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..bbf9047 --- /dev/null +++ b/content/_index.md @@ -0,0 +1,9 @@ ++++ +title = "Home" +# Note we're not setting `paginate_by` here. + +[extra] +section_path = "blog/_index.md" # Where to find your posts. +max_posts = 5 # Show 5 posts on the home page. +header = {title = "Hello! I'm tabi~", img = "img/main.webp", img_alt = "Your Name" } ++++ diff --git a/public/css/style-external-links.css b/public/css/style-external-links.css new file mode 100644 index 0000000..f5b15aa --- /dev/null +++ b/public/css/style-external-links.css @@ -0,0 +1,12 @@ +a[href]:not(:where( +[href^="#"], +[href^="/"]:not([href^="//"]), +[href^=".."], +[href*="//ayushnix.com"], +[href*="//microblog.ayushnix.com"], +[href*="//wiki.ayushnix.com"], +))::after { + font-size: var(--step-s1); + content: " ↗"; + vertical-align: middle; +} diff --git a/public/css/style.css b/public/css/style.css new file mode 100644 index 0000000..865ff8a --- /dev/null +++ b/public/css/style.css @@ -0,0 +1,360 @@ +/*@import url("variables-light-theme.css") (prefers-color-scheme: light);*/ +/*@import url("variables-dark-theme.css") (prefers-color-scheme: dark);*/ +:root { + --fg-color: #e0e6f0; + --bg-color: #323232; + --fg-href: #f2e4c4; + --fg-border: #969696; + --bg-mark: #dfdfb0; + --fg-mark: #100f10; +} + +@media (prefers-color-scheme: light) { + :root { + --fg-color: #282828; + --bg-color: #f8f8f8; + --fg-href: #0000c0; + /* deliberaty choose a color with a lesser contrast */ + /* APCA contrast value of 83.77 against bg-color */ + --fg-border: #505050; + --bg-mark: #f9ff00; + --fg-mark: #282828; + } +} + +:root { + --sans-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji"; + --mono-font: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Inconsolata, monospace; + + /* @link https://utopia.fyi/type/calculator?c=320,14,1.125,1280,18,1.25,4,5,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l */ + --step-s5: clamp(0.37rem, calc(0.52rem + -0.19vw), 0.49rem); + --step-s4: clamp(0.46rem, calc(0.57rem + -0.14vw), 0.55rem); + --step-s3: clamp(0.58rem, calc(0.63rem + -0.06vw), 0.61rem); + --step-s2: clamp(0.69rem, calc(0.68rem + 0.05vw), 0.72rem); + --step-s1: clamp(0.78rem, calc(0.74rem + 0.20vw), 0.90rem); + --step-x0: clamp(0.88rem, calc(0.79rem + 0.42vw), 1.13rem); + --step-x1: clamp(0.98rem, calc(0.84rem + 0.70vw), 1.41rem); + --step-x2: clamp(1.11rem, calc(0.89rem + 1.08vw), 1.76rem); + --step-x3: clamp(1.25rem, calc(0.93rem + 1.59vw), 2.20rem); + --step-x4: clamp(1.40rem, calc(0.95rem + 2.24vw), 2.75rem); + + /* @link https://utopia.fyi/space/calculator?c=320,14,1.125,1280,18,1.25,4,5,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l */ + --space-3xs: clamp(0.25rem, calc(0.23rem + 0.10vw), 0.31rem); + --space-2xs: clamp(0.44rem, calc(0.40rem + 0.21vw), 0.56rem); + --space-xs: clamp(0.69rem, calc(0.63rem + 0.31vw), 0.88rem); + --space-s: clamp(0.88rem, calc(0.79rem + 0.42vw), 1.13rem); + --space-m: clamp(1.31rem, calc(1.19rem + 0.63vw), 1.69rem); + --space-l: clamp(1.75rem, calc(1.58rem + 0.83vw), 2.25rem); + --space-xl: clamp(2.63rem, calc(2.38rem + 1.25vw), 3.38rem); + --space-2xl: clamp(3.50rem, calc(3.17rem + 1.67vw), 4.50rem); + --space-3xl: clamp(5.25rem, calc(4.75rem + 2.50vw), 6.75rem); + + --width: 70ch; + --body-line-height: 1.5; + --head-line-height: 1.3; +} + +html { + /* use the border-box box model instead of the browser default content-box */ + box-sizing: border-box; + /* fallback for safari - remove if it starts supporting scrollbar-gutter */ + overflow-y: scroll; +} + +/* if a web browser supports `scrollbar-gutter`, use that instead */ +@supports (scrollbar-gutter: stable both-edges) { + html { + overflow-y: auto; + scrollbar-gutter: stable both-edges; + } +} + +/* inherit the border-box model in all elements */ +/* this allows elements to override the box-model if needed and make their + * children inherit their custom box-model */ +*, +*::before, +*::after { + box-sizing: inherit; +} + +/* remove all browser default margins and paddings */ +* { + margin: 0; + padding: 0; +} + +/* if any of the following elements don't exist, the rule still applies */ +:is(code, kbd, samp, pre) { + font-family: var(--mono-font); + overflow-x: auto; +} + +/* reduce distraction from text by removing underlines from hyperlinks */ +/* rely on color to distinguish hyperlinks */ +/* the order of pseudo classes should follow the LVHA order */ +/* :link, :visited, :hover, :active */ +a { + color: var(--fg-href); + text-decoration: none; +} + +/* subdue the color of visited hyperlinks */ +a:visited { + color: var(--fg-color); +} + +/* underline hyperlinks on hover and increase their underline offset */ +a:hover { + text-decoration: underline; + text-underline-offset: var(--space-3xs); +} + +/* if the role of a list is explicitly defined, it isn't being used as a list */ +ul[role="list"] { + padding: 0; + list-style: none; +} + +/* prevent overflow of possibly long lines */ +:is(p, li, h1) { + overflow-wrap: break-word; +} + +:is(img, video) { + /* never render images/videos wider than their containing element */ + max-inline-size: 100%; + height: auto; + /* preserve the aspect ratio of the image */ + block-size: auto; + margin-inline: auto; +} + +/* -------------------------------------------------------------------------- */ + +body { + /* layout */ + display: flex; + flex-direction: column; + /* align-items: center; */ + /* readability */ + margin: var(--space-m) auto; + width: min(90%, var(--width)); + font-size: var(--step-x0); + line-height: var(--body-line-height); + /* aesthetics */ + font-family: var(--sans-font); + color: var(--fg-color); + background: var(--bg-color); +} + +/* add margins on the left and right of the child elements of body */ +/* body > * { */ +/* margin-inline: auto; */ +/* } */ + +/* -------------------------------------------------------------------------- */ + +.primary-header { + display: flex; + flex-flow: row wrap; + justify-content: center; + gap: var(--space-xs); +} + +:is(img, video) { + /* make images/videos blocks rather than inline elements */ + display: block; +} + +.avatar { + border-radius: var(--step-x1); +} + +h1 { + font-size: var(--step-x3); + line-height: var(--head-line-height); +} + +/* -------------------------------------------------------------------------- */ + +:is(.primary-nav, .primary-footer, .article-footer, .tag-list-nav) > ul[role="list"] { + display: flex; + flex-flow: row wrap; + /* prevent accidental incorrect clicks by increasing space between elements */ + justify-content: space-evenly; + gap: var(--space-s); +} + +.primary-footer { + font-size: var(--step-s1); + border-block-start: 0.1rem dotted var(--fg-border); +} + +/* add a hash symbol before the taxonomy tag links */ +.tag::before { + content: "#"; +} + +.tag-sup { + padding-inline: var(--space-3xs); +} + +/* the stack layout for the child elements of article */ +article > * + * { + margin-top: var(--space-s); +} + +/* the stack layout for the body and the main element */ +:is(body, main) > * + * { + margin-top: var(--space-l); +} + +.article-header > ul[role="list"] { + display: inline-flex; + flex-flow: row wrap; + justify-content: flex-end; + gap: var(--space-2xs); +} + +.article-header { + display: flex; + gap: var(--space-2xs); + justify-content: space-between; + border-block-end: 0.1rem dotted var(--fg-border); +} + +/* borrowed from the html5-boilerplate css file on github */ +/* h5bp/html5-boilerplate/blob/5382f78315be9ed31546131ec543353d9c4ee5b3/dist/css/style.css#L109 */ +/* hide the title by default */ +.post-title { + border: 0; + clip: rect(0, 0, 0, 0); + height: 1px; + margin: -1px; + overflow: hidden; + position: absolute; + white-space: nowrap; + width: 1px; +} + +.post-title::before { + content: " · "; +} + +/* show the title on devices which are at least as wide as the iPad Mini */ +@media screen and (min-width: 48rem) { + .post-title { + clip: inherit; + height: inherit; + margin: inherit; + overflow: inherit; + position: inherit; + white-space: inherit; + width: inherit; + } +} + +.unknown-page { + display: flex; + flex-direction: column; + align-items: center; + margin-block: var(--space-xl); +} + +/* code blocks inside pre should be a block otherwise it doesn't work well when + * text overflows inside code */ +pre > code { + display: block; +} + +code[role="img"] { + display: inline-block; + vertical-align: middle; +} + +.figquote { + display: flex; + flex-direction: column; + place-items: center; +} + +/* -------------------------------------------------------------------------- */ + +/* don't style h2 to h6 because it's not needed on this website */ +:is(h2, h3, h4, h5, h6) { + font-size: var(--step-x0); +} + +pre { + padding: var(--space-2xs); + border: 0.1rem solid var(--fg-border); + border-radius: var(--step-s5); +} + +/* show the name of the programming language inside pre */ +pre[data-lang]::before { + display: block; + content: attr(data-lang); + text-decoration: underline var(--fg-border) solid; + text-underline-offset: var(--space-3xs); + text-decoration-thickness: 0.1rem; + text-transform: uppercase; + padding-block-end: var(--space-2xs); +} + +/* add space after line numbers and don't select the line numbers for copying */ +pre[data-linenos] table tbody tr td:first-child { + padding-inline-end: var(--space-s); + user-select: none; +} + +pre[data-linenos] table { + /* if we set table width to 100% and if text overflows, the space separation + * between cells is removed */ + /* width: 100%; */ + border-collapse: collapse; + border-spacing: 0; + text-indent: 0; +} + +.unknown-page-emoticon { + font-size: var(--step-x3); + padding: var(--space-2xs); + border: 0; + border-radius: 0; +} + +blockquote { + margin-inline-start: var(--space-l); + padding: var(--space-2xs); + border-inline-start: var(--step-s4) solid var(--fg-border); +} + +figcaption { + text-align: center; +} + +:is(ul, ol) { + padding-inline: var(--space-l); +} + +mark { + /* plays well with at least 1.5 line-height or more */ + padding-inline: var(--space-3xs); + padding-block: 0.1rem; + color: var(--fg-mark); + background: var(--bg-mark); + border-radius: var(--step-s5); +} + +kbd { + border-inline: 0.1rem solid var(--fg-border); + border-block-start: 0.1rem solid var(--fg-border); + border-block-end: 0.2rem solid var(--fg-border); + border-radius: var(--step-s5); + padding-inline: var(--space-3xs); + padding-block: 0.1rem; +} + +/* -------------------------------------------------------------------------- */ diff --git a/public/css/variables-dark-theme.css b/public/css/variables-dark-theme.css new file mode 100644 index 0000000..e3b8325 --- /dev/null +++ b/public/css/variables-dark-theme.css @@ -0,0 +1,10 @@ +/* modus vivendi colorscheme */ + +:root { + --fg-color: #e0e6f0; + --bg-color: #323232; + --fg-href: #f2e4c4; + --fg-border: #969696; + --bg-mark: #dfdfb0; + --fg-mark: #100f10; +} diff --git a/public/css/variables-light-theme.css b/public/css/variables-light-theme.css new file mode 100644 index 0000000..65a489f --- /dev/null +++ b/public/css/variables-light-theme.css @@ -0,0 +1,12 @@ +/* modus operandi colorscheme */ + +:root { + --fg-color: #282828; + --bg-color: #f8f8f8; + --fg-href: #0000c0; + /* deliberaty choose a color with a lesser contrast */ + /* APCA contrast value of 83.77 against bg-color */ + --fg-border: #505050; + --bg-mark: #f9ff00; + --fg-mark: #282828; +} diff --git a/public/elasticlunr.min.js b/public/elasticlunr.min.js new file mode 100644 index 0000000..79dad65 --- /dev/null +++ b/public/elasticlunr.min.js @@ -0,0 +1,10 @@ +/** + * elasticlunr - http://weixsong.github.io + * Lightweight full-text search engine in Javascript for browser search and offline search. - 0.9.6 + * + * Copyright (C) 2017 Oliver Nightingale + * Copyright (C) 2017 Wei Song + * MIT Licensed + * @license + */ +!function(){function e(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.9.5",lunr=t,t.utils={},t.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),t.utils.toString=function(e){return void 0===e||null===e?"":e.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},t.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0==this.events[e].length&&delete this.events[e])}},t.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)},this)}},t.EventEmitter.prototype.hasHandler=function(e){return e in this.events},t.tokenizer=function(e){if(!arguments.length||null===e||void 0===e)return[];if(Array.isArray(e)){var n=e.filter(function(e){return null===e||void 0===e?!1:!0});n=n.map(function(e){return t.utils.toString(e).toLowerCase()});var i=[];return n.forEach(function(e){var n=e.split(t.tokenizer.seperator);i=i.concat(n)},this),i}return e.toString().trim().toLowerCase().split(t.tokenizer.seperator)},t.tokenizer.defaultSeperator=/[\s\-]+/,t.tokenizer.seperator=t.tokenizer.defaultSeperator,t.tokenizer.setSeperator=function(e){null!==e&&void 0!==e&&"object"==typeof e&&(t.tokenizer.seperator=e)},t.tokenizer.resetSeperator=function(){t.tokenizer.seperator=t.tokenizer.defaultSeperator},t.tokenizer.getSeperator=function(){return t.tokenizer.seperator},t.Pipeline=function(){this._queue=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in t.Pipeline.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[n]=e},t.Pipeline.getRegisteredFunction=function(e){return e in t.Pipeline.registeredFunctions!=!0?null:t.Pipeline.registeredFunctions[e]},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.getRegisteredFunction(e);if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i+1,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i,0,n)},t.Pipeline.prototype.remove=function(e){var t=this._queue.indexOf(e);-1!==t&&this._queue.splice(t,1)},t.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._queue.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&this.documentStore.isDocStored()!==!1&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));o.forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t?!0:t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;;){if(n>o-1||i>r-1)break;s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++)}return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();o