This website uses
Algolia Search
to power the search form shown on the homepage and the search modal. The Algolia account used for
this integration is managed through
nuwanjaliyagoda[at]eng.pdn.ac.lk
and the CE GitHub webmaster account.
The browser-side configuration is injected from
_includes/head.html
. It publishes:
window.ALGOLIA_CONFIG = {
appId: "...",
searchApiKey: "..."
};
These values come from environment variables first, and fall back to the values in
_config.yml
.
The search box markup is in
_includes/search_form.html
, and the search results modal is in
_includes/search_modal.html
. The client-side logic lives in
assets/js/search.js
.
When a user submits a query, the script:
staff_profiles
and
student_profiles
.
queries.push({ indexName: "staff_profiles", query: query, params: params });
queries.push({ indexName: "student_profiles", query: query, params: params });
The indexing script is
python_scripts/algolia_index.py
. It reads the site content and converts it into Algolia records.
pages/students/**/*.html
.
pages/staff/academic-staff/**/*.html
.
_data/temporary_academic_staff.json
.
For each record, the script extracts key searchable fields such as name, title, registration number, interests, current affiliation, email addresses, and page content.
Index settings such as searchable attributes, facets, typo rules, and ranking are defined in
python_scripts/util/configs.py
.
The index update job is defined in
.github/workflows/algolia-index.yml
. It can run in two ways:
workflow_dispatch
from GitHub Actions.
The workflow does the following:
requirements.txt
.
python_scripts/algolia_index.py
.
The script uses the Algolia Admin API key for indexing, while the website itself uses only the search API key for read-only client-side queries. All the credentials are stored securely in GitHub Actions secrets and environment variables.
_config.yml
and the GitHub Action variables/secrets.
.github/workflows/algolia-index.yml
completed successfully.
permalink
.
assets/js/search.js
for client-side errors or disabled search state.