From c09cbbe1e4765090274bddcaa93fbf9379471018 Mon Sep 17 00:00:00 2001 From: Rise <8315221+AmazingRise@users.noreply.github.com> Date: Tue, 21 Apr 2020 10:22:59 +0800 Subject: Updated Customization (markdown) --- Customization.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Customization.md b/Customization.md index 4ac4686..aaa1ac2 100644 --- a/Customization.md +++ b/Customization.md @@ -15,6 +15,7 @@ Thank you for your support! * [Customize sidebar](https://github.com/AmazingRise/hugo-theme-diary/wiki/Customization#customize-sidebar) * [Add Google Analytics and Site Verification](https://github.com/AmazingRise/hugo-theme-diary/wiki/Customization#add-google-analytics) +* [Add Google Search Box on your site](https://github.com/AmazingRise/hugo-theme-diary/wiki/Customization#add-google-search-box-on-your-site) ## Change color scheme (From *theme*'s root directory) Go to `assets/scss/journal.scss`. @@ -88,4 +89,24 @@ Please add this line to your site's "config.toml": googleSiteVerification = "xxxx-xxxx" ``` -xxxx-xxxx is your Google Site Verification code. Please modify it to your own code. \ No newline at end of file +xxxx-xxxx is your Google Site Verification code. Please modify it to your own code. + +## Add Google Search Box on your site + +Create a new custom search engine on [Google Custom Search Engine](https://cse.google.com/cse/create/new). + +Add your site, e.g. `amazingrise.net/*`, then click `Create`. + +You will see your search ID, as: +`https://cse.google.com/cse.js?cx=**Your Search ID**` +(If not, click modify search engine on the sidebar, then select your website.) + +Finally, add it to your site's `config.toml`: +```toml +[params] +googleSearchCode = "Your Search Code" +``` + +If the setting is correct, you will see a Google Search box on the right side of PC view, as well as in the drawer menu in Mobile view. + +**Notice: This search box only appears in homepage.** \ No newline at end of file -- cgit v1.2.3