diff --git a/.gitignore b/.gitignore index c75eecc..7ba0a09 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /public +/resources diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cc556cc --- /dev/null +++ b/Makefile @@ -0,0 +1,64 @@ +.PHONY: all build assets static upload serv clean nuke +.SECONDARY: + +HUGO := hugo --gc +#KATEX_VERSION := 0.10.2 +URL_MATERIALIZE_ZIP := https://github.com/Dogfalo/materialize/releases/download/1.0.0/materialize-src-v1.0.0.zip +URL_MATERIALICONS_CSS := https://fonts.googleapis.com/icon?family=Material+Icons +URL_LUNR_JS := https://unpkg.com/lunr/lunr.min.js +#URL_KATEX := https://cdn.jsdelivr.net/npm/katex@$(KATEX_VERSION) +#URL_KATEX_CSS := $(URL_KATEX)/dist/katex.min.css +#URL_KATEX_JS := $(URL_KATEX)/dist/katex.min.js +#URL_KATEX_AUTO_RENDER_JS := $(URL_KATEX)/dist/contrib/auto-render.min.js +ASSETS := assets/vendor/materialize-src assets/vendor/material-icons.css +#assets/katex.min.css assets/katex.min.js assets/katex-auto-render.min.js +STATIC := static/vendor/lunr.min.js + +all: clean build upload + +build: assets static + $(HUGO) + +assets: $(ASSETS) + +static: $(STATIC) + +upload: + echo "Upload not implemented" + +assets/vendor/materialize-src: static/vendor/materialize.zip + mkdir -p $(dir $@) + unzip $< -d $(dir $@) + +static/vendor/materialize.zip: + mkdir -p $(dir $@) + wget -O $@ $(URL_MATERIALIZE_ZIP) + +assets/vendor/material-icons.css: + mkdir -p $(dir $@) + wget -O $@ $(URL_MATERIALICONS_CSS) + +static/vendor/lunr.min.js: + mkdir -p $(dir $@) + wget -O $@ $(URL_LUNR_JS) + +#assets/katex.min.css: + #mkdir -p $(dir $@) + #wget -O $@ $(URL_KATEX_CSS) + +#assets/katex.min.js: + #mkdir -p $(dir $@) + #wget -O $@ $(URL_KATEX_JS) + +#assets/katex-auto-render.min.js: + #mkdir -p $(dir $@) + #wget -O $@ $(URL_KATEX_AUTO_RENDER_JS) + +serv: clean assets static + $(HUGO) server + +clean: + rm -rf resources public + +nuke: clean + rm -rf $(ASSETS) $(STATIC) diff --git a/assets/.gitignore b/assets/.gitignore new file mode 100644 index 0000000..61ead86 --- /dev/null +++ b/assets/.gitignore @@ -0,0 +1 @@ +/vendor diff --git a/assets/sass/main.scss b/assets/sass/main.scss new file mode 100644 index 0000000..3bdb700 --- /dev/null +++ b/assets/sass/main.scss @@ -0,0 +1,94 @@ +$primary-color: #1d4e9e; +$secondary-color: #a6b8e4; + +@import "assets/vendor/materialize-src/sass/components/color-variables"; +@import "assets/vendor/materialize-src/sass/components/color-classes"; + +$button-color: color("orange", "lighten-3"); +$button-background-focus: lighten($button-color, 4%); +$button-raised-background: $button-color; +$button-floating-background: $button-color; + +@import "assets/vendor/materialize-src/sass/materialize.scss"; + +h4, span.card-subtitle { + color: color("grey", "base"); +} + +nav.breadcrumbs { + background: $secondary-color; +} + +ul.pagination > li.active { + background: $secondary-color; +} + +ul.collection > li.collection-item > div > a { + display: inline-block; + max-width: 90%; +} + +div.navbar-fixed > nav .input-field { + position: absolute; +} + +#search { + + //position: absolute; + //transition: width 0.5s ease, color 0.5s ease, background-color 0.5s ease; + + &:focus:not([readonly]) { + //width: 100%; + } + +} + +div.container { + opacity: 1; + transition: opacity 0.5s; + body.searching > & { + opacity: 0.1; + } +} + +nav.searchbar { + background-color: $button-color; + //transition: height 0.5s ease, color 0.5s ease; + body:not(.searched-at-least-once) & { + height: 0; + overflow: hidden; + } +} + +#search-results { + opacity: 1; + z-index: 1; + position: absolute; + width: 100%; + transition: visibility 0, opacity 0.5s; + body:not(.searching) & { + visibility:hidden; + opacity: 0; + } + + & > div.collection > a.collection-item { + color: #222; + + &.avatar > p { + margin-right: 30px; + } + } +} + +#search-button { + opacity: 1; + position: fixed; + bottom: 2em; + right: 2em; + transition: visibility 0, opacity 0.5s; + body:not(.searching-initialized) & { + visibility: hidden; + opacity: 0; + } +} + diff --git a/config.yml b/config.yml index 15e28e9..98570b3 100644 --- a/config.yml +++ b/config.yml @@ -1,3 +1,59 @@ -baseurl: https://aureooms.github.io/math/ +baseurl: https://math.blog.aurelienooms.be/ theme: prove -title: Aurélien's math blog +title: Aurélien's Math Notebook +buildFuture: true + +permalinks: + today: /:year/:month/:day/:title + past: /:year/:month/:day/:title + upcoming: /:year/:month/:day/:title + +taxonomies: + tag: tags + author: authors + +outputs: + home: + - HTML + - RSS + - Calendar + - JSON + section: + - HTML + - RSS + - Calendar + page: + - HTML + - Calendar + taxonomy: + - HTML + - RSS + - Calendar + taxonomyTerm: + - HTML + +params: + logo: + src: https://cdn.jsdelivr.net/gh/aureooms-ulb/logo/files/ulb-logo-blue-square.svg + alt: ULB + organizer: 'CN="Aurélien Ooms":mailto:info@math.blog.aurelienooms.be' + hostname: math.blog.aurelienooms.be + editURL: https://github.com/aureooms/math + nav: + sections: + - today + - upcoming + - past + taxonomies: + - tags + - authors + calendar: + tzid: Europe/Brussels + status: + - CONFIRMED # Indicates event is definite. + - TENTATIVE # Indicates event is tentative. + - CANCELLED # Indicates event was cancelled. + classification: + - PUBLIC + - PRIVATE + - CONFIDENTIAL diff --git "a/content/authors/aur\303\251lien-ooms/_index.md" "b/content/authors/aur\303\251lien-ooms/_index.md" new file mode 100644 index 0000000..b3924b1 --- /dev/null +++ "b/content/authors/aur\303\251lien-ooms/_index.md" @@ -0,0 +1,6 @@ +--- +title: "Aurélien Ooms" +homepage: "https://aurelienooms.be" +thumbnail: + src: https://ipfs.io/ipfs/QmaLqjQxyBfDfu23Vm2rW9sNpsnsVSToBmAsmgSAzwSqnm +--- diff --git a/content/post/2015-06-19-gaussian-elimination.mmark b/content/past/2015-06-19-gaussian-elimination.mmark similarity index 61% rename from content/post/2015-06-19-gaussian-elimination.mmark rename to content/past/2015-06-19-gaussian-elimination.mmark index 4d078c3..f94ed44 100644 --- a/content/post/2015-06-19-gaussian-elimination.mmark +++ b/content/past/2015-06-19-gaussian-elimination.mmark @@ -2,6 +2,13 @@ date: 2015-06-19T00:00:00Z title: Gaussian elimination url: /2015/06/19/gaussian-elimination/ +thumbnail: + src: https://ipfs.io/ipfs/QmYaWTZLBGucEgA1uftuUby1DTmBA4zsPo8jCSYSTqJ9Jk +tags: + - Algorithms + - Linear Algebra +authors: + - Aurélien Ooms --- [Python implementation](https://cocalc.com/projects/1b2a688b-0ee8-41b1-be25-2f6a95c36c76/files/Gaussian%20elimination.sagews). diff --git a/content/post/2015-06-23-complex-division.mmark b/content/past/2015-06-23-complex-division.mmark similarity index 61% rename from content/post/2015-06-23-complex-division.mmark rename to content/past/2015-06-23-complex-division.mmark index 0323ddf..3493a69 100644 --- a/content/post/2015-06-23-complex-division.mmark +++ b/content/past/2015-06-23-complex-division.mmark @@ -2,9 +2,18 @@ date: 2015-06-23T00:00:00Z title: Complex numbers division url: /2015/06/23/complex-division/ +thumbnail: + src: https://ipfs.io/ipfs/Qmd7X75zoQ7fn7QDp6TYkQjRdjazvHDJa1mdgq2YiZY1qJ +tags: + - Numbers --- $$ -\frac{a+bi}{c+di} = \frac{a+bi}{c+di} \frac{c-di}{c-di} = \frac{ac+bd}{c^2+d^2}+\frac{bc-ad}{c^2+d^2}i +\frac{a+bi}{c+di} = \ldots $$ + + +$$ +\frac{a+bi}{c+di} = \frac{a+bi}{c+di} \frac{c-di}{c-di} = \frac{ac+bd}{c^2+d^2}+\frac{bc-ad}{c^2+d^2}i +$$ diff --git a/content/post/2015-06-24-binomial-coefficient-tricks.mmark b/content/past/2015-06-24-binomial-coefficient-tricks.mmark similarity index 73% rename from content/post/2015-06-24-binomial-coefficient-tricks.mmark rename to content/past/2015-06-24-binomial-coefficient-tricks.mmark index 90f7524..d24c144 100644 --- a/content/post/2015-06-24-binomial-coefficient-tricks.mmark +++ b/content/past/2015-06-24-binomial-coefficient-tricks.mmark @@ -1,7 +1,15 @@ --- -date: 2015-06-24T00:00:00Z +date: 2015-06-24T00:00:00+02:00 title: Binomial coefficient tricks -url: /2015/06/24/binomial-coefficient-tricks/ +thumbnail: + src: https://ipfs.io/ipfs/QmQeJRjHamrvs9a7R1zrsJUTTDWsv6BBW79GQm2Yc6Z8gT +tags: + - Identities +duration: PT30M +status: TENTATIVE +categories: + - POST + - TEST --- $$ diff --git a/content/post/2015-06-29-fibonacci.mmark b/content/past/2015-06-29-fibonacci.mmark similarity index 94% rename from content/post/2015-06-29-fibonacci.mmark rename to content/past/2015-06-29-fibonacci.mmark index 87d39a3..c8d1f4e 100644 --- a/content/post/2015-06-29-fibonacci.mmark +++ b/content/past/2015-06-29-fibonacci.mmark @@ -2,6 +2,11 @@ date: 2015-06-29T00:00:00Z title: Fibonacci numbers url: /2015/06/29/fibonacci/ +thumbnail: + src: https://ipfs.io/ipfs/QmZ45td48HxWKnBGLLMCLwyd7qUmLV6yNcU914nxLMZuTW +tags: + - Numbers + - Recurrences --- The Fibonacci numbers are defined as $$f_0 = 0,\ f_1 = 1$$ and, for $$i \ge diff --git a/content/post/2015-06-29-inverse-sum.mmark b/content/past/2015-06-29-inverse-sum.mmark similarity index 85% rename from content/post/2015-06-29-inverse-sum.mmark rename to content/past/2015-06-29-inverse-sum.mmark index 6c6ca56..5b0514d 100644 --- a/content/post/2015-06-29-inverse-sum.mmark +++ b/content/past/2015-06-29-inverse-sum.mmark @@ -2,6 +2,12 @@ date: 2015-06-29T00:00:00Z title: Inverse sum equations url: /2015/06/29/inverse-sum/ +thumbnail: + src: https://ipfs.io/ipfs/QmNnXTqBHeNReAhAE9svPrr5bcXqerc71qb9LJYUhF99h9 +tags: + - Brute Force + - Algorithms + - Systems of Inequalities --- We are given $$k > 0 \in \mathbb{R}$$ and $$a_1, a_2, \ldots, a_n \ge 1 \in \mathbb{N}$$ such that diff --git a/content/post/2015-07-31-probabilistic-primality-testing.mmark b/content/past/2015-07-31-probabilistic-primality-testing.mmark similarity index 66% rename from content/post/2015-07-31-probabilistic-primality-testing.mmark rename to content/past/2015-07-31-probabilistic-primality-testing.mmark index 9e61049..9e68506 100644 --- a/content/post/2015-07-31-probabilistic-primality-testing.mmark +++ b/content/past/2015-07-31-probabilistic-primality-testing.mmark @@ -2,6 +2,11 @@ date: 2015-07-31T00:00:00Z title: Probabilistic primality testing url: /2015/07/31/probabilistic-primality-testing/ +thumbnail: + src: https://ipfs.io/ipfs/QmPQSrNd3tqzbesJWXzkswVqY3G8NzEmFMoCq6nkBYjDbM +tags: + - Algorithms + - Prime Numbers --- [Sage implementation](https://cocalc.com/projects/49ff84e6-2108-4af7-8b75-1f17996aa5a0/files/PRIMALITY.sagews). diff --git a/content/post/2015-11-08-symbols.mmark b/content/past/2015-11-08-symbols.mmark similarity index 82% rename from content/post/2015-11-08-symbols.mmark rename to content/past/2015-11-08-symbols.mmark index 9a4eb1f..32d1fdf 100644 --- a/content/post/2015-11-08-symbols.mmark +++ b/content/past/2015-11-08-symbols.mmark @@ -2,6 +2,12 @@ date: 2015-11-08T00:00:00Z title: Symbols url: /2015/11/08/symbols/ +thumbnail: + src: https://ipfs.io/ipfs/QmcuGk8P95Rom4bQgmSqXFswvQ8M2n1ETDaBEsGbTdS1kx + caption: Mmmh +tags: + - Notation + - Numbers --- $$ diff --git a/content/post/2016-01-15-polyhedral-sets.mmark b/content/past/2016-01-15-polyhedral-sets.mmark similarity index 93% rename from content/post/2016-01-15-polyhedral-sets.mmark rename to content/past/2016-01-15-polyhedral-sets.mmark index ca539f3..b9fbc4b 100644 --- a/content/post/2016-01-15-polyhedral-sets.mmark +++ b/content/past/2016-01-15-polyhedral-sets.mmark @@ -2,6 +2,11 @@ date: 2016-01-15T00:00:00Z title: Polyhedral sets url: /2016/01/15/polyhedral-sets/ +thumbnail: + src: https://ipfs.io/ipfs/QmSu4S43YGRZr16TrnNtZA3UxEoEpvSpYLEZiBjkiCn7Gg +tags: + - Geometry + - Definitions --- A *polyhedral set* in $$\mathbb{R}^d$$ is the intersection of a finite diff --git a/content/post/2016-01-17-d-hyperplanes-intersection-bounds.mmark b/content/past/2016-01-17-d-hyperplanes-intersection-bounds.mmark similarity index 99% rename from content/post/2016-01-17-d-hyperplanes-intersection-bounds.mmark rename to content/past/2016-01-17-d-hyperplanes-intersection-bounds.mmark index 5a98108..599a4ec 100644 --- a/content/post/2016-01-17-d-hyperplanes-intersection-bounds.mmark +++ b/content/past/2016-01-17-d-hyperplanes-intersection-bounds.mmark @@ -1,7 +1,12 @@ --- -date: 2016-01-17T00:00:00Z +date: 2016-01-17T00:00:00+01:00 title: \(d\) hyperplanes intersection bounds -url: /2016/01/17/d-hyperplanes-intersection-bounds/ +url: /2016/01/17/d-hyperplanes-intersection-bounds +thumbnail: + src: https://ipfs.io/ipfs/QmPAdhtD5ojLZP69nVe9EbHgAhon7BDnQbxic9nGSBk5cv +tags: + - Geometry + - Linear Algebra --- We bound the position of the $$0$$-cells of an arrangement of hyperplanes in diff --git a/content/post/2016-04-12-vc-dimension.mmark b/content/past/2016-04-12-vc-dimension.mmark similarity index 91% rename from content/post/2016-04-12-vc-dimension.mmark rename to content/past/2016-04-12-vc-dimension.mmark index 254c6f5..fb0df8c 100644 --- a/content/post/2016-04-12-vc-dimension.mmark +++ b/content/past/2016-04-12-vc-dimension.mmark @@ -2,8 +2,17 @@ date: 2016-04-12T00:00:00Z title: VC-dimension url: /2016/04/12/vc-dimension/ +thumbnail: + src: https://ipfs.io/ipfs/QmZpYeMXHBqCC1m8NtDJh82DQS8Q5YDLMPAsW3e4ZJtXTz +tags: + - Geometry + - VC-dimension + - epsilon-nets --- +Definitions of VC-dimesion and $$\varepsilon$$-nets. + + ## Definition 1 (Espilon net) Let $$X$$ be a set, let $$\mu$$ be a probability measure on $$X$$, let $$\mathcal{F}$$ be a system of $$\mu$$-measurable subsets of $$X$$, and let @@ -12,7 +21,6 @@ called an $$\varepsilon$$-net for $$(X,\mathcal{F})$$ with respect to $$\mu$$ if $$N \cap S \neq \emptyset$$ for all $$S \in \mathcal{F}$$ with $$\mu(S) \ge \varepsilon$$. - ## Definition 2 (Trace of $$\mathcal{F}$$ on $$Y$$) Let $$\mathcal{F}$$ be a set system on $$X$$ and let $$Y \subseteq X$$. We define the restriction of $$\mathcal{F}$$ on $$Y$$ (also called the *trace* of @@ -25,7 +33,7 @@ $$ ## Definition 3 (VC-dimension) Let $$\mathcal{F}$$ be a set system on a set $$X$$. Let us say that a subset $$A -\subseteq X$$ is shttered by $$\mathcal{F}$$ if each of the subsets of $$A$$ can +\subseteq X$$ is shattered by $$\mathcal{F}$$ if each of the subsets of $$A$$ can be obtained as the intersection of some $$S \in \mathcal{F}$$ with $$A$$, i.e., if $$\mathcal{F}|_A = 2^{A}$$. We define the VC-dimension of $$\mathcal{F}$$, denoted diff --git a/content/post/2016-04-14-log-log-log.mmark b/content/past/2016-04-14-log-log-log.mmark similarity index 93% rename from content/post/2016-04-14-log-log-log.mmark rename to content/past/2016-04-14-log-log-log.mmark index 670c778..7828eb2 100644 --- a/content/post/2016-04-14-log-log-log.mmark +++ b/content/past/2016-04-14-log-log-log.mmark @@ -2,6 +2,12 @@ date: 2016-04-14T00:00:00Z title: Log Log Log url: /2016/04/14/log-log-log/ +thumbnail: + src: https://ipfs.io/ipfs/QmRqy5uiX5KXLUe52bF5ADozyxHPuNAgdWiVbZ8vqZUnYi +tags: + - Identities + - Inequalities + - Analysis of Algorithms --- ## Theorem diff --git a/content/post/2016-04-27-equivalence-of-3sum-problems.mmark b/content/past/2016-04-27-equivalence-of-3sum-problems.mmark similarity index 58% rename from content/post/2016-04-27-equivalence-of-3sum-problems.mmark rename to content/past/2016-04-27-equivalence-of-3sum-problems.mmark index 4e0ebbd..a314be0 100644 --- a/content/post/2016-04-27-equivalence-of-3sum-problems.mmark +++ b/content/past/2016-04-27-equivalence-of-3sum-problems.mmark @@ -2,8 +2,16 @@ date: 2016-04-27T00:00:00Z title: Equivalence of 3SUM problems url: /2016/04/27/equivalence-of-3sum-problems/ +thumbnail: + src: https://ipfs.io/ipfs/QmeHrVkaqogCPYKw3Gu29PWgkYCBWc4YEio16iNVjzcUzg +tags: + - Algorithms --- +Are different versions of the 3SUM problem equivalent? + + + ## Reducing 3SUMx1 to 3SUMx3 ??? @@ -11,5 +19,3 @@ url: /2016/04/27/equivalence-of-3sum-problems/ ## Reducing 3SUMx3 to 3SUMx1 $$ (a, 3), (b, 4), (c, -7) $$ - - diff --git a/content/post/2016-05-04-polynomial-time-approximation-schemes.mmark b/content/past/2016-05-04-polynomial-time-approximation-schemes.mmark similarity index 79% rename from content/post/2016-05-04-polynomial-time-approximation-schemes.mmark rename to content/past/2016-05-04-polynomial-time-approximation-schemes.mmark index edbcfe6..978e594 100644 --- a/content/post/2016-05-04-polynomial-time-approximation-schemes.mmark +++ b/content/past/2016-05-04-polynomial-time-approximation-schemes.mmark @@ -2,6 +2,10 @@ date: 2016-05-04T00:00:00Z title: Polynomial-time approximation schemes url: /2016/05/04/polynomial-time-approximation-schemes/ +thumbnail: + src: https://ipfs.io/ipfs/QmZBeHAHCWne2HVihGvCqcVK1meLfRyctk8WVH8qP2szN1 +tags: + - Approximation Algorithms --- ## PTAS diff --git a/content/post/2017-04-21-converging-series.mmark b/content/past/2017-04-21-converging-series.mmark similarity index 86% rename from content/post/2017-04-21-converging-series.mmark rename to content/past/2017-04-21-converging-series.mmark index 841f7e9..ae69795 100644 --- a/content/post/2017-04-21-converging-series.mmark +++ b/content/past/2017-04-21-converging-series.mmark @@ -2,6 +2,10 @@ date: 2017-04-21T00:00:00Z title: Converging series url: /2017/04/21/converging-series/ +thumbnail: + src: https://ipfs.io/ipfs/QmWiF78w2jN5QXdo4a3zcZ9cKvdPoHUj4pTLpxg3xP3KBP +tags: + - Identities --- Let $$-1 < x < 1$$, diff --git a/content/post/2017-04-22-recurrences.mmark b/content/past/2017-04-22-recurrences.mmark similarity index 89% rename from content/post/2017-04-22-recurrences.mmark rename to content/past/2017-04-22-recurrences.mmark index 89bf8ff..4dc98cc 100644 --- a/content/post/2017-04-22-recurrences.mmark +++ b/content/past/2017-04-22-recurrences.mmark @@ -2,6 +2,10 @@ date: 2017-04-22T00:00:00Z title: Recurrences url: /2017/04/22/recurrences/ +thumbnail: + src: https://ipfs.io/ipfs/QmT9GxdAYNzHF4rZUADZ7BX81UMUFypmJJK88RJfs6BcfK +tags: + - Recurrences --- ## Theorem diff --git a/content/post/2017-07-21-quantum-computer-algorithms.mmark b/content/past/2017-07-21-quantum-computer-algorithms.mmark similarity index 89% rename from content/post/2017-07-21-quantum-computer-algorithms.mmark rename to content/past/2017-07-21-quantum-computer-algorithms.mmark index d071fac..0e98e4f 100644 --- a/content/post/2017-07-21-quantum-computer-algorithms.mmark +++ b/content/past/2017-07-21-quantum-computer-algorithms.mmark @@ -2,6 +2,13 @@ date: 2017-07-21T00:00:00Z title: Quantum Computer Algorithms url: /2017/07/21/quantum-computer-algorithms/ +thumbnail: + src: https://ipfs.io/ipfs/Qma4SHRZJHV16PBNPu6kypZJwPDuA4TNvzTFeVBaWJDymR +tags: + - Quantum Computing + - Algorithms +authors: + - Aurélien Ooms --- [Notes](https://ipfs.io/ipfs/QmctoycyfhWTrDy4c4jZeyLcRmmutFii5H5RLGk7pMbDoS) diff --git a/content/post/2017-07-22-infinite-number-of-primes.mmark b/content/past/2017-07-22-infinite-number-of-primes.mmark similarity index 75% rename from content/post/2017-07-22-infinite-number-of-primes.mmark rename to content/past/2017-07-22-infinite-number-of-primes.mmark index e71580d..875ee3c 100644 --- a/content/post/2017-07-22-infinite-number-of-primes.mmark +++ b/content/past/2017-07-22-infinite-number-of-primes.mmark @@ -1,7 +1,18 @@ --- date: 2017-07-22T00:00:00Z title: Infinite Number of Primes -url: /2017/07/22/infinite-number-of-primes/ +thumbnail: + src: https://ipfs.io/ipfs/QmeKDgrff9eE9gZFGBvoVA95QFnP8fNGcsDfMQhun7pApa + caption: Ulam's Spiral +tags: + - Number Theory + - Prime Numbers + - Numbers +location: Europe +geolocation: + latitude: 50 + longitude: 3 +status: CANCELLED --- The erroneous proof I hear most often is: Suppose $$P$$ is a diff --git a/content/post/2017-07-23-sums-of-geometric-series.mmark b/content/past/2017-07-23-sums-of-geometric-series.mmark similarity index 85% rename from content/post/2017-07-23-sums-of-geometric-series.mmark rename to content/past/2017-07-23-sums-of-geometric-series.mmark index 13442eb..21f7e80 100644 --- a/content/post/2017-07-23-sums-of-geometric-series.mmark +++ b/content/past/2017-07-23-sums-of-geometric-series.mmark @@ -2,6 +2,13 @@ date: 2017-07-23T00:00:00Z title: Sums of geometric series url: /2017/07/23/sums-of-geometric-series/ +thumbnail: + src: https://ipfs.io/ipfs/QmScXVCgnEHUoZF3Mu14A8aneUnRRt1bqQuUtN5bJWpbhx + caption: Two +tags: + - Identities + - Inequalities + - Analysis of Algorithms --- Among the identities that are useful in the analysis of algorithms, @@ -17,7 +24,7 @@ $$ That's nice. There are many ways to prove it, a cool one is to first -[prove](/math/2017/04/21/converging-series) that +[prove]({{< ref "2017-04-21-converging-series" >}}) that $$ \sum_{i=0}^{\infty} x^i = \frac{1}{ {(1-x)} }, diff --git a/content/post/2018-10-17-drunkards-walk.mmark b/content/past/2018-10-17-drunkards-walk.mmark similarity index 89% rename from content/post/2018-10-17-drunkards-walk.mmark rename to content/past/2018-10-17-drunkards-walk.mmark index 685f55e..8318c84 100644 --- a/content/post/2018-10-17-drunkards-walk.mmark +++ b/content/past/2018-10-17-drunkards-walk.mmark @@ -2,6 +2,13 @@ date: 2018-10-17T00:00:00Z title: The Drunkard's Walk url: /2018/10/17/drunkards-walk/ +thumbnail: + src: https://ipfs.io/ipfs/QmSAXMJTDSRbyNyJZWhXUrdXuKiCxD6p6H9ths64L32dQm + caption: The Drunkard's Pilgrimage +tags: + - Recurrences +authors: + - Aurélien Ooms --- A drunkard is zigzagging home. At every steps forward (or backward) he is diff --git a/content/today/2019-05-30-test.mmark b/content/today/2019-05-30-test.mmark new file mode 100644 index 0000000..e542969 --- /dev/null +++ b/content/today/2019-05-30-test.mmark @@ -0,0 +1,6 @@ +--- +title: "2019 05 30 Test" +date: 2019-05-30T00:41:15+02:00 +draft: false +--- + diff --git a/content/upcoming/2020-05-29-future-post.mmark b/content/upcoming/2020-05-29-future-post.mmark new file mode 100644 index 0000000..31d9195 --- /dev/null +++ b/content/upcoming/2020-05-29-future-post.mmark @@ -0,0 +1,8 @@ +--- +title: "2020 05 29 Future Post" +date: 2020-05-29T09:51:40+02:00 +draft: false +--- + +testaroo + diff --git a/static/.gitignore b/static/.gitignore new file mode 100644 index 0000000..61ead86 --- /dev/null +++ b/static/.gitignore @@ -0,0 +1 @@ +/vendor diff --git a/static/lunrConfig.js b/static/lunrConfig.js new file mode 100644 index 0000000..d4354ec --- /dev/null +++ b/static/lunrConfig.js @@ -0,0 +1,16 @@ +var lunrConfig = { + "limit": 5, +} ; + +var lunrPlugins = [ + function () { + this.ref('id'); + this.field('link'); + this.field('title'); + this.field('content'); + this.field('summary'); + this.field('status'); + this.field('authors'); + this.field('tags'); + } +] ; diff --git a/themes/prove/README.md b/themes/prove/README.md new file mode 100644 index 0000000..0c45fd5 --- /dev/null +++ b/themes/prove/README.md @@ -0,0 +1,63 @@ +# The Material Theme + +## About minification of generated files + +Use `hugo --minify ...`. + +## About the `duration` attribute + +Excerpt from https://www.ietf.org/rfc/rfc5545.txt: + +3.3.6. Duration + + Value Name: DURATION + + Purpose: This value type is used to identify properties that contain + a duration of time. + + Format Definition: This value type is defined by the following + notation: + + dur-value = (["+"] / "-") "P" (dur-date / dur-time / dur-week) + + dur-date = dur-day [dur-time] + dur-time = "T" (dur-hour / dur-minute / dur-second) + dur-week = 1*DIGIT "W" + dur-hour = 1*DIGIT "H" [dur-minute] + dur-minute = 1*DIGIT "M" [dur-second] + dur-second = 1*DIGIT "S" + dur-day = 1*DIGIT "D" + + Description: If the property permits, multiple "duration" values are + specified by a COMMA-separated list of values. The format is + based on the [ISO.8601.2004] complete representation basic format + with designators for the duration of time. The format can + represent nominal durations (weeks and days) and accurate + durations (hours, minutes, and seconds). Note that unlike + [ISO.8601.2004], this value type doesn't support the "Y" and "M" + designators to specify durations in terms of years and months. + + The duration of a week or a day depends on its position in the + calendar. In the case of discontinuities in the time scale, such + as the change from standard time to daylight time and back, the + computation of the exact duration requires the subtraction or + addition of the change of duration of the discontinuity. Leap + seconds MUST NOT be considered when computing an exact duration. + When computing an exact duration, the greatest order time + components MUST be added first, that is, the number of days MUST + be added first, followed by the number of hours, number of + minutes, and number of seconds. + + Negative durations are typically used to schedule an alarm to + trigger before an associated time (see Section 3.8.6.3). + + No additional content value encoding (i.e., BACKSLASH character + encoding, see Section 3.3.11) are defined for this value type. + + Example: A duration of 15 days, 5 hours, and 20 seconds would be: + + P15DT5H0M20S + + A duration of 7 weeks would be: + + P7W diff --git a/themes/prove/assets/search.js b/themes/prove/assets/search.js new file mode 100644 index 0000000..ed281ea --- /dev/null +++ b/themes/prove/assets/search.js @@ -0,0 +1,117 @@ +var ICONS = { + 'collection': 'class' , + 'item' : 'notes' , + 'author': 'face' , + 'tag' : 'label' , +} ; + +var searchTimeout = undefined; + +function statusAndDate ( date , status ) { + if (status === "CANCELLED") return `${date} (CANCELLED)` ; + else if (status === "TENTATIVE") return `${date} (TENTATIVE DATE AND TIME)`; + return date; +} + +function getKind ( url ) { + const parts = url.slice(1,-1).split('/'); + + if (parts.length === 1) return 'collection' ; + + if (parts[0] === 'authors') return 'author' ; + if (parts[0] === 'tags') return 'tag' ; + + return 'item' ; +} + +function matchToHTML ( match ) { + const href = match.document.link; + const title = `${match.document.link} - ${match.document.title} (${match.result.score.toFixed(3)})`; + const subtitle = match.document.date ? statusAndDate(match.document.date, match.document.status) : ''; + const text = match.document.summary; + const kind = getKind(match.document.link); + const icon = ICONS[kind]; + let avatar = `${icon}` ; + const thumbnail = match.document.thumbnail; + if ( thumbnail ) { + avatar = `${thumbnail.caption}` ; + } + return ` + ${avatar} + ${title} +

