diff options
| -rw-r--r-- | config.toml | 17 | ||||
| -rw-r--r-- | static/general/index.css | 2 | ||||
| -rw-r--r-- | themes/simple/layouts/_default/index.json | 5 | ||||
| -rw-r--r-- | themes/simple/layouts/_default/index.xml (renamed from themes/simple/layouts/_default/rss.xml) | 0 | ||||
| -rw-r--r-- | themes/simple/layouts/_default/list.html | 13 | ||||
| -rw-r--r-- | themes/simple/layouts/_default/notes.html | 5 | ||||
| -rw-r--r-- | themes/simple/layouts/_default/single.html | 3 | ||||
| -rw-r--r-- | themes/simple/layouts/partials/head.html | 2 | ||||
| -rw-r--r-- | themes/simple/layouts/partials/navigation.html | 8 | ||||
| -rw-r--r-- | themes/simple/layouts/partials/search.html | 123 | ||||
| -rw-r--r-- | themes/simple/layouts/section/section.json | 5 | ||||
| -rw-r--r-- | themes/simple/layouts/section/section.xml (renamed from themes/simple/layouts/section/notes.xml) | 0 | ||||
| -rw-r--r-- | themes/simple/static/css/tailwind.css | 2 |
13 files changed, 167 insertions, 18 deletions
diff --git a/config.toml b/config.toml index 02779c8..160f755 100644 --- a/config.toml +++ b/config.toml | |||
| @@ -40,18 +40,7 @@ enableRobotsTXT = true | |||
| 40 | [markup.highlight] | 40 | [markup.highlight] |
| 41 | style = 'github' | 41 | style = 'github' |
| 42 | 42 | ||
| 43 | # Taxonomies. | ||
| 44 | [outputs] | ||
| 45 | index = ["HTML", "atom"] | ||
| 46 | section = ["HTML", "notes"] | ||
| 47 | |||
| 48 | # Output formats. | 43 | # Output formats. |
| 49 | [outputFormats] | 44 | [outputs] |
| 50 | [outputFormats.atom] | 45 | home = ["HTML", "RSS", "JSON"] |
| 51 | mediatype = "application/rss" | 46 | section = ["HTML", "RSS", "JSON"] |
| 52 | rel = "atom" | ||
| 53 | baseName = "atom" | ||
| 54 | [outputFormats.notes] | ||
| 55 | mediatype = "application/rss" | ||
| 56 | rel = "notes" | ||
| 57 | baseName = "notes" | ||
diff --git a/static/general/index.css b/static/general/index.css index 411dd05..4e8e2a5 100644 --- a/static/general/index.css +++ b/static/general/index.css | |||
| @@ -1 +1 @@ | |||
| /*! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.mx-auto{margin-left:auto;margin-right:auto}.my-12{margin-top:3rem;margin-bottom:3rem}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-6{margin-left:1.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.contents{display:contents}.hidden{display:none}.h-full{height:100%}.w-full{width:100%}.flex-grow{flex-grow:1}.list-disc{list-style-type:disc}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.rounded{border-radius:.25rem}.border-0{border-width:0}.border-2{border-width:2px}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-orange-600{--tw-bg-opacity:1;background-color:rgb(234 88 12/var(--tw-bg-opacity))}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-16{padding-bottom:4rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.no-underline{text-decoration-line:none}.underline-offset-2{text-underline-offset:2px}.container-blog{max-width:700px}::selection{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity));--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}::-moz-selection{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity));--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.blue,a:hover{color:blue}article.single h2{margin-bottom:2rem}article.single h2,article.single.note h2{margin-top:2rem;font-size:1.5rem;line-height:2rem;font-weight:700;line-height:1.25}article.single.note h2{margin-bottom:.25rem}article.single h3{font-size:1.25rem}article.single h3,article.single h4{margin-bottom:1rem;margin-top:2rem;line-height:1.75rem;font-weight:700;line-height:1.25}article.single h4{font-size:1.125rem}article.single p{margin-bottom:1.25rem}article.single a{text-decoration-line:underline;text-underline-offset:2px}article.single a:hover{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity))}article.single .content blockquote{background-image:url(/general/alert-light.svg);background-size:30px 30px;background-repeat:no-repeat;background-position:0 5px;margin-top:2rem;margin-bottom:2rem;padding-left:3rem}article.single .content blockquote p{margin-bottom:.5rem}article.single figure{margin-top:2rem;margin-bottom:2rem}article.single figure figcaption{margin-top:.25rem;text-align:center;font-style:italic}article.single img{image-rendering:crisp-edges;image-rendering:-webkit-optimize-contrast}article.single img,article.single video{width:100%;border-radius:.25rem;--tw-bg-opacity:1!important;background-color:rgb(249 250 251/var(--tw-bg-opacity))!important}article.single audio{margin-bottom:1.5rem;width:100%}article.single code{background-color:rgb(254 249 195/var(--tw-bg-opacity))}article.single code,article.single.note code{border-radius:.25rem;--tw-bg-opacity:1;padding:.25rem .5rem;font-size:.75rem;line-height:1rem;font-weight:500}article.single.note code{background-color:rgb(243 244 246/var(--tw-bg-opacity))}article.single pre{margin-bottom:1.5rem;overflow-x:auto;border-radius:.25rem;--tw-bg-opacity:1!important;background-color:rgb(249 250 251/var(--tw-bg-opacity))!important;padding:1rem;font-size:.75rem;line-height:1rem}article.single pre code,article.single.note pre code{background:unset;padding:unset;line-height:1.625}article.single table{margin-bottom:1rem;width:100%;border-collapse:collapse;border-width:1px;--tw-border-opacity:1;border-color:rgb(0 0 0/var(--tw-border-opacity))}article.single table td,article.single table th,article.single table tr{border-width:1px;padding:.5rem 1rem;text-align:left}article.single .content ul{margin-bottom:1.5rem;list-style-type:disc;padding-left:1.5rem}@media (min-width:768px){article.single .content ul{padding-left:2.5rem}}article.single .content ol{margin-bottom:1.5rem;list-style-type:decimal;padding-left:2rem}@media (min-width:768px){article.single .content ol{padding-left:2.5rem}}article.single #TableOfContents{margin-bottom:2.5rem;margin-left:1rem;line-height:1.625}article.single #TableOfContents ul{list-style-type:decimal;padding-left:1rem}@media (min-width:768px){article.single #TableOfContents ul{padding-left:1.5rem}}article.single .content ul ul{margin-bottom:auto}article.single .katex-display{margin-top:2.5rem;margin-bottom:2.5rem}article.single .ll-iframe{border-radius:.25rem;--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}article.single .ll-iframe:before{display:flex;height:100%}@keyframes pulse{50%{opacity:.5}}article.single .ll-iframe:before{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite;cursor:pointer;align-items:center;justify-content:center;border-radius:.25rem;border-width:2px;--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity));font-size:.875rem;line-height:1.25rem;font-weight:500;content:"Click here to load resource…"}article.single .ll-iframe.empty:before{content:none}.hover\:bg-yellow-100:hover{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity))}.hover\:text-gray-800:hover{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}@media (min-width:768px){.md\:mb-0{margin-bottom:0}.md\:block{display:block}.md\:inline-block{display:inline-block}.md\:w-auto{width:auto}.md\:flex-row{flex-direction:row}.md\:p-0{padding:0}} \ No newline at end of file | /*! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.mx-auto{margin-left:auto;margin-right:auto}.my-12{margin-top:3rem;margin-bottom:3rem}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-6{margin-left:1.5rem}.mr-2{margin-right:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.contents{display:contents}.hidden{display:none}.h-4{height:1rem}.h-6{height:1.5rem}.h-full{height:100%}.w-4{width:1rem}.w-6{width:1.5rem}.w-full{width:100%}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.rounded{border-radius:.25rem}.border{border-width:1px}.border-0{border-width:0}.border-2{border-width:2px}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-orange-600{--tw-bg-opacity:1;background-color:rgb(234 88 12/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-yellow-200{--tw-bg-opacity:1;background-color:rgb(254 240 138/var(--tw-bg-opacity))}.p-2{padding:.5rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-16{padding-bottom:4rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.no-underline{text-decoration-line:none}.underline-offset-2{text-underline-offset:2px}.shadow-md{--tw-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid #0000;outline-offset:2px}.container-blog{max-width:740px}::selection{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity));--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}::-moz-selection{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity));--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.blue,a:hover{color:blue}article.single h2{margin-bottom:2rem}article.single h2,article.single.note h2{margin-top:2rem;font-size:1.5rem;line-height:2rem;font-weight:700;line-height:1.25}article.single.note h2{margin-bottom:.25rem}article.single h3{font-size:1.25rem}article.single h3,article.single h4{margin-bottom:1rem;margin-top:2rem;line-height:1.75rem;font-weight:700;line-height:1.25}article.single h4{font-size:1.125rem}article.single p{margin-bottom:1.25rem}article.single a{text-decoration-line:underline;text-underline-offset:2px}article.single a:hover{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity))}article.single .content blockquote{background-image:url(/general/alert-light.svg);background-size:30px 30px;background-repeat:no-repeat;background-position:0 5px;margin-top:2rem;margin-bottom:2rem;padding-left:3rem}article.single .content blockquote p{margin-bottom:.5rem}article.single figure{margin-top:2rem;margin-bottom:2rem}article.single figure figcaption{margin-top:.25rem;text-align:center;font-style:italic}article.single img{image-rendering:crisp-edges;image-rendering:-webkit-optimize-contrast}article.single img,article.single video{width:100%;border-radius:.25rem;--tw-bg-opacity:1!important;background-color:rgb(249 250 251/var(--tw-bg-opacity))!important}article.single audio{margin-bottom:1.5rem;width:100%}article.single code{background-color:rgb(254 249 195/var(--tw-bg-opacity))}article.single code,article.single.note code{border-radius:.25rem;--tw-bg-opacity:1;padding:.25rem .5rem;font-size:.75rem;line-height:1rem;font-weight:500}article.single.note code{background-color:rgb(243 244 246/var(--tw-bg-opacity))}article.single pre{margin-bottom:1.5rem;overflow-x:auto;border-radius:.25rem;--tw-bg-opacity:1!important;background-color:rgb(249 250 251/var(--tw-bg-opacity))!important;padding:1rem;font-size:.75rem;line-height:1rem}article.single pre code,article.single.note pre code{background:unset;padding:unset;line-height:1.625}article.single table{margin-bottom:1rem;width:100%;border-collapse:collapse;border-width:1px;--tw-border-opacity:1;border-color:rgb(0 0 0/var(--tw-border-opacity))}article.single table td,article.single table th,article.single table tr{border-width:1px;padding:.5rem 1rem;text-align:left}article.single .content ul{margin-bottom:1.5rem;list-style-type:disc;padding-left:1.5rem}@media (min-width:768px){article.single .content ul{padding-left:2.5rem}}article.single .content ol{margin-bottom:1.5rem;list-style-type:decimal;padding-left:2rem}@media (min-width:768px){article.single .content ol{padding-left:2.5rem}}article.single #TableOfContents{margin-bottom:2.5rem;margin-left:1rem;line-height:1.625}article.single #TableOfContents ul{list-style-type:decimal;padding-left:1rem}@media (min-width:768px){article.single #TableOfContents ul{padding-left:1.5rem}}article.single .content ul ul{margin-bottom:auto}article.single .katex-display{margin-top:2.5rem;margin-bottom:2.5rem}article.single .ll-iframe{border-radius:.25rem;--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}article.single .ll-iframe:before{display:flex;height:100%}@keyframes pulse{50%{opacity:.5}}article.single .ll-iframe:before{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite;cursor:pointer;align-items:center;justify-content:center;border-radius:.25rem;border-width:2px;--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity));font-size:.875rem;line-height:1.25rem;font-weight:500;content:"Click here to load resource…"}article.single .ll-iframe.empty:before{content:none}.hover\:cursor-pointer:hover{cursor:pointer}.hover\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.hover\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.hover\:bg-yellow-100:hover{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity))}.hover\:text-gray-800:hover{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}@media (min-width:768px){.md\:mb-0{margin-bottom:0}.md\:block{display:block}.md\:inline-block{display:inline-block}.md\:w-auto{width:auto}.md\:flex-row{flex-direction:row}.md\:p-0{padding:0}}@media (min-width:1024px){.lg\:block{display:block}} \ No newline at end of file | ||
diff --git a/themes/simple/layouts/_default/index.json b/themes/simple/layouts/_default/index.json new file mode 100644 index 0000000..b8f3786 --- /dev/null +++ b/themes/simple/layouts/_default/index.json | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | {{- $.Scratch.Add "index" slice -}} | ||
| 2 | {{- range .Site.RegularPages -}} | ||
| 3 | {{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "type" .Type "permalink" .RelPermalink "summary" .Summary) -}} | ||
| 4 | {{- end -}} | ||
| 5 | {{- $.Scratch.Get "index" | jsonify -}} | ||
diff --git a/themes/simple/layouts/_default/rss.xml b/themes/simple/layouts/_default/index.xml index 1f29133..1f29133 100644 --- a/themes/simple/layouts/_default/rss.xml +++ b/themes/simple/layouts/_default/index.xml | |||
diff --git a/themes/simple/layouts/_default/list.html b/themes/simple/layouts/_default/list.html index 589d07b..232598d 100644 --- a/themes/simple/layouts/_default/list.html +++ b/themes/simple/layouts/_default/list.html | |||
| @@ -1,6 +1,19 @@ | |||
| 1 | {{ define "main" }} | 1 | {{ define "main" }} |
| 2 | <main role="main" class="container-blog mx-auto px-6 md:p-0"> | 2 | <main role="main" class="container-blog mx-auto px-6 md:p-0"> |
| 3 | 3 | ||
| 4 | <!-- Search modal and results --> | ||
| 5 | {{ partial "search.html" . }} | ||
| 6 | |||
| 7 | <!-- Notes CTA --> | ||
| 8 | <a class="flex items-center gap-2 w-full bg-yellow-200 hover:cursor-pointer rounded mb-8 p-4" href="/notes.html"> | ||
| 9 | <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="hidden lg:block w-6 h-6"> | ||
| 10 | <path stroke-linecap="round" stroke-linejoin="round" d="M12 6.042A8.967 8.967 0 006 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 016 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 016-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0018 18a8.967 8.967 0 00-6 2.292m0-14.25v14.25" /> | ||
| 11 | </svg> | ||
| 12 | <p>For interesting <span span class="italic font-medium">notes</span> and | ||
| 13 | small <span class="italic font-medium">experiments</span> I usually partake | ||
| 14 | in, check the Notes page.</p> | ||
| 15 | </a> | ||
| 16 | |||
| 4 | <h1 class="text-2xl font-bold mb-6">Blog posts</h1> | 17 | <h1 class="text-2xl font-bold mb-6">Blog posts</h1> |
| 5 | 18 | ||
| 6 | <!-- List of all blog posts --> | 19 | <!-- List of all blog posts --> |
diff --git a/themes/simple/layouts/_default/notes.html b/themes/simple/layouts/_default/notes.html index 27ac958..02560b0 100644 --- a/themes/simple/layouts/_default/notes.html +++ b/themes/simple/layouts/_default/notes.html | |||
| @@ -1,12 +1,15 @@ | |||
| 1 | {{ define "main" }} | 1 | {{ define "main" }} |
| 2 | <main role="main" class="container-blog mx-auto px-6 md:p-0"> | 2 | <main role="main" class="container-blog mx-auto px-6 md:p-0"> |
| 3 | 3 | ||
| 4 | <!-- Search modal and results --> | ||
| 5 | {{ partial "search.html" . }} | ||
| 6 | |||
| 4 | <section class="mb-6"> | 7 | <section class="mb-6"> |
| 5 | <h1 class="text-2xl font-bold mb-2">Notes, notes and notes</h1> | 8 | <h1 class="text-2xl font-bold mb-2">Notes, notes and notes</h1> |
| 6 | <p class="text-gray-600 italic"> | 9 | <p class="text-gray-600 italic"> |
| 7 | Notes about things I learn, things I do, things I want to remember, | 10 | Notes about things I learn, things I do, things I want to remember, |
| 8 | but never do. You can subscribe to this | 11 | but never do. You can subscribe to this |
| 9 | <a href="/notes.xml" class="underline hover:bg-yellow-100">RSS feed</a> | 12 | <a href="/notes/index.xml" class="underline hover:bg-yellow-100">RSS feed</a> |
| 10 | which contains only the notes without the blog posts. | 13 | which contains only the notes without the blog posts. |
| 11 | </p> | 14 | </p> |
| 12 | </section> | 15 | </section> |
diff --git a/themes/simple/layouts/_default/single.html b/themes/simple/layouts/_default/single.html index 77354b7..cadfd7b 100644 --- a/themes/simple/layouts/_default/single.html +++ b/themes/simple/layouts/_default/single.html | |||
| @@ -1,6 +1,9 @@ | |||
| 1 | {{ define "main" }} | 1 | {{ define "main" }} |
| 2 | <main role="main" class="container-blog mx-auto px-6 md:p-0"> | 2 | <main role="main" class="container-blog mx-auto px-6 md:p-0"> |
| 3 | 3 | ||
| 4 | <!-- Search modal and results --> | ||
| 5 | {{ partial "search.html" . }} | ||
| 6 | |||
| 4 | <!-- Single article --> | 7 | <!-- Single article --> |
| 5 | <article itemtype="http://schema.org/Article" class="single mb-12"> | 8 | <article itemtype="http://schema.org/Article" class="single mb-12"> |
| 6 | <header class="mb-6"> | 9 | <header class="mb-6"> |
diff --git a/themes/simple/layouts/partials/head.html b/themes/simple/layouts/partials/head.html index 6d40525..fc481fc 100644 --- a/themes/simple/layouts/partials/head.html +++ b/themes/simple/layouts/partials/head.html | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | 6 | ||
| 7 | <link rel="alternate" type="application/rss+xml" href="/index.xml" title="{{ .Site.Author.name }}"> | 7 | <link rel="alternate" type="application/rss+xml" href="/index.xml" title="{{ .Site.Author.name }}"> |
| 8 | <link rel="alternate" type="application/rss+xml" href="/notes.xml" title="{{ .Site.Author.name }} - Notes"> | 8 | <link rel="alternate" type="application/rss+xml" href="/notes/index.xml" title="{{ .Site.Author.name }} - Notes"> |
| 9 | 9 | ||
| 10 | <link rel="stylesheet" href="/general/index.css?v={{ $cachebuster }}"> | 10 | <link rel="stylesheet" href="/general/index.css?v={{ $cachebuster }}"> |
| 11 | 11 | ||
diff --git a/themes/simple/layouts/partials/navigation.html b/themes/simple/layouts/partials/navigation.html index da42679..b65fe35 100644 --- a/themes/simple/layouts/partials/navigation.html +++ b/themes/simple/layouts/partials/navigation.html | |||
| @@ -7,6 +7,14 @@ | |||
| 7 | <nav itemscope itemtype="http://schema.org/SiteNavigationElement" class="flex items-center gap-1" role="toolbar"> | 7 | <nav itemscope itemtype="http://schema.org/SiteNavigationElement" class="flex items-center gap-1" role="toolbar"> |
| 8 | <meta itemprop="name" content="Main Menu"> | 8 | <meta itemprop="name" content="Main Menu"> |
| 9 | 9 | ||
| 10 | <!-- Search button --> | ||
| 11 | <span class="search-button flex gap-1 items-center text-gray-500 bg-gray-100 hover:bg-gray-200 rounded px-2 py-1 text-xs cursor-pointer mr-2 hidden" onclick="showSearchModal()"> | ||
| 12 | <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="3" stroke="currentColor" class="w-4 h-4"> | ||
| 13 | <path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" /> | ||
| 14 | </svg> | ||
| 15 | <span class="search-button-text uppercase font-bold"></span> | ||
| 16 | </span> | ||
| 17 | |||
| 10 | <a href="/notes.html" class="font-medium px-2 hover:bg-yellow-100">Notes</a> | 18 | <a href="/notes.html" class="font-medium px-2 hover:bg-yellow-100">Notes</a> |
| 11 | <a href="https://telegram.me/mitjafelicijan" target="_blank" rel="noopener nofollow" itemprop="url" class="font-medium px-2 hover:bg-yellow-100">Telegram</a> | 19 | <a href="https://telegram.me/mitjafelicijan" target="_blank" rel="noopener nofollow" itemprop="url" class="font-medium px-2 hover:bg-yellow-100">Telegram</a> |
| 12 | <a href="https://git.mitjafelicijan.com" target="_blank" rel="noopener nofollow" itemprop="url" class="font-medium px-2 hover:bg-yellow-100">Git</a> | 20 | <a href="https://git.mitjafelicijan.com" target="_blank" rel="noopener nofollow" itemprop="url" class="font-medium px-2 hover:bg-yellow-100">Git</a> |
diff --git a/themes/simple/layouts/partials/search.html b/themes/simple/layouts/partials/search.html new file mode 100644 index 0000000..3e31753 --- /dev/null +++ b/themes/simple/layouts/partials/search.html | |||
| @@ -0,0 +1,123 @@ | |||
| 1 | <section class="search-modal mb-10 hidden"> | ||
| 2 | <input class="bg-gray-100 w-full px-3 py-2 rounded outline-none" type="search" placeholder="Search here..."> | ||
| 3 | <section class="results bg-white border border-gray-200 shadow-md p-2 flex flex-col gap-2 rounded mt-4 hidden"></section> | ||
| 4 | </section> | ||
| 5 | |||
| 6 | <script src="https://unpkg.com/lunr/lunr.js"></script> | ||
| 7 | <script> | ||
| 8 | (async function() { | ||
| 9 | const debounceDelay = 700; | ||
| 10 | |||
| 11 | // Fetch search index generated by Hugo. | ||
| 12 | const req = await fetch('/index.json'); | ||
| 13 | window.searchDocuments = await req.json(); | ||
| 14 | |||
| 15 | window.searchIndex = lunr(function() { | ||
| 16 | this.ref('permalink'); | ||
| 17 | this.field('title', { boost: 20 }); | ||
| 18 | this.field('tags', { boost: 10 }); | ||
| 19 | this.field('summary', { boost: 1 }); | ||
| 20 | |||
| 21 | window.searchDocuments.forEach(function(doc) { | ||
| 22 | this.add(doc); | ||
| 23 | }, this); | ||
| 24 | |||
| 25 | console.log('Search index processed...'); | ||
| 26 | }) | ||
| 27 | |||
| 28 | // Connect DOM and search the index. | ||
| 29 | let cachedSearchTerm = null; | ||
| 30 | const searchModal = document.querySelector('.search-modal'); | ||
| 31 | const searchInput = document.querySelector('.search-modal input'); | ||
| 32 | const searchResults = document.querySelector('.search-modal .results'); | ||
| 33 | |||
| 34 | // Display search modal. | ||
| 35 | window.showSearchModal = function() { | ||
| 36 | searchModal.classList.remove('hidden'); | ||
| 37 | searchInput.focus(); | ||
| 38 | } | ||
| 39 | |||
| 40 | // Detect OS and sets proper search button text. | ||
| 41 | const searchButtonElement = document.querySelector('.search-button'); | ||
| 42 | const searchButtonTextElement = document.querySelector('.search-button-text'); | ||
| 43 | if (searchButtonElement) { | ||
| 44 | let searchButtonText = 'ctrl+k'; | ||
| 45 | if (navigator.platform.toUpperCase().indexOf('MAC') >= 0) { | ||
| 46 | searchButtonText = 'cmd+k'; | ||
| 47 | } | ||
| 48 | searchButtonTextElement.innerText = searchButtonText; | ||
| 49 | searchButtonElement.classList.remove('hidden'); | ||
| 50 | } | ||
| 51 | |||
| 52 | // On keyboard shortcut shows search modal. | ||
| 53 | document.addEventListener('keydown', function(event) { | ||
| 54 | // Handles macOS CMD+k. | ||
| 55 | if ((event.ctrlKey || event.metaKey) && event.key === 'k') { | ||
| 56 | event.preventDefault(); | ||
| 57 | showSearchModal(); | ||
| 58 | } | ||
| 59 | |||
| 60 | // Handles Windows/Linux Ctrl+k. | ||
| 61 | if (event.ctrlKey && event.key === 'k') { | ||
| 62 | event.preventDefault(); | ||
| 63 | showSearchModal(); | ||
| 64 | } | ||
| 65 | }); | ||
| 66 | |||
| 67 | // Debounce magic. | ||
| 68 | function debounce(func, delay) { | ||
| 69 | let timerId; | ||
| 70 | return function (...args) { | ||
| 71 | clearTimeout(timerId); | ||
| 72 | timerId = setTimeout(() => { | ||
| 73 | func.apply(this, args); | ||
| 74 | }, delay); | ||
| 75 | }; | ||
| 76 | } | ||
| 77 | |||
| 78 | // Do the actual search. | ||
| 79 | searchInput.addEventListener('keyup', debounce((evt)=> { | ||
| 80 | const query = evt.target.value.trim().toLowerCase(); | ||
| 81 | if (query.length && query != cachedSearchTerm) { | ||
| 82 | const results = searchIndex.search(query); | ||
| 83 | |||
| 84 | if (results.length == 0) { | ||
| 85 | searchResults.classList.add('hidden'); | ||
| 86 | } else { | ||
| 87 | searchResults.innerText = ''; | ||
| 88 | searchResults.classList.remove('hidden'); | ||
| 89 | cachedSearchTerm = query; | ||
| 90 | |||
| 91 | results.forEach(resultItem => { | ||
| 92 | const item = window.searchDocuments.find(doc => doc.permalink === resultItem.ref); | ||
| 93 | |||
| 94 | const link = document.createElement('a'); | ||
| 95 | link.href = item.permalink; | ||
| 96 | link.classList.add('hover:bg-gray-100', 'cursor-pointer', 'py-2', 'px-3', 'rounded'); | ||
| 97 | |||
| 98 | const title = document.createElement('div'); | ||
| 99 | title.classList.add('text-gray-800', 'font-medium'); | ||
| 100 | title.innerHTML = item.title; | ||
| 101 | link.appendChild(title); | ||
| 102 | |||
| 103 | const meta = document.createElement('div'); | ||
| 104 | meta.classList.add('text-gray-500', 'flex', 'items-center', 'gap-2'); | ||
| 105 | |||
| 106 | const section = document.createElement('span'); | ||
| 107 | section.classList.add('uppercase', 'text-xs', 'font-medium', 'bg-gray-200', 'px-1', 'rounded') | ||
| 108 | section.innerText = item.type; | ||
| 109 | meta.appendChild(section); | ||
| 110 | |||
| 111 | const summary = document.createElement('span'); | ||
| 112 | const summaryText = item.summary.length > 80 ? `${item.summary.substring(0, 80)}...` : item.summary; | ||
| 113 | summary.innerHTML = summaryText; | ||
| 114 | meta.appendChild(summary); | ||
| 115 | |||
| 116 | link.appendChild(meta); | ||
| 117 | searchResults.appendChild(link); | ||
| 118 | }); | ||
| 119 | } | ||
| 120 | } | ||
| 121 | }, debounceDelay)); | ||
| 122 | })(); | ||
| 123 | </script> | ||
diff --git a/themes/simple/layouts/section/section.json b/themes/simple/layouts/section/section.json new file mode 100644 index 0000000..b8f3786 --- /dev/null +++ b/themes/simple/layouts/section/section.json | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | {{- $.Scratch.Add "index" slice -}} | ||
| 2 | {{- range .Site.RegularPages -}} | ||
| 3 | {{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "type" .Type "permalink" .RelPermalink "summary" .Summary) -}} | ||
| 4 | {{- end -}} | ||
| 5 | {{- $.Scratch.Get "index" | jsonify -}} | ||
diff --git a/themes/simple/layouts/section/notes.xml b/themes/simple/layouts/section/section.xml index 889cf08..889cf08 100644 --- a/themes/simple/layouts/section/notes.xml +++ b/themes/simple/layouts/section/section.xml | |||
diff --git a/themes/simple/static/css/tailwind.css b/themes/simple/static/css/tailwind.css index 51b922c..7d04496 100644 --- a/themes/simple/static/css/tailwind.css +++ b/themes/simple/static/css/tailwind.css | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | /* Container */ | 7 | /* Container */ |
| 8 | .container-blog { | 8 | .container-blog { |
| 9 | max-width: 700px; | 9 | max-width: 740px; |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | /* User text selection */ | 12 | /* User text selection */ |
