From 2d736b8f35170b0a658cac9644d5e3b20c4fe887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=A1=E6=A2=A6=E6=98=9F=E5=B0=98?= Date: Fri, 7 Oct 2022 10:13:10 +0800 Subject: [PATCH] :lipstick: Add Algolia link with source reference content. --- assets/css/_common/components/third-party/search.scss | 6 +++++- data/config.yaml | 4 +++- layouts/partials/_thirdparty/search/algolia.html | 8 +++++++- layouts/partials/header.html | 4 ++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/assets/css/_common/components/third-party/search.scss b/assets/css/_common/components/third-party/search.scss index f73dcbb..a3416f6 100644 --- a/assets/css/_common/components/third-party/search.scss +++ b/assets/css/_common/components/third-party/search.scss @@ -109,7 +109,11 @@ margin: 5px; vertical-align: middle; display: inline; - } + } + + a { + border: none; + } } } diff --git a/data/config.yaml b/data/config.yaml index 3417006..434707a 100644 --- a/data/config.yaml +++ b/data/config.yaml @@ -1,3 +1,5 @@ # Hugo NexT theme's custom config -version: 4.4.0 \ No newline at end of file +version: 4.4.0 + +domain: hugo-next.eu.org \ No newline at end of file diff --git a/layouts/partials/_thirdparty/search/algolia.html b/layouts/partials/_thirdparty/search/algolia.html index 9fe07fa..c527759 100644 --- a/layouts/partials/_thirdparty/search/algolia.html +++ b/layouts/partials/_thirdparty/search/algolia.html @@ -16,7 +16,13 @@
Search By - + {{ $domain := .Site.Data.config.domain }} + {{ if and .Site.BaseURL (ne .Site.BaseURL '/') }} + {{ $domain = .Site.BaseURL }} + {{ end }} + + +
\ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 956a531..ec1a2f3 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,3 +1,3 @@ -{{ partial "header/brand.html" . }} +{{ partialCached "header/brand.html" . }} {{ partial "header/menus.html" . }} -{{ partial "header/search.html" . }} \ No newline at end of file +{{ partialCached "header/search.html" . }} \ No newline at end of file