${subtitle}${text ? '
'+text : ''}

+ ${icon} +
`; +} + +function measure ( what , callback ) { + + var t0 = performance.now(); + var output = callback(); + var t1 = performance.now(); + console.debug( what + " took " + (t1 - t0) + " milliseconds."); + return output; + +} + +function initSearch ( ) { + + var searchWorker = new Worker('/searchWorker.js'); + + const search = document.getElementById('search'); + const results = document.getElementById('search-results'); + const onInput = function (event) { + clearTimeout(searchTimeout); + searchTimeout = undefined; + const queryString = event.target.value; + searchWorker.postMessage(queryString); + searchTimeout = setTimeout(function () { + resultHTML = `Searching is taking longer than expected ...`; + results.innerHTML = '
' + resultHTML + '
' ; + }, 1000); + }; + + const onFocusIn = function () { + document.body.classList.add('searching'); + } ; + + const onFocusOut = function () { + document.body.classList.remove('searching'); + } ; + + search.addEventListener('input', onInput); + search.addEventListener('focusin', onFocusIn); + search.addEventListener('focusout', onFocusOut); + + searchWorker.onmessage = function(e) { + clearTimeout(searchTimeout); + searchTimeout = undefined; + var matches = e.data; + if (matches.length === 0) { + resultHTML = `No search results found`; + } + else { + resultHTML = matches.map(matchToHTML).join(''); + } + + results.innerHTML = '
' + resultHTML + '
' ; + + if (renderMathInElement) renderMathInElement(results); + + } + + // Configure search button to show and focus search input + const searchButton = document.getElementById('search-button'); + const onClick = function () { + document.body.classList.add('searched-at-least-once'); + window.scrollTo(0, 0); + search.focus(); + } ; + searchButton.addEventListener('click', onClick); + + // Notify page that search is ready + document.body.classList.add('searching-initialized'); + +} + +measure("Initializing searching feature", function () {initSearch();}); diff --git a/themes/prove/layouts/404.html b/themes/prove/layouts/404.html index e69de29..db33f17 100644 --- a/themes/prove/layouts/404.html +++ b/themes/prove/layouts/404.html @@ -0,0 +1,21 @@ +{{ partial "header.html" . }} +{{ partial "navbar.html" . }} +{{ partial "breadcrumbs-page.html" . }} +{{ partial "searchbar.html" . }} + +
+
+
+ {{ partial "taxonomies.html" . }} +
+
+

404

+

Page not found.

+
+
+ {{ partial "all-sections-previews.html" . }} +
+
+
+ +{{ partial "footer.html" . }} diff --git a/themes/prove/layouts/_default/list.html b/themes/prove/layouts/_default/list.html index e69de29..d3d5553 100644 --- a/themes/prove/layouts/_default/list.html +++ b/themes/prove/layouts/_default/list.html @@ -0,0 +1,21 @@ +{{ partial "header.html" . }} +{{ partial "navbar.html" . }} +{{ partial "breadcrumbs-page.html" . }} +{{ partial "searchbar.html" . }} + +
+
+
+ {{ partial "taxonomies.html" . }} +
+
+

{{ .Section | title }}

+ {{ partial "content-pages-pager.html" . }} +
+
+ {{ partial "all-sections-previews.html" . }} +
+
+
+ +{{ partial "footer.html" . }} diff --git a/themes/prove/layouts/_default/list.ics b/themes/prove/layouts/_default/list.ics new file mode 100644 index 0000000..78b6bd6 --- /dev/null +++ b/themes/prove/layouts/_default/list.ics @@ -0,0 +1,9 @@ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:{{ .Permalink | anchorize }} +CALSCALE:{{ .Site.Params.calendar.calscale | default "GREGORIAN" }} +METHOD:PUBLISH +{{range .Pages -}} +{{- partial "event.ics" . -}} +{{end -}} +END:VCALENDAR diff --git a/themes/prove/layouts/_default/single.html b/themes/prove/layouts/_default/single.html index 495f4ef..ae9aeee 100644 --- a/themes/prove/layouts/_default/single.html +++ b/themes/prove/layouts/_default/single.html @@ -1,20 +1,47 @@ {{ partial "header.html" . }} - - +{{ partial "navbar.html" . }} +{{ partial "breadcrumbs-post.html" . }} +{{ partial "searchbar.html" . }}
-
-
-
-

{{ .Title | safeHTML }}

-

{{ .Date.Format "Mon, Jan 2, 2006" }}

-

{{ .Content }}

-
-
-
+
+
+
+ {{ with .Param "thumbnail" }} +
+
+ {{ .caption }} + {{ .caption }} +
+
+ {{ end }} +
+
+
+
+
+
+

{{ .Title | safeHTML }}

+

{{ partial "status-and-date.html" (dict "status" .Params.status "date" .Date) }}

+ {{ range $taxo, $terms := .Site.Taxonomies }} + {{ with $.Param $taxo }} + {{ if gt (len .) 0 }} +
+ {{ $taxo | title }}: + {{ range $index, $term := . }} + {{- if gt $index 0 }}, {{ end -}} + {{ with $.Site.GetPage (printf "/%s/%s" $taxo ($term | anchorize)) -}} + {{ .Title }} + {{- end -}} + {{- end -}} +
+ {{- end -}} + {{ end }} + {{ end }} +

{{ .Content }}

+
+
+
{{ partial "footer.html" . }} diff --git a/themes/prove/layouts/_default/single.ics b/themes/prove/layouts/_default/single.ics new file mode 100644 index 0000000..8f086a2 --- /dev/null +++ b/themes/prove/layouts/_default/single.ics @@ -0,0 +1,7 @@ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:{{ .Permalink | anchorize }} +CALSCALE:{{ .Site.Params.calendar.calscale | default "GREGORIAN" }} +METHOD:PUBLISH +{{partial "event.ics" . -}} +END:VCALENDAR diff --git a/themes/prove/layouts/index.html b/themes/prove/layouts/index.html index c4e21c1..2af178d 100644 --- a/themes/prove/layouts/index.html +++ b/themes/prove/layouts/index.html @@ -1,35 +1,21 @@ {{ partial "header.html" . }} - - +{{ partial "navbar.html" . }} +{{ partial "breadcrumbs-page.html" . }} +{{ partial "searchbar.html" . }}
- {{ range .Paginator.Pages }}
-
-
-
{{ .Date.Format "Mon, Jan 2, 2006" }}
- {{ with .Param "thumbnail" }}{{ .caption }}{{ end }} -
-

{{ .Title | safeHTML }}

-

{{ .Summary }}

- Read more about {{ .Title | safeHTML }} -
- {{ range .Params.tags }} - {{ . }} - {{ end }} -
-
+
+ {{ partial "taxonomies.html" . }} +
+
+

All

+ {{ partial "content-pages-pager.html" . }} +
+
+ {{ partial "all-sections-previews.html" . }}
- {{ end }} -
- - {{ partial "pagination.html" . }} {{ partial "footer.html" . }} diff --git a/themes/prove/layouts/index.json b/themes/prove/layouts/index.json new file mode 100644 index 0000000..0b61248 --- /dev/null +++ b/themes/prove/layouts/index.json @@ -0,0 +1,34 @@ +{ + "documents": [ + {{- with .Site.AllPages -}} + {{- range $index, $page := . -}} + {{- if ne $index 0 -}},{{- end }} + { + "id": {{ $index }}, + "link": {{ $page.RelPermalink | jsonify }}, + "title": {{ $page.Title | jsonify }}, + "date": {{ $page.Date.Format "Mon, Jan 2, 2006 MST" | jsonify }} + {{- with $page.Param "status" -}} + , + "status": {{ . | jsonify }} + {{ end }} + {{- with $page.Param "thumbnail" -}} + , + "thumbnail": {{ . | jsonify }} + {{ end }} + {{- with $page.Content -}} + , + "summary": {{ $page.Summary | plainify | jsonify }}, + "content": {{ . | plainify | jsonify }} + {{- end -}} + {{- range $key := .Site.Params.nav.taxonomies -}} + {{- with $page.Param $key -}} + , + {{ $key | jsonify }}: {{ . | jsonify -}} + {{- end -}} + {{ end }} + } + {{- end -}} + {{ end }} + ] +} diff --git a/themes/prove/layouts/partials/all-sections-previews.html b/themes/prove/layouts/partials/all-sections-previews.html new file mode 100644 index 0000000..c1b8054 --- /dev/null +++ b/themes/prove/layouts/partials/all-sections-previews.html @@ -0,0 +1,15 @@ +{{ range .Site.Params.nav.sections }} + {{ $all := where $.Site.RegularPages "Section" ( . | anchorize ) }} + {{ $n := len $all}} + {{ $ordered := $all }} + {{ $preview := first 3 $ordered }} + {{ if gt $n 0 }} +

{{ . | title }}

+
+ {{ range $preview }} + {{ partial "content-page-small-card.html" . }} + {{ end }} + Browse {{$n}} +
+ {{ end }} +{{ end }} diff --git a/themes/prove/layouts/partials/bootstrap.html b/themes/prove/layouts/partials/bootstrap.html deleted file mode 100644 index 58152e8..0000000 --- a/themes/prove/layouts/partials/bootstrap.html +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/themes/prove/layouts/partials/breadcrumbs-page.html b/themes/prove/layouts/partials/breadcrumbs-page.html new file mode 100644 index 0000000..c0f36de --- /dev/null +++ b/themes/prove/layouts/partials/breadcrumbs-page.html @@ -0,0 +1,14 @@ + diff --git a/themes/prove/layouts/partials/breadcrumbs-post.html b/themes/prove/layouts/partials/breadcrumbs-post.html new file mode 100644 index 0000000..90cc40d --- /dev/null +++ b/themes/prove/layouts/partials/breadcrumbs-post.html @@ -0,0 +1,10 @@ + diff --git a/themes/prove/layouts/partials/breadcrumbs-taxonomy-term.html b/themes/prove/layouts/partials/breadcrumbs-taxonomy-term.html new file mode 100644 index 0000000..1adf146 --- /dev/null +++ b/themes/prove/layouts/partials/breadcrumbs-taxonomy-term.html @@ -0,0 +1,15 @@ + diff --git a/themes/prove/layouts/partials/content-page-small-card.html b/themes/prove/layouts/partials/content-page-small-card.html new file mode 100644 index 0000000..04d806b --- /dev/null +++ b/themes/prove/layouts/partials/content-page-small-card.html @@ -0,0 +1,16 @@ +
+
+
+ {{ with .Param "thumbnail" }}{{ .caption }}{{ end }} +
+
+ {{ .Title | safeHTML }} + + {{ partial "status-and-date.html" (dict "status" .Params.status "date" .Date) }} + +
+
+ Read more +
+
+
diff --git a/themes/prove/layouts/partials/content-pages-list.html b/themes/prove/layouts/partials/content-pages-list.html new file mode 100644 index 0000000..84e12d2 --- /dev/null +++ b/themes/prove/layouts/partials/content-pages-list.html @@ -0,0 +1,21 @@ +{{ range .Paginator.Pages }} +
+
+
+
+ {{ with .Param "thumbnail" }}{{ .caption }}{{ end }} +
+
+ {{ .Title | safeHTML }} + + {{ partial "status-and-date.html" (dict "status" .Params.status "date" .Date) }} + +

{{ .Summary }}

+
+
+ Read more +
+
+
+
+{{ end }} diff --git a/themes/prove/layouts/partials/content-pages-pager.html b/themes/prove/layouts/partials/content-pages-pager.html new file mode 100644 index 0000000..ad23efa --- /dev/null +++ b/themes/prove/layouts/partials/content-pages-pager.html @@ -0,0 +1,2 @@ +{{ partial "content-pages-list.html" . }} +{{ partial "content-pages-pagination.html" . }} diff --git a/themes/prove/layouts/partials/content-pages-pagination.html b/themes/prove/layouts/partials/content-pages-pagination.html new file mode 100644 index 0000000..3f9eda1 --- /dev/null +++ b/themes/prove/layouts/partials/content-pages-pagination.html @@ -0,0 +1,25 @@ +{{ $pag := $.Paginator }} +{{ if gt $pag.TotalPages 1 }} + +{{ end }} diff --git a/themes/prove/layouts/partials/datetime-local.ics b/themes/prove/layouts/partials/datetime-local.ics new file mode 100644 index 0000000..3a02d56 --- /dev/null +++ b/themes/prove/layouts/partials/datetime-local.ics @@ -0,0 +1,6 @@ +{{- $TZ := dateFormat "MST" . -}} +{{- if (eq $TZ "UTC") -}} +:{{dateFormat "20060102T150405Z" .}} +{{- else -}} +;TZID={{dateFormat "MST" .}}:{{dateFormat "20060102T150405" .}} +{{- end -}} diff --git a/themes/prove/layouts/partials/datetime-utc.ics b/themes/prove/layouts/partials/datetime-utc.ics new file mode 100644 index 0000000..f15df28 --- /dev/null +++ b/themes/prove/layouts/partials/datetime-utc.ics @@ -0,0 +1 @@ +:{{- dateFormat "20060102T150405Z" .UTC -}} diff --git a/themes/prove/layouts/partials/escape-text.ics b/themes/prove/layouts/partials/escape-text.ics new file mode 100644 index 0000000..9c3de7e --- /dev/null +++ b/themes/prove/layouts/partials/escape-text.ics @@ -0,0 +1,7 @@ +{{/* + See https://www.ietf.org/rfc/rfc5545.txt @3.3.11 + ESCAPED-CHAR = ("\\" / "\;" / "\," / "\N" / "\n") + ; \\ encodes \, \N or \n encodes newline + ; \; encodes ;, \, encodes , +*/}} +{{- replace ( replace ( replace ( replace . "\\" "\\\\") ";" "\\;") "," "\\,") "\n" "\\n" -}} diff --git a/themes/prove/layouts/partials/event.ics b/themes/prove/layouts/partials/event.ics new file mode 100644 index 0000000..1700918 --- /dev/null +++ b/themes/prove/layouts/partials/event.ics @@ -0,0 +1,43 @@ +{{- if (isset .Params "date") -}} +{{- if (and (isset .Params "status") (eq (in .Site.Params.calendar.status .Params.status) false)) -}} +{{ errorf "Failed to handle page %q. `.Params.status` must be unset or one of %v. Got %q." .Path .Site.Params.calendar.status .Params.status }} +{{- end -}} +BEGIN:VEVENT +DTSTAMP{{partial "datetime-utc.ics" (.PublishDate | default .Date)}} +UID:{{.Permalink | anchorize}}@{{.Site.Params.hostname}} +SEQUENCE:0 +CLASS:PUBLIC +SUMMARY:{{.Title}} +{{- with .Summary}} +DESCRIPTION:{{ partial "escape-text.ics" (plainify .) }} +{{- end }} +{{- with .Params.categories}} +CATEGORIES:{{ delimit . "," }} +{{- end }} +STATUS:{{ .Params.status | default (index .Site.Params.calendar.status 0) }} +{{- with .Date }} +DTSTART{{partial "datetime-local.ics" .}} +{{ end -}} +{{- with .Params.end -}} +DTEND{{partial "datetime-local.ics" .}} +{{ else }} +{{- with .Params.duration -}} +DURATION:{{.}} +{{ end -}} +{{ end -}} +{{- with .PublishDate -}} +CREATED{{partial "datetime-utc.ics" .}} +{{ end -}} +{{- with .Params.lastmod -}} +LAST-MODIFIED{{partial "datetime-utc.ics" .}} +{{ end -}} +{{- with .Params.location -}} +LOCATION:{{.}} +{{ end -}} +{{- with .Params.geolocation -}} +GEO:{{.latitude}};{{.longitude}} +{{ end -}} +ORGANIZER;{{.Params.organizer | default .Site.Params.organizer}} +URL:{{.Permalink}} +END:VEVENT +{{- end }} diff --git a/themes/prove/layouts/partials/footer.html b/themes/prove/layouts/partials/footer.html index 308b1d0..c492007 100644 --- a/themes/prove/layouts/partials/footer.html +++ b/themes/prove/layouts/partials/footer.html @@ -1,2 +1,5 @@ + {{ partial "search.html" . }} + {{ partial "materialize-js.html" . }} + {{ partial "math.html" . }} diff --git a/themes/prove/layouts/partials/header.html b/themes/prove/layouts/partials/header.html index 56c2bcf..35fff41 100644 --- a/themes/prove/layouts/partials/header.html +++ b/themes/prove/layouts/partials/header.html @@ -1,8 +1,19 @@ + {{ .Title }} - {{ partial "bootstrap.html" . }} - {{ partial "math.html" . }} + + {{ range .AlternativeOutputFormats -}} + + {{ end -}} + + {{ $style := resources.Get "sass/main.scss" | toCSS | minify | fingerprint }} + + + + {{ partial "material-icons.html" . }} + {{ partial "viewport.html" . }} + diff --git a/themes/prove/layouts/partials/material-icons.html b/themes/prove/layouts/partials/material-icons.html new file mode 100644 index 0000000..919d5ab --- /dev/null +++ b/themes/prove/layouts/partials/material-icons.html @@ -0,0 +1,5 @@ + + + +{{ $style := resources.Get "vendor/material-icons.css" | minify | fingerprint }} + diff --git a/themes/prove/layouts/partials/materialize-css.html b/themes/prove/layouts/partials/materialize-css.html new file mode 100644 index 0000000..76b2d20 --- /dev/null +++ b/themes/prove/layouts/partials/materialize-css.html @@ -0,0 +1,5 @@ + + + +{{ $style := resources.Get "vendor/materialize-src/sass/materialize.scss" | toCSS | minify | fingerprint }} + diff --git a/themes/prove/layouts/partials/materialize-js.html b/themes/prove/layouts/partials/materialize-js.html new file mode 100644 index 0000000..7ebcc6b --- /dev/null +++ b/themes/prove/layouts/partials/materialize-js.html @@ -0,0 +1,5 @@ + + + +{{ $code := resources.Get "vendor/materialize-src/js/bin/materialize.js" | minify | fingerprint }} + diff --git a/themes/prove/layouts/partials/math.html b/themes/prove/layouts/partials/math.html index 05da62a..b358c1b 100644 --- a/themes/prove/layouts/partials/math.html +++ b/themes/prove/layouts/partials/math.html @@ -1,10 +1,19 @@ - - - + +{{/* +{{ $katexcss := resources.Get "vendor/katex.min.css" | fingerprint }} + + +{{ $katexjs := resources.Get "vendor/katex.min.js" | fingerprint }} + + +{{ $katexautorenderjs := resources.Get "vendor/katex-auto-render.min.js" | fingerprint }} + +*/}} + diff --git a/themes/prove/layouts/partials/searchbar.html b/themes/prove/layouts/partials/searchbar.html new file mode 100644 index 0000000..003fd60 --- /dev/null +++ b/themes/prove/layouts/partials/searchbar.html @@ -0,0 +1,19 @@ + + + search + diff --git a/themes/prove/layouts/partials/status-and-date.html b/themes/prove/layouts/partials/status-and-date.html new file mode 100644 index 0000000..2faa4f6 --- /dev/null +++ b/themes/prove/layouts/partials/status-and-date.html @@ -0,0 +1,7 @@ +{{ if (eq .status "CANCELLED") }} + {{ .date.Format "Mon, Jan 2, 2006 MST" }} (CANCELLED) +{{ else if (eq .status "TENTATIVE") }} + {{ .date.Format "Mon, Jan 2, 2006 MST" }} (TENTATIVE DATE AND TIME) +{{ else }} + {{ .date.Format "Mon, Jan 2, 2006 MST" }} +{{ end }} diff --git a/themes/prove/layouts/partials/taxonomies.html b/themes/prove/layouts/partials/taxonomies.html new file mode 100644 index 0000000..69f1fa3 --- /dev/null +++ b/themes/prove/layouts/partials/taxonomies.html @@ -0,0 +1,11 @@ +{{ range $key := .Site.Params.nav.taxonomies }} +{{ with $.Site.GetPage (printf "/%s" $key) }} +{{ $terms := .Data.Terms }} +

{{ $key | title }}

+
+
+ {{ partial "taxonomy-collection.html" (dict "Site" $.Site "key" $key "terms" $terms ) }} +
+
+{{ end }} +{{ end }} diff --git a/themes/prove/layouts/partials/taxonomy-collection.html b/themes/prove/layouts/partials/taxonomy-collection.html new file mode 100644 index 0000000..4346dc5 --- /dev/null +++ b/themes/prove/layouts/partials/taxonomy-collection.html @@ -0,0 +1,15 @@ + +
+ Browse {{ len .terms }} +
diff --git a/themes/prove/layouts/partials/viewport.html b/themes/prove/layouts/partials/viewport.html new file mode 100644 index 0000000..a698ee5 --- /dev/null +++ b/themes/prove/layouts/partials/viewport.html @@ -0,0 +1,2 @@ + + diff --git a/themes/prove/layouts/taxonomy/list.html b/themes/prove/layouts/taxonomy/list.html new file mode 100644 index 0000000..b8379ff --- /dev/null +++ b/themes/prove/layouts/taxonomy/list.html @@ -0,0 +1,25 @@ +{{ partial "header.html" . }} +{{ partial "navbar.html" . }} +{{ partial "breadcrumbs-taxonomy-term.html" . }} +{{ partial "searchbar.html" . }} + +
+
+
+ {{ partial "taxonomies.html" . }} +
+
+ {{ if .Data.Term }} +

{{ .Data.Singular | title }} - {{ .Data.Term }}

+ {{ else }} +

All {{ .Data.Plural | title }}

+ {{ end }} + {{ partial "content-pages-pager.html" . }} +
+
+ {{ partial "all-sections-previews.html" . }} +
+
+
+ +{{ partial "footer.html" . }} diff --git a/themes/prove/static/searchWorker.js b/themes/prove/static/searchWorker.js new file mode 100644 index 0000000..550a0a0 --- /dev/null +++ b/themes/prove/static/searchWorker.js @@ -0,0 +1,80 @@ +importScripts('/vendor/lunr.min.js'); +importScripts('/lunrConfig.js'); + +var debug = function () { + if (lunrConfig.debug) console.debug.apply(console, arguments); +} ; + +debug("lunrConfig", lunrConfig); +debug("lunrPlugins", lunrPlugins); + +self.index = null; +self.pendingQuery = ''; + +function measure ( what , callback ) { + + debug( what + " started."); + var t0 = performance.now(); + var output = callback(); + var t1 = performance.now(); + console.log( what + " took " + (t1 - t0) + " milliseconds."); + return output; + +} + + +function executeQuery ( index , queryString ) { + let resultHTML; + try { + + //const results = self.index.search(queryString); + const results = measure("Search", function(){return index.search(queryString);}); + const matches = results + .slice(0,lunrConfig.limit) + .map(result => ( + { + "result": result, + "document": self.documents[result.ref], + } + )); + + postMessage(matches); + + } + catch ( err ) { + console.error(err); + postMessage([]); + } +} + +function initWorker ( documents ) { + + self.documents = documents; + + debug("Documents", self.documents); + + self.index = lunr(function () { + lunrPlugins.forEach(function (plugin) { this.use(plugin) }, this) ; + self.documents.forEach(function (doc) { this.add(doc) }, this) ; + }) ; + + debug("Index", self.index); + + if (self.pendingQuery) executeQuery(self.index, self.pendingQuery); + +} + +fetch('/index.json') + .then( response => response.json() ) + .then( object => object.documents ) + .then( documents => { + measure("Initializing search worker", function () {initWorker(documents);}); + }); + +onmessage = function (event) { + debug('Worker: Message received from main script:', event.data); + const queryString = event.data; + + if ( self.index ) executeQuery(self.index, queryString); + else self.pendingQuery = queryString; +};