Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Search Feature to Fed-Content Site (Future) #86

Open
jashlu opened this issue Dec 19, 2023 · 0 comments
Open

Adding Search Feature to Fed-Content Site (Future) #86

jashlu opened this issue Dec 19, 2023 · 0 comments

Comments

@jashlu
Copy link
Contributor

jashlu commented Dec 19, 2023

Unlike other Project Portal Sites, the Federal Project Portal does not currently feature the Search functionality, as it hasn't been requested by our federal partners.

To add the Search feature/Search page to the federal site, follow these instructions:

  1. Add a new search.json file inside the /content/page/ directory. Here's a sample of what the file should look like:
{
  "templateKey": "SearchPage",
  "title": "Search",
  "image": "about.jpg"

}
  1. Update the navbar configurations in the content/config/layout.json file to include 'Search'. This will make the Search page appear on the navbar and be clickable, directing users to the Search page. Modify the navbar section in layout.json as follows:

The navbar section in layout.json should now look like this

"navbar": {
    "title": "North Carolina Project Portal",
    "pages": [
      {
        "name": "Open opportunities",
        "link": "/",
        "show": true
      },
      {
        "name": "In-progress projects",
        "link": "/ongoing/",
        "show": true
      },
      {
        "name": "Completed projects",
        "link": "/completed/",
        "show": true
      },
      {
        "name": "About",
        "link": "/about/",
        "show": true
      },
      {
        "name": "Contact",
        "link": "/contact/",
        "show": true
      },
      {
        "name": "Search",
        "link": "/search/",
        "show": true
      }
    ]
  },
  1. Finally, update the .gitignore file to include the three files that will be generated as part of creating the static index for the Search functionality:
# ignore files generated for the site search
static/documents.json
static/documents-reduced.json
static/lunr-index.json

You can reference this PR from the nc project portal site where we go through the same steps featured above to add the Search functionality into the site.
https://github.com/thepolicylab-projectportals/nc-content/pull/614/files

@jashlu jashlu changed the title Adding Search Feature to Fed-Content Site Adding Search Feature to Fed-Content Site (Future) Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant