Skip to content

Conversation

matt-bernhardt
Copy link
Member

@matt-bernhardt matt-bernhardt commented Mar 31, 2023

This improves how the News theme handles sidebars, and makes this a viable feature once the content is imported.

https://mitlibraries.atlassian.net/browse/LM-296

Developer

Secrets

  • No secrets are affected

Documentation

  • No documentation changes are needed

Accessibility

  • ANDI or Wave has been run in accordance to
    our guide and
    all issues introduced by these changes have been resolved or opened as new
    issues (link to those issues in the Pull Request details above)

Stakeholder approval

  • Stakeholder approval has been confirmed

Dependencies

NO dependencies are updated

Code Reviewer

  • The commit message is clear and follows our guidelines
    (not just this pull request message)
  • The changes have been verified
  • The documentation has been updated or is unnecessary
  • New dependencies are appropriate or there were no changes

** Why are these changes being introduced:

* The News theme templates refer to a "subscribe" sidebar, rather than
  properly receiving sidebars defined in the Parent theme.
* Additionally, some sidebars from the Parent theme are not relevant for
  this theme, and should be removed to prevent accidental use.

** Relevant ticket(s):

* https://mitlibraries.atlassian.net/browse/lm-296

** How does this address that need:

* This takes the approach of unregistering sidebars, which we already
  use in the Child theme, and implements it (via functions.php) for the
  News theme. We unregister inherited sidebars that are not needed,
  leaving only "sidebar-1" and "sidebar-404" (the migrated content area)
* The sidebar.php partial, which references the "subscribe" sidebar, is
  updated to refer instead to "sidebar-1"

** Document any side effects to this change:

* The indenting on the sidebar partial is also reduced, and some extra
  whitespace removed.
Copy link
Member

@JPrevost JPrevost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The urge to rename all the things like sidebar-1 is high... but not for today.

@matt-bernhardt matt-bernhardt merged commit 582783e into master Mar 31, 2023
@matt-bernhardt matt-bernhardt deleted the lm296 branch March 31, 2023 20:09
matt-bernhardt pushed a commit that referenced this pull request May 10, 2023
* 72:Sage theme script adjustment for invalid theme names.

* 72 tweak: More cross-language space checking.

* Simplify the tr and add underscore handling and additional error checking

This adds the tr command that converts characters to lowercase and the underscore handling and adds some additional optimizations and error handling.

* checks for double-dashes -- this happens if you pass a string with both a space and an underscore (e.g. `this string is _really_ broken`)
* checks for and strips a trailing dash -- not entirely sure where this was coming from, but when I passed strings in, they always ended with a trailing `-`. This strips that out if it exists.

This was the result of passing the original code and the suggested code (for underscores and caps) through ChatGPT and asking it to optimize it for me.

---------

Co-authored-by: Chris Reynolds <chris.reynolds@pantheon.io>
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.

2 participants