From 2d0788c3981328f1fbd9de4274d2925bf9586e03 Mon Sep 17 00:00:00 2001 From: Jieiku Date: Mon, 22 May 2023 22:39:16 -0700 Subject: Add multi-lingual Support --- content/overview-code-blocks.fr.md | 295 +++++++++++++++++++++++++++++++++++++ 1 file changed, 295 insertions(+) create mode 100644 content/overview-code-blocks.fr.md (limited to 'content/overview-code-blocks.fr.md') diff --git a/content/overview-code-blocks.fr.md b/content/overview-code-blocks.fr.md new file mode 100644 index 0000000..e527251 --- /dev/null +++ b/content/overview-code-blocks.fr.md @@ -0,0 +1,295 @@ ++++ +title = "Blocs de code et thèmes" +description = "Exemple d'article présentant la coloration syntaxique et la mise en forme des blocs de code avec un thème personnalisé." +date = 2022-05-16 +draft = false + +[taxonomies] +categories = ["Features"] +tags = ["Markdown"] +[extra] +toc = true +keywords = "Code, Code Blocks, Syntax, Syntax Highlighting, Theme" ++++ + +Cet article présente différents Code Blocks permettant de comparer facilement des thèmes sublimes. + +## Blocs de codes + +Blocs de code.. ❤️ avec coloration syntaxique automatique ✨‍ + +Voir [les docs](https://www.getzola.org/documentation/content/syntax-highlighting/) pour les options. + +### 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`. + +### rust +```rust,linenos,hl_lines=3 +//! jelly-actix-web-starter - Un modèle de démarrage pour les projets actix-web qui ressemble beaucoup à Django. Évitez les trucs ennuyeux et avancez plus vite. + +use jelly::actix_web; +use mainlib; +use std::io; + +#[actix_web::main] +async fn main() -> io::Result<()> { + mainlib::main().await +} + +let context = Context::new(); +``` + +### TOML +```toml,linenos,hl_lines=3 +base_url = "https://abridge.netlify.app/" +title = "Abridge" +description = "Abridge est un thème Zola rapide et léger utilisant le HTML sémantique, le CSS abridge.css class-light et aucun JS obligatoire." +default_language = "en" +#theme = "abridge" + +build_search_index = true +minify_html = false +feed_filename = "atom.xml" +taxonomies = [ + {name = "categories", feed = true}, + {name = "tags", feed = true}, +] +``` + +### html +```html + + + + + Example HTML5 Document + + + +

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 = '

Results For: '.concat(document.getElementById("searchinput").value, "

