From 03f402c3e4fe8865571cf462e60dec5e0c9b713a Mon Sep 17 00:00:00 2001 From: Jieiku Date: Mon, 30 May 2022 22:38:50 -0700 Subject: Add Search and Improve Contrast --- README.md | 14 ++++---- config.toml | 2 +- content/pages/about.md | 2 +- sass/_variables.scss | 4 +-- sass/abridge.scss | 2 ++ sass/include/_nav.scss | 26 ++++++++------ sass/include/_recent.scss | 35 ------------------- sass/include/_search.scss | 46 +++++++++++++++++++++++++ sass/themes/_auto.scss | 10 ++++-- sass/themes/_light.scss | 6 ++-- screenshot.png | Bin 188541 -> 190381 bytes static/processed_images/199de027950a8f4800.jpg | Bin 0 -> 37494 bytes static/search.min.js | 1 + templates/base.html | 36 +++++++++++++++++-- templates/index.html | 2 +- 15 files changed, 121 insertions(+), 65 deletions(-) delete mode 100644 sass/include/_recent.scss create mode 100644 sass/include/_search.scss create mode 100644 static/processed_images/199de027950a8f4800.jpg create mode 100644 static/search.min.js diff --git a/README.md b/README.md index 90b9cd3..24cea96 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Abridge is a fast and lightweight Zola theme using semantic html, class-light [abridge.css](https://github.com/jieiku/abridge.css), and No JS. +![abridge](screenshot.png) + ## Demo [https://jieiku.github.io/abridge-demo/](https://jieiku.github.io/abridge-demo/) @@ -117,10 +119,11 @@ Use search function for the content. build_search_index = true ``` -Currently this theme has not yet implemented a search, there are however several themes that have. -For the moment you can look at how those other themes have implemented their search. -I plan to implement a search field eventually, but am still weighing my options. -I would prefer a self hosted search method that works even if javascript is disabled in the browser. (open an issue report if you know of one.) +​The search is the only thing that requires javascript in this this theme. + +If you set `build_search_index` to false then the javascript file will no longer be loaded. + +The default elasticlunr search is currently used, I may eventually switch this out for something else. #### Configuration options under the `extra` @@ -204,8 +207,7 @@ If your problem or idea is not addressed yet, [open a new issue](https://github. ## Contributing We'd love your help! Especially with fixes to issues. -The overall idea behind abridge is to be lightweight and fast, and to use zero javascript. -The only place that I may eventually add javascript will be for the site search, but hopefully I can find another way. +The overall idea behind abridge is to be lightweight and fast, and to use zero javascript other than the search. ## License diff --git a/config.toml b/config.toml index 7cb9809..6e6b5cc 100644 --- a/config.toml +++ b/config.toml @@ -6,7 +6,7 @@ default_language = "en" output_dir = "public" compile_sass = true -build_search_index = false +build_search_index = true minify_html = false generate_feed = true feed_filename = "atom.xml" diff --git a/content/pages/about.md b/content/pages/about.md index 1e7d7e7..6632426 100644 --- a/content/pages/about.md +++ b/content/pages/about.md @@ -12,7 +12,7 @@ Some fun facts about the theme: * Perfect score on Google's Lighthouse audit * Only ~4 KB of CSS before enabling the SVG CSS icons. -* No JavaScript +* No JavaScript (except the search which can be disabled) * Now with SEO! Nearly half of the existing Zola MIT themes were inspiration for features and design of this theme. diff --git a/sass/_variables.scss b/sass/_variables.scss index 72adc3e..6fa3915 100644 --- a/sass/_variables.scss +++ b/sass/_variables.scss @@ -15,8 +15,8 @@ $enable-responsive-spacings: false !default; // Enable a centered viewport for
,
,