Skip to content

feat: CMD-187 autocreate search page#885

Draft
wesleyboar wants to merge 64 commits intomainfrom
feat/template-and-setting-for-google-search
Draft

feat: CMD-187 autocreate search page#885
wesleyboar wants to merge 64 commits intomainfrom
feat/template-and-setting-for-google-search

Conversation

@wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented Oct 22, 2024

Overview

Support a Google Search page with less effort.

What Effort?

Every Time:

  1. Create search engine.
  2. Configure search engine to match others.
  3. Set owners of search engine.
  4. Copy search codeID.
  5. Set relevant SEARCH settings.

Previously:

  1. Restart the server.
  2. Create /search page.
  3. Create snippet on page.
  4. Paste search code in snippet.
  5. Duplicate-or-Neglect search styles from TACC

Now, Instead:

  1. Restart the server.

Caution

Do not merge.

Warning

Successful run requires two deploys. Help wanted.

Related

Instances:

Changes

  • added search_page app
  • added SEARCH_AUTO_SETUP setting
  • added GOOGLE_SEARCH_ENGINE_ID setting

Testing

  1. Register a Google Programmable Search Engine.
  2. Add real GOOGLE_SEARCH_ENGINE_ID setting e.g.
    GOOGLE_SEARCH_ENGINE_ID = 'b099996c09ebd4ece'
  3. Add SEARCH_AUTO_SETUP = True setting.
  4. Run/Deploy website that has no search page.
  5. Verify "Search (Auto-Generated)" page exists.
  6. Search using search bar.
  7. ✅ Verify search page shows with results.
  8. Remove GOOGLE_SEARCH_ENGINE_ID setting.
  9. Run/Deploy site.
  10. Revisit search page.
  11. ✅ Verify warning appears on page.

UI

with GOOGLE_SEARCH_ENGINE_ID sans GOOGLE_SEARCH_ENGINE_ID
search is set search not set

So that it can be loaded from CDN. Use cases are:
- if search template is broken
- for custom search page
- for non-Core website
Compared to "cms-search", "google-search" is:
- more accurate
- more obvious to those not familiar with Core-CMS
So dev sees 'google-search' from CSS before seeing it in HTML `id` attr.
@wesleyboar wesleyboar marked this pull request as ready for review October 22, 2024 23:37
@wesleyboar wesleyboar changed the title feat: template & setting for Google search feat: search_page app Oct 24, 2024
* fix: inaccurate text picture template name

* fix: show value if old template is in use
* feat: support core-styles u-image-zoom

* feat: support core-styles u-image-zoom via script

* Revert "feat: support core-styles u-image-zoom via script"

This reverts commit 2a15a75.

* feat: support zoom_effect + no_link_to_image

* refactor: only load css once from multiple tries

* refactor: extract link & figure start to templates

* refactor: rebuild zoom templates to strip classes

* feat: template tag `strip_class_attribute`

* fix: strip_class_attribute munges data-class test

* fix: template name/path typo

* fix: all picture template bugs i think

* docs: add help_text to Picture template field

* feat: overwrite bs4 picture plugin validation

* fix: strip_class_attr… regex munges `data-class`

* test: highlight unsupported figure image zoom

* fix: u-image-zoom-- class not added

* fix: sometimes span missing & class in wrong spot

* fix: core-styles zoom bug

* enhance: clearer debuging ui

* refactor: template logic → custom view context

* Revert "refactor: template logic → custom view context"

This reverts commit a123568.
* feat: support core-styles u-image-zoom

* feat: support core-styles u-image-zoom via script

* Revert "feat: support core-styles u-image-zoom via script"

This reverts commit 2a15a75.

* feat: support zoom_effect + no_link_to_image

* refactor: only load css once from multiple tries

* refactor: extract link & figure start to templates

* refactor: rebuild zoom templates to strip classes

* feat: template tag `strip_class_attribute`

* fix: strip_class_attribute munges data-class test

* fix: template name/path typo

* fix: all picture template bugs i think

* docs: add help_text to Picture template field

* feat: overwrite bs4 picture plugin validation

* fix: strip_class_attr… regex munges `data-class`

* test: highlight unsupported figure image zoom

* fix: u-image-zoom-- class not added

* fix: sometimes span missing & class in wrong spot

* fix: core-styles zoom bug

* enhance: clearer debuging ui

* refactor: template logic → custom view context

* Revert "refactor: template logic → custom view context"

This reverts commit a123568.

* refactor: template logic → custom view context

* fix: bad/old path to zoom asset

* refactor: move css snippet to stylehseet

* refactor: rename test stylesheet

* fix: test stylesheet too specific

* fix: a lot, and simplify

* refactor!: revert template names

* fix: final bugs

* chore: remove excess new line

* refactor: simplify templates and update comments
* deps: core-styles v2.46.1

* refactor: u-image-zoom via core-styles
* fix: space under span.u-image-zoom img

* deps: core-styles v2.46.2
* feat: snippet to redirect external article

* fix: load Core-CMS script not tup-ui script
@wesleyboar
Copy link
Member Author

Reviewers removed for now.

wesleyboar added a commit to TACC/CTRN-CMS that referenced this pull request Jan 27, 2026
CTRN had used (unmerged) TACC/Core-CMS#885.

That means it has remnant code of a search_page app.
@wesleyboar wesleyboar changed the base branch from release/v4.36.X to main January 30, 2026 23:53
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

Successfully merging this pull request may close these issues.

1 participant