"); + return n.innerHTML = o, ResultsClone.insertBefore(n, ResultsClone.firstChild), e.innerHTML = ResultsClone.outerHTML, t.innerHTML = "", document.getElementById("searchinput").value = "", !1 +}! function() { + // search function code goes here +} +``` + +### php +```php +getAll(); + +if ($_SERVER['REQUEST_METHOD'] == "POST") { + if (!isset($_SESSION['PFA_token'])) { + die("Invalid token (session timeout; refresh the page and try again?)"); + } + $fUsername = trim(safepost('fUsername')); + if ($lang != check_language(false)) { # only set cookie if language selection was changed + setcookie('lang', $lang, time() + 60*60*24*30); # language cookie, lifetime 30 days + } +} + +$_SESSION['PFA_token'] = md5(uniqid("pfa" . rand(), true)); + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ +``` + + +### json +```json +{ + "name": "Abridge Zola Theme", + "short_name": "Abridge", + "description": "Fast & Lightweight Zola Theme", + "start_url": "/index.html", + "scope": "/", + "background_color": "#111111", + "theme_color": "#222222", + "display": "standalone", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "/android-chrome-192x192m.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + } + ] +} +``` + +### SQL +```sql +-- jelly-actix-web-starter - Creates an accounts table, along with some associated helpers. + +create or replace function update_timestamp() returns trigger as $$ +begin + new.updated = now(); + return new; +end; +$$ language 'plpgsql'; + +create table if not exists accounts ( + id serial primary key, + name text not null, + email text not null unique, + password text not null, + profile jsonb not null default '{}', + plan integer not null default 0, + is_active boolean not null default true, + is_admin boolean not null default false, + has_verified_email boolean not null default false, + last_login timestamp with time zone, + created timestamp with time zone not null default now(), + updated timestamp with time zone not null default now() +); + +create unique index accounts_unique_lower_email_idx on accounts (lower(email)); + +create trigger user_updated before insert or update on accounts +for each row execute procedure update_timestamp(); +``` + +### Lua +```lua +function square(x) + return x * x +end + +print(square(2)) -- prints '4' + +function getPlayerInformation() + playerName = UnitName("player") + playerLevel = UnitLevel("player") + specId, specName = GetSpecializationInfo(GetSpecialization()) + + return "Hey, I'm " .. playerName .. " (Level " .. playerLevel .. "). I'm currently in spec " .. specName .. "." +end + +print(getPlayerInformation()) +``` + +### C +```c +#include +int main() { + int a; + /* actual initialization */ + a = 10; + printf("Hello, World!"); + return 0; +} +``` + +### C++ +```cpp +// Your First C++ Program + +#include + +int main() { + int a; + /* actual initialization */ + a = 10; + std::cout << "Hello World!"; + return 0; +} +``` + +### Go +```go +package main + +import "fmt" + +func main() { + var myvariable1 = 20 + var myvariable2 = "hello world" + fmt.Println("hello world") +} +``` + +### Python +```python +#!/usr/bin/env python3 +import smtplib, socket +from influxdb import InfluxDBClient + +while True: + send = 1 + later = time.time() + 25200 + iso = time.ctime(later) + tempF = round(bme280.temperature * 1.8 + 29, 3) #C to F formula is +32, difference is to correct bme280 temperature offset + humidity = round(bme280.humidity, 3) + pressure = round(bme280.pressure, 3) + # serialize data as JSON + data = [ + { + "measurement": measurement, + "tags": { + "location": location, + }, + "time": iso, + "fields": { + "temperature" : tempF, + "humidity": humidity, + "pressure": pressure + } + } + ] + # Send the JSON data to InfluxDB + try: + client.write_points(data) + except socket.error as e: + print("Could Not Connect to InfluxDB!") + if tempF > 90 and humidity > 55: + emailSubject = "Humidity>55: " + str(int(humidity)) + "%H , Temperature>90: " + str(int(tempF)) + "F" + emailContent = 'Humidity: ' + str(int(humidity)) + '%H , Temperature: ' + str(int(tempF)) + 'F Dashboard' + elif humidity > 55: + emailSubject = "Humidity>55: " + str(int(humidity)) + "%H" + emailContent = 'Humidity: ' + str(int(humidity)) + '%H , Temperature: ' + str(int(tempF)) + 'F Dashboard' + elif tempF > 90: + emailSubject = "Temperature>90: " + str(int(tempF)) + "F" + emailContent = 'Humidity: ' + str(int(humidity)) + '%H , Temperature: ' + str(int(tempF)) + 'F Dashboard' + else: + send = 0 + if send == 1: + try: + if time.time() > lastEmailTime or abs(lastTemp-int(tempF)) > 1: + lastEmailTime = time.time()+emailInterval + lastTemp = int(tempF) + sender.sendmail('jake@example.com', emailSubject, emailContent) + except socket.error as e: + print("Could Not Connect to SMTP server!") + time.sleep(interval) +``` -- cgit v1.3.1 From d9fb3248650404ad6d078eba39b8b91381b1ebed Mon Sep 17 00:00:00 2001 From: Jieiku Date: Mon, 22 May 2023 23:07:56 -0700 Subject: Fixes for uglyurls --- config.toml | 5 ++-- content/overview-code-blocks.fr.md | 51 +++++++++++++++++++++++++++++--------- content/overview-code-blocks.md | 51 +++++++++++++++++++++++++++++--------- sass/_font-extend-COPY-ME.sass | 8 +++--- sass/_font-extend.sass | 16 ++++++------ sass/_imports.scss | 20 +++++++-------- sass/function/_font.sass | 4 +-- sass/include/_embedded.scss | 4 +-- sass/include/_hr.scss | 2 +- sass/include/_icons.scss | 2 +- sass/include/_nav.scss | 2 +- sass/include/_sectioning.scss | 4 +-- sass/include/_typography.scss | 2 +- sass/include/_zola.scss | 4 +-- static/search.js | 8 +++++- templates/base.html | 12 ++++----- templates/categories/list.html | 4 +-- templates/categories/single.html | 2 +- templates/page.html | 4 +-- templates/posts.html | 2 +- templates/tags/list.html | 4 +-- templates/tags/single.html | 2 +- 22 files changed, 136 insertions(+), 77 deletions(-) (limited to 'content/overview-code-blocks.fr.md') diff --git a/config.toml b/config.toml index c2f6e26..8e53830 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,6 @@ -# do NOT include a trailing slash on the base URL for web urls +# do NOT include a trailing slash on the base URL base_url = "https://abridge.netlify.app" -#base_url = "/home/jieiku/.dev/abridge/public/" # Usable site directly from disk, also set in [extra] uglyurls = true +#base_url = "/home/jieiku/.dev/abridge/public" # Usable site directly from disk, also set in [extra] uglyurls = true, and integrity = false default_language = "en" compile_sass = true minify_html = false @@ -79,6 +79,7 @@ uglyurls = false # if set to true then links are generated with the full path. e ### https://tera.netlify.app/docs#date ############################################################################### date_locale = "en_US" +language_code = "en-US" flag.en = "🇬🇧" flag.fr = "🇫🇷" #flag.es = "🇪🇸" diff --git a/content/overview-code-blocks.fr.md b/content/overview-code-blocks.fr.md index e527251..c8fbdf2 100644 --- a/content/overview-code-blocks.fr.md +++ b/content/overview-code-blocks.fr.md @@ -25,19 +25,46 @@ Voir [les docs](https://www.getzola.org/documentation/content/syntax-highlightin Si nous voulons, nous pouvons aussi `spécifier le code en ligne` ce qui est utile pour `les petites choses`. ### rust -```rust,linenos,hl_lines=3 -//! jelly-actix-web-starter - Un modèle de démarrage pour les projets actix-web qui ressemble beaucoup à Django. Évitez les trucs ennuyeux et avancez plus vite. - -use jelly::actix_web; -use mainlib; -use std::io; - -#[actix_web::main] -async fn main() -> io::Result<()> { - mainlib::main().await +```rust +fn main() { + let greetings = ["Hello", "Hola", "Bonjour", + "Ciao", "こんにちは", "안녕하세요", + "Cześć", "Olá", "Здравствуйте", + "Chào bạn", "您好", "Hallo", + "Hej", "Ahoj", "سلام", + "Hej", "Hallo", "Hei", + "Helló", "Hallo", "Buna ziua", + "Merhaba"]; + + for (num, greeting) in greetings.iter().enumerate() { + print!("{} : ", greeting); + match num { + 0 => println!("This code is editable and runnable!"),//en English + 1 => println!("¡Este código es editable y ejecutable!"),//es Spanish + 2 => println!("Ce code est modifiable et exécutable !"),//fr French + 3 => println!("Questo codice è modificabile ed eseguibile!"),//it Italian + 4 => println!("このコードは編集して実行出来ます!"),//jp Japanese + 5 => println!("여기에서 코드를 수정하고 실행할 수 있습니다!"),//ko Korean + 6 => println!("Ten kod można edytować oraz uruchomić!"),//pl Polish + 7 => println!("Este código é editável e executável!"),//pt Portuguese + 8 => println!("Этот код можно отредактировать и запустить!"),//ru Russian + 9 => println!("Bạn có thể edit và run code trực tiếp!"),//vi Vietnamese + 10 => println!("这段代码是可以编辑并且能够运行的!"),//zh Chinese + 11 => println!("Dieser Code kann bearbeitet und ausgeführt werden!"),//de German + 12 => println!("Den här koden kan redigeras och köras!"),//sv Swedish + 13 => println!("Tento kód můžete upravit a spustit"),//cs Czech + 14 => println!("این کد قابلیت ویرایش و اجرا دارد!"),//fa Persian + 15 => println!("Denne kode kan redigeres og køres!"),//da Danish + 16 => println!("Deze code is bewerkbaar en uitvoerbaar!"),//du Dutch + 17 => println!("Tämä koodi on muokattavissa ja ajettavissa!"),//fi Finnish + 18 => println!("Ez a kód szerkeszthető és futtatható!"),//hu Hungarian + 19 => println!("Denne koden er redigerbar og kjørbar!"),//no Norwegian + 20 => println!("Acest cod este editabil și rulabil!"),//ro Romanian + 21 => println!("Bu kod düzenlenebilir ve çalıştırılabilir!"),//tr Turkish + _ => {}, + } + } } - -let context = Context::new(); ``` ### TOML diff --git a/content/overview-code-blocks.md b/content/overview-code-blocks.md index 7c09e5b..d38ac9e 100644 --- a/content/overview-code-blocks.md +++ b/content/overview-code-blocks.md @@ -25,19 +25,46 @@ See [the docs](https://www.getzola.org/documentation/content/syntax-highlighting If we want, we can also `specify inline code` which is useful for `the small stuff`. ### rust -```rust,linenos,hl_lines=3 -//! jelly-actix-web-starter - A starter template for actix-web projects that feels very Django-esque. Avoid the boring stuff and move faster. - -use jelly::actix_web; -use mainlib; -use std::io; - -#[actix_web::main] -async fn main() -> io::Result<()> { - mainlib::main().await +```rust +fn main() { + let greetings = ["Hello", "Hola", "Bonjour", + "Ciao", "こんにちは", "안녕하세요", + "Cześć", "Olá", "Здравствуйте", + "Chào bạn", "您好", "Hallo", + "Hej", "Ahoj", "سلام", + "Hej", "Hallo", "Hei", + "Helló", "Hallo", "Buna ziua", + "Merhaba"]; + + for (num, greeting) in greetings.iter().enumerate() { + print!("{} : ", greeting); + match num { + 0 => println!("This code is editable and runnable!"),//en English + 1 => println!("¡Este código es editable y ejecutable!"),//es Spanish + 2 => println!("Ce code est modifiable et exécutable !"),//fr French + 3 => println!("Questo codice è modificabile ed eseguibile!"),//it Italian + 4 => println!("このコードは編集して実行出来ます!"),//jp Japanese + 5 => println!("여기에서 코드를 수정하고 실행할 수 있습니다!"),//ko Korean + 6 => println!("Ten kod można edytować oraz uruchomić!"),//pl Polish + 7 => println!("Este código é editável e executável!"),//pt Portuguese + 8 => println!("Этот код можно отредактировать и запустить!"),//ru Russian + 9 => println!("Bạn có thể edit và run code trực tiếp!"),//vi Vietnamese + 10 => println!("这段代码是可以编辑并且能够运行的!"),//zh Chinese + 11 => println!("Dieser Code kann bearbeitet und ausgeführt werden!"),//de German + 12 => println!("Den här koden kan redigeras och köras!"),//sv Swedish + 13 => println!("Tento kód můžete upravit a spustit"),//cs Czech + 14 => println!("این کد قابلیت ویرایش و اجرا دارد!"),//fa Persian + 15 => println!("Denne kode kan redigeres og køres!"),//da Danish + 16 => println!("Deze code is bewerkbaar en uitvoerbaar!"),//du Dutch + 17 => println!("Tämä koodi on muokattavissa ja ajettavissa!"),//fi Finnish + 18 => println!("Ez a kód szerkeszthető és futtatható!"),//hu Hungarian + 19 => println!("Denne koden er redigerbar og kjørbar!"),//no Norwegian + 20 => println!("Acest cod este editabil și rulabil!"),//ro Romanian + 21 => println!("Bu kod düzenlenebilir ve çalıştırılabilir!"),//tr Turkish + _ => {}, + } + } } - -let context = Context::new(); ``` ### TOML diff --git a/sass/_font-extend-COPY-ME.sass b/sass/_font-extend-COPY-ME.sass index 658ebbd..148f883 100644 --- a/sass/_font-extend-COPY-ME.sass +++ b/sass/_font-extend-COPY-ME.sass @@ -6,10 +6,10 @@ // or : import it with '@use "_font-extend-COPY-ME"' in whatever existing sass file you already load // delete the following two lines if you want to prepend your fonts... -$findFont-Main : "Segoe UI" // ← append custom MAIN font(s) AFTER this (full list @ '_variables.scss') -$findFont-Code : "Segoe UI Mono" // ← append custom CODE font(s) AFTER this -$fontExt-Main : ("MAIN FONT 1", "MAIN FONT 2") // list of custom MAIN font(s) to append -$fontExt-Code : ("CODE FONT 1", "CODE FONT 2") // list of custom CODE font(s) to append +$findFont-Main : "Segoe UI" // ← append custom MAIN font(s) AFTER this (full list @ '_variables.scss') +$findFont-Code : "Segoe UI Mono" // ← append custom CODE font(s) AFTER this +$fontExt-Main : ("MAIN FONT 1", "MAIN FONT 2") // list of custom MAIN font(s) to append +$fontExt-Code : ("CODE FONT 1", "CODE FONT 2") // list of custom CODE font(s) to append // ...and delete the corresponding variables ↓ @use "../themes/abridge/sass/font-extend" with($findFont-Main:$findFont-Main, $findFont-Code:$findFont-Code,$fontExt-Main:$fontExt-Main,$fontExt-Code:$fontExt-Code) diff --git a/sass/_font-extend.sass b/sass/_font-extend.sass index 35f7a50..9c612c4 100644 --- a/sass/_font-extend.sass +++ b/sass/_font-extend.sass @@ -1,14 +1,14 @@ @use "sass:meta" -@use "variables" as var -@use "function/font" as f +@use "variables" as var +@use "function/font" as f -$findFont-Main : null !default -$findFont-Code : null !default -$fontExt-Main : null !default -$fontExt-Code : null !default +$findFont-Main : null !default +$findFont-Code : null !default +$fontExt-Main : null !default +$fontExt-Code : null !default -$typeMain : meta.type-of($fontExt-Main) -$typeCode : meta.type-of($fontExt-Code) +$typeMain : meta.type-of($fontExt-Main) +$typeCode : meta.type-of($fontExt-Code) @if ($typeMain == 'string') or ($typeMain == 'list') @if ($findFont-Main == null) // prepend diff --git a/sass/_imports.scss b/sass/_imports.scss index b615533..95a58e3 100644 --- a/sass/_imports.scss +++ b/sass/_imports.scss @@ -15,6 +15,16 @@ // Config @forward "variables" as var-*; +@forward "colors/orange" as colors-*; +//@forward "colors/blue" as colors-*; +//@forward "colors/blueshade" as colors-*; + +//@use "fonts/Roboto"; +//@use "fonts/Roboto-Mono"; // Monospaced +//@use "fonts/Arimo"; +//@use "fonts/FiraCode"; // Monospaced +//@use "fonts/Abridge"; // Icon Font (don't recommend, CSS only icons are in my opinion better.) + // Includes - Sorted by importance/category (includes at top are needed most frequently) @use "include/document"; // html @use "include/typography"; // a, headings, p, ul, blockquote, ... @@ -40,13 +50,3 @@ //@use "include/grid"; // section infinite grid -- test/rework this similar to hnav and milligram in that it should collapse to a single column as the page becomes narrow //@use "include/misc"; // template, [hidden], dialog, canvas - -//@use "fonts/Roboto"; -//@use "fonts/Roboto-Mono"; // Monospaced -//@use "fonts/Arimo"; -//@use "fonts/FiraCode"; // Monospaced -//@use "fonts/Abridge"; // Icon Font (don't recommend, CSS only icons are in my opinion better.) - -@forward "colors/orange" as colors-*; -//@forward "colors/blue" as colors-*; -//@forward "colors/blueshade" as colors-*; diff --git a/sass/function/_font.sass b/sass/function/_font.sass index 95704c9..45f8fc3 100644 --- a/sass/function/_font.sass +++ b/sass/function/_font.sass @@ -2,8 +2,8 @@ @use "sass:list" @function font-append($base, $ext, $font-sep) - $base-pre : () - $base-pos : () + $base-pre : () + $base-pos : () $iFontSep : index($base, $font-sep) @if not $iFontSep // didn't find the font separator, return @debug "⚠ Failed to find '#{$font-sep}' in the list of '#{$base}'" diff --git a/sass/include/_embedded.scss b/sass/include/_embedded.scss index cff161e..bd1dbb8 100644 --- a/sass/include/_embedded.scss +++ b/sass/include/_embedded.scss @@ -4,13 +4,13 @@ .yvi {//youtube and vimeo iframe position: absolute; top: 0; - left: 0 + left: 0; } .yv {//youtube and vimeo div position: relative; padding-bottom: 56.25%; height: 0; - overflow: hidden + overflow: hidden; } img, video, diff --git a/sass/include/_hr.scss b/sass/include/_hr.scss index d6215dc..501bdf0 100644 --- a/sass/include/_hr.scss +++ b/sass/include/_hr.scss @@ -10,6 +10,6 @@ hr { height: 0; // 1 overflow: visible; // 2 border: none; - border-top: 1px solid var(--f1) + border-top: 1px solid var(--f1); } header hr, footer hr {border-top: 1px solid var(--c4)} diff --git a/sass/include/_icons.scss b/sass/include/_icons.scss index 511905d..907bcda 100644 --- a/sass/include/_icons.scss +++ b/sass/include/_icons.scss @@ -117,7 +117,7 @@ display: inline-block; //overflow: hidden; text-align: center; - vertical-align: middle + vertical-align: middle; } .svgs { width: var(--fs); diff --git a/sass/include/_nav.scss b/sass/include/_nav.scss index efad0ec..537f23d 100644 --- a/sass/include/_nav.scss +++ b/sass/include/_nav.scss @@ -128,7 +128,7 @@ footer nav { margin: var(--s2) 0 var(--s1); } div { - margin: auto // keeps top menu/search centered in mobile view + margin: auto; // keeps top menu/search centered in mobile view } } } diff --git a/sass/include/_sectioning.scss b/sass/include/_sectioning.scss index 36b0a8e..a84842d 100644 --- a/sass/include/_sectioning.scss +++ b/sass/include/_sectioning.scss @@ -77,12 +77,12 @@ header, main { padding-bottom: 0; margin-bottom: 0; hr { - margin:0.1rem 0 + margin:0.1rem 0; } } footer{ line-height: var(--lhh); hr, p { - margin: 0.1rem 0 .3rem + margin: 0.1rem 0 .3rem; } } diff --git a/sass/include/_typography.scss b/sass/include/_typography.scss index 8eaa7f9..7ed6096 100644 --- a/sass/include/_typography.scss +++ b/sass/include/_typography.scss @@ -46,7 +46,7 @@ a:hover { } h1 a, h2 a, main nav a { color: var(--f2); - text-decoration:none; + text-decoration: none; &:hover { color: var(--a3); text-decoration: none; diff --git a/sass/include/_zola.scss b/sass/include/_zola.scss index 2dd0b70..2b29a58 100644 --- a/sass/include/_zola.scss +++ b/sass/include/_zola.scss @@ -10,9 +10,7 @@ .s70 {font-size: .70em} .hpad {padding: 0 .2rem} .rpad {padding-right: .2rem} -.si { - font-size: 1.5em -} +.si {font-size: 1.5em} pre code[data-lang]::before { color: var(--f1); text-transform: uppercase; diff --git a/static/search.js b/static/search.js index 6aa7019..544ca07 100644 --- a/static/search.js +++ b/static/search.js @@ -166,6 +166,12 @@ Source: */ (function(){ var lang = document.documentElement.getAttribute("lang"); + var langOnly = lang.substring(0, 2); + var baseUrl = document.querySelector("meta[name='base']").getAttribute("content"); + if (baseUrl.slice(-1) == "/") { + baseUrl = baseUrl.slice(0, -1); + } + var index; searchinput.addEventListener('input', show_results, true); suggestions.addEventListener('click', accept_suggestion, true); @@ -173,7 +179,7 @@ Source: async function show_results(){ var initIndex = async function () { if (index === undefined) { - index = fetch("/search_index." + lang + ".json") + index = fetch(baseUrl + '/search_index.' + langOnly + '.json') .then( async function(response) { return await elasticlunr.Index.load(await response.json()); diff --git a/templates/base.html b/templates/base.html index 6a6927a..c29fe6e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,7 +3,7 @@ {%- import "macros/page.html" as page_macros %} {%- import "macros/macros.html" as macros %} - + {{- macros_head::theme(config=config) }} {{- macros_head::stylesheets(config=config) }} @@ -37,16 +37,16 @@