惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
The Last Watchdog
The Last Watchdog
C
Cisco Blogs
L
LINUX DO - 热门话题
T
Tenable Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Cyberwarzone
Cyberwarzone
O
OpenAI News
The Hacker News
The Hacker News
V
Vulnerabilities – Threatpost
A
Arctic Wolf
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
量子位
V2EX - 技术
V2EX - 技术
GbyAI
GbyAI
W
WeLiveSecurity
Recorded Future
Recorded Future
P
Proofpoint News Feed
Project Zero
Project Zero
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
S
Security Affairs
Stack Overflow Blog
Stack Overflow Blog
B
Blog
Y
Y Combinator Blog
月光博客
月光博客
K
Kaspersky official blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Latest news
Latest news
Forbes - Security
Forbes - Security
T
Troy Hunt's Blog
T
The Blog of Author Tim Ferriss
C
Check Point Blog
D
DataBreaches.Net
MyScale Blog
MyScale Blog
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
D
Docker
P
Privacy International News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
Cyber Attacks, Cyber Crime and Cyber Security
S
Securelist
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
雷峰网
雷峰网
SecWiki News
SecWiki News
腾讯CDC
博客园 - Franky

Example blog

Ghost routing explained with routes.yaml examples — routes, collections & taxonomies Ghost redirects explained with practical redirects.yaml examples How to Serve JSON or XML Data in Ghost How to Change Your Default Post Template in Ghost Ghost Custom Theme Settings How to add Google Fonts to Ghost Themes How to Configure Ghost with Mailgun Ghost Theme Structure & Organization How to Make Custom Templates in Ghost Themes How to Install Ghost CMS via Ghost-CLI How to Add Syntax Highlighting to Ghost The best Ghost CMS hosting platforms Ghost 6.0 — Social Web and Native Ghost Analytics Ghost CMS Social web beta, email 2FA and more author social links How to keep custom design settings when updating your Ghost theme How to use the public preview card in Ghost How to add members-specific sections in Ghost How to customize the default content CTA in Ghost How to build a custom homepage in Ghost An overview of Ghost editor cards and and how they work Ghost CMS News: One-time payments & collecting sales tax How to customize the private site access template in Ghost How to add custom fonts in Ghost themes Ghost CMS News: Additional payment methods & internal linking How to use Code Injection in Ghost How to set meta data of your custom routes & collections in Ghost Ghost CMS News: TK reminders, ActivityPub and improvements How to format dates and use the date helper in Ghost Ghost CMS internationalization, custom fonts & spam protection Understanding and optimizing post and page settings in Ghost CMS Trigger the Ghost Portal popup based on page scroll progress How to Deploy Your Ghost Theme with GitHub Actions How to create a custom recommendations page for your Ghost CMS theme Ghost CMS News: New editor, refreshed settings & recommendations Ghost CMS News: Source - the new default theme and native image editing How to Add Different Logos for Dark & Light Themes in Ghost Upgrade to Node v18 for Ghost CMS & common errors Ghost Snippets: Adding Schema markup in Ghost How to add a scroll-based progress bar to your Ghost CMS site How to Create a Custom Navigation Template in Ghost How to Segment Subscribers with Member Labels in Ghost The best way to create a contact page in Ghost How to Use the Ghost Subscription Forms in Your Theme & Posts How to update your Ghost site URL when self-hosting Ghost CMS News: Signup cards and better landing pages How to Add Breadcrumbs to Your Ghost Theme How to integrate the Applause Button into your Ghost theme How to Hide a Post From the Home Page in Ghost CMS Ghost CMS block and contentFor helper overview & tips How to add Image Lightbox to Ghost Themes Ghost CMS News: Signup form embed, new editor and bulk actions. Biron Themes becomes Bright Themes 🎉 How to Audit & Test a Ghost Theme How to Create Related Posts Section in Ghost How to Use Ghost Filter Expressions Ghost CMS newsletter settings and post analytics How to Update Your Ghost Theme When We Release New Versions Ghost CMS News: Automatic list cleaning & email troubleshooting How to Create a Featured Post Slider in Ghost How to Add Reading Time to Ghost Blog Posts How to Create a Post Archive for Your Ghost Theme Ghost CMS Price Helper Overview & Tips Self-Hosted Ghost CMS with DigitalOcean Ghost CMS News: Member Growth Sources & Audience Feedback How to Open External Links in a New Tab in Ghost How to Integrate Google Analytics with Ghost Ghost CMS News: History Log & Newsletter Analytics How to Automatically Add Member Labels From Referral Traffic in Ghost? Ghost CMS News: Free trials & email notifications Ghost CMS Match Helper Usage & Tips Ghost CMS News: Native Comments Ghost CMS News: Ghost Explore & Premium Newsletter Previews Ghost Snippets: Custom Progress Cards & Steps Ghost CMS News: Native Search Ghost Snippets: Custom Stylish Tables How to Add a Scroll Top & Progress Indicator Button in Ghost Ghost Snippets: Accordions How to Add Tag Dropdown to Your Ghost Theme Ghost 5.0 released 🎉 Ghost Snippets: Custom Subscribe Forms Ghost Snippets: Custom Alert Boxes How to Show Post or Newsletter Issue Number in Ghost How to Self-Host Google Fonts in Ghost CMS Ghost CMS News: Membership, Tiers & Activity Feed Custom Pages in Ghost CMS Themes Ghost CMS Search Using Fuse.js Ghost CMS News: Offers and Discounts & New Cards Ghost CMS News: Membership tiers, email CTA & filters Ghost CMS News: Grammarly Support & Feature Image Captions. Ghost CMS News: Improved Member Accounts & Personalized Newsletter. Ghost 4.0 Launched With Native Newsletters & Membership Ghost CMS News: Cancellation Feedback & Newsletter Stats. Ghost CMS News: Improved Member Dashboard & Sidebar Views. Ghost CMS News: Google Pay support, email newsletters & secondary navigation Ghost CMS News: Member Support, Portal & Content Snippets. Ghost CMS News: Referral Programs & Responsive Images. Ghost Themes as Progressive Web Apps Ghost 3.0 is here with brand new features Ghost 2.0 is here with new features How to Add Search to Ghost Using ghostHunter
The Best Ghost CMS Search Plugins & Libraries
Bright Themes · 2022-07-14 · via Example blog

