From 940b40688a7cf595eee061b696187e2fe4a578e2 Mon Sep 17 00:00:00 2001 From: Jieiku Date: Mon, 22 May 2023 22:31:34 -0700 Subject: Json-Index and config.toml optional --- static/font/Roboto-Mono-Italic.woff2 | Bin 0 -> 13572 bytes static/font/Roboto-Mono.woff2 | Bin 0 -> 12312 bytes static/search.js | 20 +++++++++++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 static/font/Roboto-Mono-Italic.woff2 create mode 100644 static/font/Roboto-Mono.woff2 (limited to 'static') diff --git a/static/font/Roboto-Mono-Italic.woff2 b/static/font/Roboto-Mono-Italic.woff2 new file mode 100644 index 0000000..ece53bd Binary files /dev/null and b/static/font/Roboto-Mono-Italic.woff2 differ diff --git a/static/font/Roboto-Mono.woff2 b/static/font/Roboto-Mono.woff2 new file mode 100644 index 0000000..f8894ba Binary files /dev/null and b/static/font/Roboto-Mono.woff2 differ diff --git a/static/search.js b/static/search.js index 61c67c0..e6adedf 100644 --- a/static/search.js +++ b/static/search.js @@ -165,11 +165,24 @@ Source: - https://github.com/aaranxu/adidoks/blob/main/static/js/search.js */ (function(){ - var index = elasticlunr.Index.load(window.searchIndex); + //var index = elasticlunr.Index.load(window.searchIndex); + var index; searchinput.addEventListener('input', show_results, true); suggestions.addEventListener('click', accept_suggestion, true); - function show_results(){ + async function show_results(){ + var initIndex = async function () { + if (index === undefined) { + index = fetch("/search_index.en.json") + .then( + async function(response) { + return await elasticlunr.Index.load(await response.json()); + } + ); + } + let res = await index; + return res; + } var value = this.value.trim(); var options = { bool: "OR", @@ -178,7 +191,8 @@ Source: body: {boost: 1}, } }; - var results = index.search(value, options); + //var results = index.search(value, options); + var results = (await initIndex()).search(value, options); var entry, childs = suggestions.childNodes; var i = 0, len = results.length; -- cgit v1.3.1 From 6dcec618d0ff0a2270f787f62267a0622275c69d Mon Sep 17 00:00:00 2001 From: Jieiku Date: Mon, 22 May 2023 22:37:44 -0700 Subject: Load Tinysearch/Stork On Demand --- .gitignore | 8 +- README.md | 8 +- config.toml | 138 ++++++++-------- content/static/stork_toml.md | 2 +- content/static/tinysearch_json.md | 2 +- package.json | 38 ++--- static/abridge-bundle-nofacade.min.js | 1 - static/abridge-bundle-nosearch.min.js | 1 - static/abridge-bundle-noswitcher.min.js | 1 - static/abridge-bundle-noswitchernosearch.min.js | 1 - static/abridge-bundle-searchonly.min.js | 1 - static/abridge-bundle-stork.min.js | 1 - static/abridge-bundle-tinysearch.min.js | 1 - static/abridge-bundle.min.js | 1 - static/abridge-searchonly.min.js | 1 - static/abridge.min.js | 2 +- static/auto-render.min.js | 1 - static/katex-auto-render.min.js | 1 + static/katexbundle.min.js | 2 +- static/package.json | 18 --- static/search_bundle.min.js | 1 - static/search_bundle_stork.min.js | 1 - static/search_bundle_tinysearch.min.js | 1 - static/search_elasticlunr.min.js | 1 + static/search_facade.js | 15 -- static/search_facade_stork.js | 16 -- static/search_facade_tinysearch.js | 16 -- static/search_stork.min.js | 1 + static/search_tinysearch.min.js | 1 + static/stork.st | Bin 270439 -> 270712 bytes static/stork.wasm | Bin 345812 -> 336673 bytes static/stork_config.js | 13 +- static/tinysearch.js | 22 ++- static/tinysearch_engine.d.ts | 38 ----- static/tinysearch_engine.js | 203 ------------------------ static/tinysearch_engine_bg.wasm | Bin 93153 -> 96681 bytes static/tinysearch_engine_bg.wasm.d.ts | 6 - templates/base.html | 6 +- templates/macros/create_tinysearch_json.html | 2 +- templates/macros/head.html | 44 +---- templates/robots.txt | 5 + 41 files changed, 135 insertions(+), 486 deletions(-) delete mode 100644 static/abridge-bundle-nofacade.min.js delete mode 100644 static/abridge-bundle-nosearch.min.js delete mode 100644 static/abridge-bundle-noswitcher.min.js delete mode 100644 static/abridge-bundle-noswitchernosearch.min.js delete mode 100644 static/abridge-bundle-searchonly.min.js delete mode 100644 static/abridge-bundle-stork.min.js delete mode 100644 static/abridge-bundle-tinysearch.min.js delete mode 100644 static/abridge-bundle.min.js delete mode 100644 static/abridge-searchonly.min.js delete mode 100644 static/auto-render.min.js create mode 100644 static/katex-auto-render.min.js delete mode 100644 static/package.json delete mode 100644 static/search_bundle.min.js delete mode 100644 static/search_bundle_stork.min.js delete mode 100644 static/search_bundle_tinysearch.min.js create mode 100644 static/search_elasticlunr.min.js delete mode 100644 static/search_facade.js delete mode 100644 static/search_facade_stork.js delete mode 100644 static/search_facade_tinysearch.js create mode 100644 static/search_stork.min.js create mode 100644 static/search_tinysearch.min.js delete mode 100644 static/tinysearch_engine.d.ts delete mode 100644 static/tinysearch_engine.js delete mode 100644 static/tinysearch_engine_bg.wasm.d.ts (limited to 'static') diff --git a/.gitignore b/.gitignore index f37ca2d..789108f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,10 @@ +.env public themes storage -static/demo.html \ No newline at end of file +build +static/demo.html +static/tinysearch_engine.js +static/tinysearch_engine.d.ts +static/tinysearch_engine_bg.wasm.d.ts +static/package.json diff --git a/README.md b/README.md index 4f4d844..6c52a69 100644 --- a/README.md +++ b/README.md @@ -162,13 +162,18 @@ stork demo: https://jieiku.github.io/abridge-stork/ **Switch to tinysearch:** First you have to install tinysearch so that you can build the index: +(you also need to download the latest stork.wasm into the abridge static folder) ```shell +sudo pacman -S install wasm-pack binaryen git clone https://github.com/tinysearch/tinysearch cd tinysearch cargo build --release sudo cp ./target/release/tinysearch /usr/local/bin/tinysearch exit # reload shell environment + +cd ~/.dev/abridge/static +curl -s https://api.github.com/repos/jameslittle230/stork/releases/latest | grep "browser_download_url.*stork.wasm" | cut -d : -f 2,3 | tr -d \" | wget -i - ``` Switch abridge to tinysearch: @@ -192,6 +197,7 @@ git clone https://github.com/jameslittle230/stork cd stork cargo build --release sudo cp ./target/release/stork /usr/local/bin/stork + exit # reload shell environment ``` @@ -305,7 +311,7 @@ Abridge Alternate Bundles: Support Files: - theme.min.js (not a bundle, just a minification of theme.js) -- katexbundle.min.js - includes: katex.min.js mathtex-script-type.min.js auto-render.min.js katexoptions.js +- katexbundle.min.js - includes: katex.min.js mathtex-script-type.min.js katex-auto-render.min.js katexoptions.js - search_bundle.min.js: includes: search_index.en, elasticlunr, search (loaded on demand by search_facade) ### Global Configuration diff --git a/config.toml b/config.toml index 79b74a3..e4cb885 100644 --- a/config.toml +++ b/config.toml @@ -2,13 +2,13 @@ base_url = "https://abridge.netlify.app" #base_url = "/home/jieiku/.dev/abridge/public/" # Usable site directly from disk, also set in [extra] uglyurls = true title = "Abridge" -#description = "Abridge is a fast and lightweight Zola theme using semantic html, abridge.css class-light CSS, and No Mandatory JS." -#default_language = "en" -#output_dir = "public" +description = "Abridge is a fast and lightweight Zola theme using semantic html, abridge.css class-light CSS, and No Mandatory JS." +default_language = "en" compile_sass = true -#minify_html = false -#generate_feed = true -#feed_filename = "atom.xml" +minify_html = false +generate_feed = true +feed_filename = "atom.xml" +output_dir = "public" #ignored_content = ["*.{graphml,xlsx}", "temp.*"] #hard_link_static = false # set to true to hard link instead of copying, useful for very large files. taxonomies = [ @@ -18,28 +18,26 @@ taxonomies = [ #theme = "abridge" -#[markdown] -#highlight_code = true -#highlight_theme = "css" - -#render_emoji = false -#external_links_target_blank = true # rel="noopener" -#external_links_no_follow = false # rel="nofollow" -#external_links_no_referrer = false # rel="noreferrer" -#smart_punctuation = false # `...` to `…`, `"quote"` to `“curly”` etc - build_search_index = true + [search] # Options specific to elasticlunr search. index_format = "elasticlunr_json" include_title = true # include title of page/section in index -include_description = false # include description of page/section in index +include_description = true # include description of page/section in index include_content = true # include rendered content of page/section in index # truncate_content_length = 100 # Truncate at nth character. May be useful if index is getting too large. -#[extra] -#uglyurls = false # if set to true then links are generated with the full path. eg https://abridge.netlify.app/index.html -#language_code = "en-US" +[markdown] +highlight_code = true +highlight_theme = "css" +render_emoji = false +external_links_target_blank = true # rel="noopener" +external_links_no_follow = false # rel="nofollow" +external_links_no_referrer = false # rel="noreferrer" +smart_punctuation = false # `...` to `…`, `"quote"` to `“curly”` etc +[extra] +uglyurls = false # if set to true then links are generated with the full path. eg https://abridge.netlify.app/index.html ############################################################################### ### meta/seo/analytic tags @@ -47,15 +45,16 @@ include_content = true # include rendered content of page/section in index ### To always set the page title exactly eg "Abridge" then comment out title_addition or set to false (not recommend, bad for SEO) ############################################################################### -#title_separator = "|" # Separator between title and title_addition, set as |, -, _, etc -#title_addition = "Fast & Lightweight Zola Theme" # a default value for title addition -#author = "Jake G" # Put Your Name here -#keywords = "Abridge, Abridge.css, Zola, Theme, Zola Theme, getzola, Semantic Html, Fast, lightweight" # used for the primary site index -#banner = "banner.png" # Used as default image for OpenGraph/Twitter if page specific image is undefined. -#twitter = "your-user-name" # for SEO: twitter:site and twitter:creator -#google = "Your Google Site verification code." -#bing = "Your Bing Site verification code." -#seo = true # enable or disable seo-related meta tags: opengraph, facebook, twitter +language_code = "en-US" +title_separator = "|" # Separator between title and title_addition, set as |, -, _, etc +title_addition = "Fast & Lightweight Zola Theme" # a default value for title addition +author = "Jake G" # Put Your Name here +keywords = "Abridge, Abridge.css, Zola, Theme, Zola Theme, getzola, Semantic Html, Fast, lightweight" # used for the primary site index +banner = "banner.png" # Used as default image for OpenGraph/Twitter if page specific image is undefined. +twitter = "your-user-name" # for SEO: twitter:site and twitter:creator +google = "Your Google Site verification code." +bing = "Your Bing Site verification code." +seo = true # enable or disable seo-related meta tags: opengraph, facebook, twitter ############################################################################### @@ -65,56 +64,57 @@ include_content = true # include rendered content of page/section in index ### divider: " " "·" "•" ############################################################################### -#recent = true # TOC / index -#recent_items = 9 +recent = true # TOC / index +recent_items = 9 -#meta_index = { position="bottom", size="s90", author=false, readtime=false, readstring="min", date=true, categories_tags=true, divider=" " } -#meta_post = { position="top", size="s95", author=true, readtime=false, readstring="min read", date=true, categories_tags=true, divider=" " } +meta_index = { position="bottom", size="s90", author=false, readtime=false, readstring="min", date=true, categories_tags=true, divider=" " } +meta_post = { position="top", size="s95", author=true, readtime=false, readstring="min read", date=true, categories_tags=true, divider=" " } -#title_size_index = "s85" # size: s95, s90, s85, s80, s75, s70, false(full size) -#footer_size = "s90" # size: s95, s90, s85, s80, s75, s70, false(full size) -#footer_credit = false +title_size_index = "s85" # size: s95, s90, s85, s80, s75, s70, false(full size) +footer_size = "s90" # size: s95, s90, s85, s80, s75, s70, false(full size) +footer_credit = true #footer_credit_override = '
' ### Uncomment one of the below lines, or neither, depending on which type of logo you want to use: #logo = { file="logo.svg", width="32", height="32", alt="Abridge", text="bridge" } #textlogo = 'Abridge' -#textlogo = 'bridge' +textlogo = 'bridge' -#sitedesc = false # enables or disables the display of the site description below the logo. +sitedesc = false # enables or disables the display of the site description below the logo. #copyright_start_year = 2019 # optional #copyright_end_year = 2020 # optional, recommend leaving unset, zola build will set this to current year by default -#headhr = false # show or hide horizontal rule below header -#foothr = true # show or hide horizontal rule above footer - -#menu = [ -# {url = "/about/", name = "About", slash = true, blank = false}, -# {url = "/posts/", name = "Posts", slash = true, blank = false}, -# {url = "/categories/", name = "Categories", slash = true, blank = false}, -# {url = "/tags/", name = "Tags", slash = true, blank = false}, -#] -#menu_footer = [ -# {url = "/about/", name = "About", slash = true, blank = false}, -# {url = "/contact/", name = "Contact", slash = true, blank = false}, -# {url = "/privacy/", name = "Privacy", slash = true, blank = false}, -# {url = "/sitemap.xml", name = "Sitemap", slash = false, blank = true}, -#] +headhr = false # show or hide horizontal rule below header +foothr = true # show or hide horizontal rule above footer + +menu = [ + {url = "/about/", name = "About", slash = true, blank = false}, + {url = "/posts/", name = "Posts", slash = true, blank = false}, + {url = "/categories/", name = "Categories", slash = true, blank = false}, + {url = "/tags/", name = "Tags", slash = true, blank = false}, +] +menu_footer = [ + {url = "/about/", name = "About", slash = true, blank = false}, + {url = "/contact/", name = "Contact", slash = true, blank = false}, + {url = "/privacy/", name = "Privacy", slash = true, blank = false}, + {url = "/sitemap.xml", name = "Sitemap", slash = false, blank = true}, +] ############################################################################### ### Resource Files ### You can load extra css files if you need to, just separate by comma: ### stylesheets = [ "abridge.css", "extra.css" ] +### search_library: library to use, valid values: false, "elasticlunr", "tinysearch", "stork" ############################################################################### -#integrity = true # increases site security, should normally be true. (setting to false is useful during js development) -#js_bundle = false # multiple javascript files combined into a single file (setting to false is useful during js development) - -#js_switcher = true # The button that allows manually changing between light/dark mode. +integrity = true # increases site security, should normally be true. (setting to false is useful during js development) +js_bundle = false # multiple javascript files combined into a single file (setting to false is useful during js development) +js_switcher = true # The button that allows manually changing between light/dark mode. +js_copycode = true # The copy button on code blocks that allows you to copy them to the clipboard. -#search_library = false # search library to use, valid values are: false, "elasticlunr", "tinysearch", "stork" (false/elasticlunr causes issues) +search_library = 'elasticlunr' -#js_search_index = "search_index.en.json" # Separate Always, generated each build +js_search_index = "search_index.en.json" # Separate Always, generated each build #js_theme = "theme.min.js" # Separate Always, comment out if using -auto/-light/-dark stylesheet. (required for switcher) #js_themeButton = "theme_button.js"# Bundleable - light/dark switcher button #js_prestyle = "prestyle.js"# Bundleable - used to preload: FontAwesome, Katex, external Google Fonts @@ -122,7 +122,7 @@ include_content = true # include rendered content of page/section in index #js_email = "email.js"# Bundleable - obfuscates email address in footer ########## Switcher ########## (comment this block out if NOT using switcher): -#stylesheets = [ "abridge.css" ] # Orange Automatic Dark/Light Theme based on browser/system preference with switcher +stylesheets = [ "abridge.css" ] # Orange Automatic Dark/Light Theme based on browser/system preference with switcher ########## No Switcher ########## #stylesheets = [ "abridge-auto.css" ] # Orange Automatic Dark/Light Theme based on browser/system preference @@ -134,14 +134,14 @@ include_content = true # include rendered content of page/section in index ### Favicons, comment out a line to disable loading some or all of these if needed. ############################################################################### -#favicon_theme_color = "#333333" -#favicon_ms_color = "#333333" -#favicon_webmanifest = "site.webmanifest" # Used for android-chrome-512x512.png and android-chrome-192x192.png -#favicon_mask = "safari-pinned-tab.svg" # safari-pinned-tab.svg -#favicon_mask_color = "#ff9900" -#favicon180 = "apple-touch-icon.png" # apple-touch-icon.png -#favicon32 = "favicon-32x32.png" # favicon-32x32.png -#favicon16 = "favicon-16x16.png" # favicon-16x16.png +favicon_theme_color = "#333333" +favicon_ms_color = "#333333" +favicon_webmanifest = "site.webmanifest" # Used for android-chrome-512x512.png and android-chrome-192x192.png +favicon_mask = "safari-pinned-tab.svg" # safari-pinned-tab.svg +favicon_mask_color = "#ff9900" +favicon180 = "apple-touch-icon.png" # apple-touch-icon.png +favicon32 = "favicon-32x32.png" # favicon-32x32.png +favicon16 = "favicon-16x16.png" # favicon-16x16.png ############################################################################### @@ -262,7 +262,7 @@ include_content = true # include rendered content of page/section in index #katex_css = "katex.min.css" # Fonts - load the css/fonts locally #katex_js = "katex.min.js" # use local js, so that we dont have to whitelist cdn.jsdelivr.net for script src in CSP #mathtex_js = "mathtex-script-type.min.js" # use local js, so that we dont have to whitelist cdn.jsdelivr.net for script src in CSP -#katex_autorender_js = "auto-render.min.js" +#katex_autorender_js = "katex-auto-render.min.js" ### Load Katex External Resources #katex_css = "https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.min.css" # Fonts - use remote fonts diff --git a/content/static/stork_toml.md b/content/static/stork_toml.md index f9a5261..e427a93 100644 --- a/content/static/stork_toml.md +++ b/content/static/stork_toml.md @@ -1,5 +1,5 @@ +++ path = "data_stork" template = "stork_toml.html" -draft = false +draft = true +++ diff --git a/content/static/tinysearch_json.md b/content/static/tinysearch_json.md index b060bb2..c91a639 100644 --- a/content/static/tinysearch_json.md +++ b/content/static/tinysearch_json.md @@ -1,5 +1,5 @@ +++ path = "data_tinysearch" template = "tinysearch_json.html" -draft = false +draft = true +++ diff --git a/package.json b/package.json index 5a437f5..6a08be8 100644 --- a/package.json +++ b/package.json @@ -6,34 +6,18 @@ "license": "MIT", "homepage": "https://github.com/Jieiku/abridge", "scripts": { - "searchonly": "uglifyjs static/elasticlunr.min.js static/search.js -c -m -o static/abridge-searchonly.min.js", - "noswitcher": "uglifyjs static/prestyle.js static/email.js static/codecopy.js static/elasticlunr.min.js static/search.js -c -m -o static/abridge-bundle-noswitcher.min.js", - "nosearch": "uglifyjs static/prestyle.js static/theme_button.js static/email.js static/codecopy.js -c -m -o static/abridge-bundle-nosearch.min.js", - "noswitchernosearch": "uglifyjs static/prestyle.js static/email.js static/codecopy.js -c -m -o static/abridge-bundle-noswitchernosearch.min.js", - "nofacade": "uglifyjs static/prestyle.js static/theme_button.js static/email.js static/codecopy.js static/elasticlunr.min.js static/search.js -c -m -o static/abridge-bundle-nofacade.min.js", "theme": "uglifyjs static/theme.js -c -m -o static/theme.min.js", - "katex-bundle": "uglifyjs static/katex.min.js static/mathtex-script-type.min.js static/auto-render.min.js static/katexoptions.js -c -m -o static/katexbundle.min.js", - "search-bundle": "uglifyjs public/search_index.en.js public/elasticlunr.min.js public/search.js -c -m -o static/search_bundle.min.js", - "search-bundle-stork": "uglifyjs static/stork.js static/stork_config.js -c -m -o static/search_bundle_stork.min.js", - "search-bundle-tinysearch": "uglifyjs static/tinysearch.js -c -m -o static/search_bundle_tinysearch.min.js", - "sha256": "sha256=$(shasum -b -a 256 'static/search_bundle.min.js' | awk '{ print $1 }') && echo $sha256 && sed -i \"s|sha256='.*'|sha256='$sha256'|\" 'themes/abridge/static/search_facade.js'", - "sha256-demo": "sha256=$(shasum -b -a 256 'static/search_bundle.min.js' | awk '{ print $1 }') && echo $sha256 && sed -i \"s|sha256='.*'|sha256='$sha256'|\" 'static/search_facade.js'", - "sha256-stork": "sha256=$(shasum -b -a 256 'static/search_bundle_stork.min.js' | awk '{ print $1 }') && echo $sha256 && sed -i \"s|sha256='.*'|sha256='$sha256'|\" 'static/search_facade_stork.js'", - "sha256-tinysearch": "sha256=$(shasum -b -a 256 'static/search_bundle_tinysearch.min.js' | awk '{ print $1 }') && echo $sha256 && sed -i \"s|sha256='.*'|sha256='$sha256'|\" 'static/search_facade_tinysearch.js'", - "sha384": "sha384=$(openssl dgst -sha384 -binary 'static/search_bundle.min.js' | openssl base64) && echo $sha384 && sed -i \"s|sha384='.*'|sha384='$sha384'|\" 'themes/abridge/static/search_facade.js'", - "sha384-demo": "sha384=$(openssl dgst -sha384 -binary 'static/search_bundle.min.js' | openssl base64) && echo $sha384 && sed -i \"s|sha384='.*'|sha384='$sha384'|\" 'static/search_facade.js'", - "sha384-stork": "sha384=$(openssl dgst -sha384 -binary 'static/search_bundle_stork.min.js' | openssl base64) && echo $sha384 && sed -i \"s|sha384='.*'|sha384='$sha384'|\" 'static/search_facade_stork.js'", - "sha384-tinysearch": "sha384=$(openssl dgst -sha384 -binary 'static/search_bundle_tinysearch.min.js' | openssl base64) && echo $sha384 && sed -i \"s|sha384='.*'|sha384='$sha384'|\" 'static/search_facade_tinysearch.js'", - "abridge-bundle-noswitcher": "uglifyjs themes/abridge/static/prestyle.js themes/abridge/static/search_facade.js themes/abridge/static/email.js themes/abridge/static/codecopy.js -c -m -o static/abridge.min.js", - "abridge-bundle": "uglifyjs themes/abridge/static/prestyle.js themes/abridge/static/theme_button.js themes/abridge/static/search_facade.js themes/abridge/static/email.js themes/abridge/static/codecopy.js -c -m -o static/abridge-bundle.min.js", - "abridge-bundle-demo": "uglifyjs static/prestyle.js static/theme_button.js static/search_facade.js static/email.js static/codecopy.js -c -m -o static/abridge-bundle.min.js", - "abridge-bundle-stork": "uglifyjs static/prestyle.js static/theme_button.js static/search_facade_stork.js static/email.js static/codecopy.js -c -m -o static/abridge-bundle-stork.min.js", - "abridge-bundle-tinysearch": "uglifyjs static/prestyle.js static/theme_button.js static/search_facade_tinysearch.js static/email.js static/codecopy.js -c -m -o static/abridge-bundle-tinysearch.min.js", - "abridge": "npm run search-bundle && npm run sha256 && npm run sha384 && npm run abridge-bundle && npm run abridge-bundle-noswitcher", - "abridge-demo": "npm run search-bundle && npm run sha256-demo && npm run sha384-demo && npm run abridge-bundle-demo", - "abridge-stork": "npm run search-bundle-stork && npm run sha256-stork && npm run sha384-stork && npm run abridge-bundle-stork", - "abridge-tinysearch": "npm run search-bundle-tinysearch && npm run sha256-tinysearch && npm run sha384-tinysearch && npm run abridge-bundle-tinysearch", - "all": "npm run searchonly && npm run noswitcher && npm run nofacade && npm run theme && npm run katex-bundle && npm run abridge-demo && npm run abridge-stork && npm run abridge-tinysearch" + "katex-bundle": "uglifyjs static/katex.min.js static/mathtex-script-type.min.js static/katex-auto-render.min.js static/katexoptions.js -c -m -o static/katexbundle.min.js", + "search-elasticlunr": "uglifyjs static/elasticlunr.min.js static/search.js -c -m -o static/search_elasticlunr.min.js", + "search-stork": "uglifyjs static/stork.js static/stork_config.js -c -m -o static/search_stork.min.js", + "search-tinysearch": "uglifyjs static/tinysearch.js -c -m -o static/search_tinysearch.min.js", + "all": "npm run theme && npm run katex-bundle && npm run search-elasticlunr && npm run search-stork && npm run search-tinysearch", + "abridge-bundle-elasticlunr": "npm run all && uglifyjs static/prestyle.js static/theme_button.js static/search_elasticlunr.min.js static/email.js static/codecopy.js -c -m -o static/abridge.min.js", + "abridge-bundle-tinysearch": "npm run all && uglifyjs static/prestyle.js static/theme_button.js static/search_tinysearch.min.js static/email.js static/codecopy.js -c -m -o static/abridge.min.js", + "abridge-bundle-stork": "npm run all && uglifyjs static/prestyle.js static/theme_button.js static/search_stork.min.js static/email.js static/codecopy.js -c -m -o static/abridge.min.js", + "elasticlunr": "npm run abridge-bundle-elasticlunr && sed -i \"s|^search_library.*|search_library = 'elasticlunr'|\" 'config.toml' && sed -i \"s|^draft.*|draft = true|\" 'content/static/tinysearch_json.md' && sed -i \"s|^draft.*|draft = true|\" 'content/static/stork_toml.md' && zola build", + "tinysearch": "npm run abridge-bundle-tinysearch && sed -i \"s|^search_library.*|search_library = 'tinysearch'|\" 'config.toml' && sed -i \"s|^draft.*|draft = false|\" 'content/static/tinysearch_json.md' && sed -i \"s|^draft.*|draft = true|\" 'content/static/stork_toml.md' && zola build && mkdir -p tmp && tinysearch --optimize --path tmp public/data_tinysearch/index.html && rsync -avz tmp/*.wasm static/ && rm -rf tmp", + "stork": "npm run abridge-bundle-stork && sed -i \"s|^search_library.*|search_library = 'stork'|\" 'config.toml' && sed -i \"s|^draft.*|draft = true|\" 'content/static/tinysearch_json.md' && sed -i \"s|^draft.*|draft = false|\" 'content/static/stork_toml.md' && zola build && stork build --input public/data_stork/index.html --output static/stork.st" }, "dependencies": { "uglify-js": "^3.15.4" diff --git a/static/abridge-bundle-nofacade.min.js b/static/abridge-bundle-nofacade.min.js deleted file mode 100644 index 405438b..0000000 --- a/static/abridge-bundle-nofacade.min.js +++ /dev/null @@ -1 +0,0 @@ -const items=document.querySelectorAll(".preStyle");function closeSearchNow(){const e=document.querySelector("main");e.innerHTML=window.main}function goSearchNow(){const e=document.querySelector("main");window.main||(window.main=e.innerHTML);var t=document.getElementById("suggestions"),n=t.cloneNode(!0),o=(n.id="results",document.createElement("div")),i='");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){closeSearchNow()}),!1}items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("light"),localStorage.setItem("theme",document.documentElement.classList.contains("light")?"light":"dark")}),function(){for(var e=document.getElementsByClassName("m-protected"),t=0;t').concat((0,r.highlight)(e.entry.title,e.title_highlight_ranges||[]),"
\n ").concat(t.showScores?"".concat(e.score,""):"","\n \n ...'.concat((0,r.highlight)(e.text,e.highlight_ranges||[]),"...\n
\n ").concat(t.showScores?"".concat(e.score,""):"","\n ').concat((0,r.highlight)(e.entry.title,e.title_highlight_ranges||[]),"
\n ").concat(t.showScores?"".concat(e.score,""):"","\n \n ...'.concat((0,r.highlight)(e.text,e.highlight_ranges||[]),"...\n
\n ").concat(t.showScores?"".concat(e.score,""):"","\n Test
+ + +``` + +### javascript +```javascript +function closeSearch() {//close the search displaying the regular page. + const e = document.querySelector("main"); + e.innerHTML = window.main +} + +function goSearch() {// on enter key or search icon click display results to the page. + const e = document.querySelector("main"); + window.main || (window.main = e.innerHTML); + var t = document.getElementById("suggestions"), + n = ((ResultsClone = t.cloneNode(!0)).id = "results", document.createElement("div")), + o = 'C'EST UN SECRET POUR TOUT LE MONDE.
+Reste un moment et écoute!
+Test
+ + +``` + +## Numéros de ligne, mise en surbrillance + +```html,linenos,hl_lines=5 7-9 + + + + +Test
+ + +``` + +## Bloc de code en ligne + +Si nous voulons, nous pouvons aussi `spécifier le code en ligne` ce qui est utile pour `les petites choses`. + +# Types de liste + +## Liste ordonnée + +1. Premier élément +2. Deuxième élément +3. Troisième élément + +## Liste non ordonnée + +- Élément de liste +- Un autre article +- Et un autre article + +## Liste imbriquée + +- Fruit + - Pomme + - Orange + - Banane +- Laitier + - Lait + - Fromage + +# Autres éléments — abbr, sub, sup, kbd, mark, link + +GIF est un format d'image bitmap. + +H2O + +Xn + Yn = Zn + +Appuyez sur pour terminer la session. CTRL+ALT+Delete + +La plupart salamanders sont nocturnes et chassent les insectes, les vers et autres petites créatures. + +--- + +[^1]: La citation ci-dessus est extraite du [discours](https://www.youtube.com/watch?v=PAAkCSZUG1c) +de Rob Pike lors du Gopherfest, le 18 novembre 2015. + +[^2]: La citation est la première phrase de [la Métaphysique](https://en.wikipedia.org/wiki/Metaphysics_(Aristotle)) d'Aristotle. + +## Navs + +Le menu principal du site est créé en imbriquant la navigation sous une balise d'en-tête. Reportez-vous au haut de ce site pour un exemple. + +Si la balise de navigation se trouve sous la balise principale au lieu de la balise d'en-tête, les liens auront une bordure : + +