Compare commits

..

No commits in common. "master" and "v3.27.0" have entirely different histories.

10 changed files with 10 additions and 67 deletions

View File

@ -8,10 +8,6 @@ class StackColorScheme {
constructor(toggleEl: HTMLElement) {
this.bindMatchMedia();
this.currentScheme = this.getSavedScheme();
if (window.matchMedia('(prefers-color-scheme: dark)').matches === true)
this.systemPreferScheme = 'dark'
else
this.systemPreferScheme = 'light';
this.dispatchEvent(document.documentElement.dataset.scheme as colorScheme);

View File

@ -53,14 +53,7 @@ class Search {
this.resultTitle = resultTitle;
this.resultTitleTemplate = resultTitleTemplate;
/// Check if there's already value in the search input
if (this.input.value.trim() !== '') {
this.doSearch(this.input.value.split(' '));
}
else {
this.handleQueryString();
}
this.handleQueryString();
this.bindQueryStringChange();
this.bindSearchForm();
}

View File

@ -18,23 +18,20 @@ languages:
title: Example Site
weight: 1
params:
sidebar:
subtitle: Example description
description: Example description
zh-cn:
languageName: 中文
title: 演示站点
weight: 2
params:
sidebar:
subtitle: 演示说明
description: 演示说明
ar:
languageName: عربي
languagedirection: rtl
title: موقع تجريبي
weight: 3
params:
sidebar:
subtitle: وصف تجريبي
description: وصف تجريبي
services:
# Change it to your Disqus shortname before using

View File

@ -68,7 +68,7 @@ search:
footer:
builtWith:
other: "مبني باستخدام {{ .Generator }}"
other: "مبني بستخدام {{ .Generator }}"
designedBy:
other: "قالب {{ .Theme }} مصمم من {{ .DesignedBy }}"

View File

@ -50,9 +50,6 @@ widget:
tagCloud:
title:
other: Mots clés
categoriesCloud:
title:
other: Catégories
search:
title:

View File

@ -3,43 +3,5 @@
<h1 class="article-title">{{ T "notFound.title" }}</h1>
<h2 class="article-subtitle">{{ T "notFound.subtitle" }}</h2>
</div>
{{- $query := first 1 (where .Site.Pages "Layout" "==" "search") -}}
{{- $searchPage := index $query 0 -}}
{{- with $searchPage -}}
<form action="{{ $searchPage.RelPermalink }}" class="search-form widget" {{ with .OutputFormats.Get "json" -}}data-json="{{ .Permalink }}" {{- end }}>
<p>
<label>{{ T "search.title" }}</label>
<input id="searchInput" name="keyword" required placeholder="{{ T `search.placeholder` }}" />
<button title="{{ T `search.title` }}">
{{ partial "helper/icon" "search" }}
</button>
</p>
</form>
<div class="search-result">
<h3 class="search-result--title section-title"></h3>
<div class="search-result--list article-list--compact"></div>
</div>
<script>
window.searchResultTitleTemplate = "{{ T `search.resultTitle` }}"
</script>
{{- $opts := dict "minify" hugo.IsProduction "JSXFactory" "createElement" -}}
{{- $searchScript := resources.Get "ts/search.tsx" | js.Build $opts -}}
<script type="text/javascript" src="{{ $searchScript.RelPermalink }}" defer></script>
<script>
const wrongUrl = new URL(window.location.href);
/// Get the search keyword from the wrong URL by removing all slashes and dashes
const searchKeyword = wrongUrl.pathname.split(/[/|-]/).join(' ').trim();
document.getElementById('searchInput').setAttribute('value', searchKeyword);
</script>
{{- end -}}
{{ partialCached "footer/footer" . }}
{{ end }}

View File

@ -1,8 +1,7 @@
{{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}}
<script>
window.addEventListener("DOMContentLoaded", () => {
const mainArticleElement = document.querySelector(".main-article");
renderMathInElement(mainArticleElement, {
renderMathInElement(document.body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },

View File

@ -12,7 +12,6 @@
data-input-position="{{- default `top` .inputPosition -}}"
data-theme="{{- default `light` .lightTheme -}}"
data-lang="{{- default `en` .lang -}}"
data-loading="{{- .loading -}}"
crossorigin="anonymous"
async
></script>

View File

@ -1,12 +1,12 @@
{{- partial "helper/external" (dict "Context" . "Namespace" "Vibrant") -}}
{{- $opts := dict "minify" hugo.IsProduction -}}
{{- $script := resources.Get "ts/main.ts" | js.Build $opts | fingerprint -}}
{{- $script := resources.Get "ts/main.ts" | js.Build $opts -}}
<script type="text/javascript" src="{{ $script.RelPermalink }}" defer></script>
{{- with resources.Get "ts/custom.ts" -}}
{{/* Place your custom script in HUGO_SITE_FOLDER/assets/ts/custom.ts */}}
{{- $customScript := . | js.Build $opts | fingerprint -}}
{{- $customScript := . | js.Build $opts -}}
<script type="text/javascript" src="{{ $customScript.RelPermalink }}" defer></script>
{{- end -}}

View File

@ -1,4 +1,4 @@
{{- $ThemeVersion := "3.30.0" -}}
{{- $ThemeVersion := "3.27.0" -}}
<footer class="site-footer">
<section class="copyright">
&copy;