Having search functionality can be a really useful for viewers in order to find content on your site. In this post we are going to explore the currently available options for adding search functionality to your Ghost blog theme.

Starting with Ghost v5.3.0 a native search function was added to Ghost.

This was one of the most requested features and now you can easily add a built-in native search function to any Ghost theme. You can two it in two ways:

  1. Add a navigation link pointing to #/search.
  2. Adding the data-ghost-search attribute to any element in your Ghost theme.

Both options will result in the same thing, when clicking the element it will open the search popup. The advantage of the native search is that it's easy to set up, basically it doesn't require coding knowledge.

Fuse.js

Fuse.js is a powerful, lightweight fuzzy-search library, with zero dependencies.

The advantage of Fuse.js is that you don’t need to set up a dedicated backend just for the search function. Another advantage is its simplicity and performance. This is the library we use in our latest Ghost Themes.

Requirements:

  • Ghost Content API
  • a Custom Integration
  • an input field for the search

Basic options:

  • isCaseSensitive - indicates whether comparisons should be case sensitive.
  • includeScore - whether the score should be included in the result set.
  • includeMatches - whether the matches should be included in the result set
  • minMatchCharLength - only the matches whose length exceeds this value will be returned.
  • shouldSort - whether to sort the result list, by score.
  • findAllMatches - when true, the matching function will continue to the end of a search pattern even if a perfect match has already been located in the string.
  • keys - list of keys that will be searched.s

A simple but powerful search library for Ghost, available on GitHub this package is compatible with Ghost 3.0.

It uses fuzzysort under the hood.

Requirements:

  • Ghost Content API
  • an input field for the search
  • initializing the ghost-search library
  • setup a Custom Integration in Ghost Admin

Options:

  • url - your custom integration(site) url
  • key - your custom integration content api key
  • version - by default v3 for Ghost 3.0
  • input - the id of the input field
  • results - the id of the element where the results should appear
  • button - the id of the element to trigger the search, by default it's empty as the search is performed while you type
  • defaultValue - you can set a default value for the input
  • template - the template used to render the search result
  • trigger - can be focus (load data when the input is in focus) or load (load data on page load)
  • options - other options from the fuzzysort library
  • api - refers to the Ghost Content API
  • on - there are four events available here: beforeDisplay, afterDisplay, beforeFetch and afterFetch.

As you can see, there are quite a lot of options to customize how the search will work. The great thing about this library is that the whole script in minified version is under 12KB.

This is the plugin we use in some our Ghost Themes.

Ghost Finder

This one works somewhat similar to the first library, also available on GitHub.

Requirements:

  • add the script to your theme
  • add the input element for search
  • create an instance of the search
  • setup a Custom Integration in Ghost Admin

Options:

  • input - the search input
  • showResult - the element where the search results will be placed
  • homeUrl - your site url
  • contentApiKey - the content api key from the custom integration
  • resultTemplate - the template for the results
  • singleResultTemplate - the template for a single result
  • excerpt_length - the length of the excerpt (number)
  • time_format - the format string for the date 'MMM Do YYYY'

Available variables to use within the result template:

  • ##title - Post title
  • ##url - Post url
  • ##primary_tag_name - Name of primary tag
  • ##primary_tag_url - Url of primary tag
  • ##primary_author_name - Name of primary author
  • ##primary_author_url - Profile url of primary author
  • ##primary_author_avatar - Profile photo of primary author
  • ##excerpt - show some words of the post content. Default words count is 15
  • ##published_at - Post publication date. Format can be change by time_format option
  • ##feature_image - Post featured image url
  • ##resultCount - Matched result count

Compared to Ghost Search we have somewhat less options.

Ghost Hunter

GhostHunter was the first search plugin created for Ghost. The major drawback is that it uses jQuery which would bloat the script size you would add to your site, thus affecting the performance.

Requirements:

  • add the script to your theme
  • setup a Custom Integration in Ghost Admin

Options:

  • results - the JQuery ID of the element into which search results should be inserted
  • onKeyUp - for instant search-as-you-type set the value true
  • result_template - the handlebars template used to render the results
  • info_template - to display the number of search items found
  • displaySearchInfo - to display the info_template
  • subpath - to set the site to a sub folder like "/blog"
  • onPageLoad - should the indexing happen on page load
  • before - event before the result list is shown
  • onComplete - event after the results are displayed

GhostHunter was developed before Ghost 1.0 and many things have changed within Ghost since then, the other plugins seem to be a better option right now.

Site Search 360

Site Search 360 is an another way to add search to your Ghost site.

Requirements:

  • add the search code to the theme
  • create a search page and style it

There is a tutorial by the Ghost Team how you can integrate it into your Ghost Theme.

The main advantage of using a tool like Site Search 360 is that you’ll be able to monitor usage. You can see how often people are using the search and what they are searching for so you can improve the navigation experience.

Let us know if you found another option to add search to your Ghost theme.