From daa56df04bc0b9e9d00575ec34ac34f8caa0863b Mon Sep 17 00:00:00 2001 From: jazairi <16103405+jazairi@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:51:05 -0400 Subject: [PATCH] Allow custom skip link(s) Why these changes are being introduced: TIMDEX UI requires multiple skip links, and other applications may benefit from being able to change the href or text of the skip link. Relevant ticket(s): * [GDT-161](https://mitlibraries.atlassian.net/browse/GDT-161) How this addresses that need: This moves the skip link to a partial, `layouts/_skip_links.html.erb`, so applications using this gem can customize it if needed. Side effects of this change: Any CSS changes (e.g., if we need to add a class selector for multiple skip links). --- README.md | 3 +++ app/views/layouts/_skip_links.html.erb | 1 + app/views/layouts/application.html.erb | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 app/views/layouts/_skip_links.html.erb diff --git a/README.md b/README.md index 27f26e5..e56ca2c 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,9 @@ repo and make appropriate changes. `app/views/layouts/_site_footer.html.erb` is also available if you really need a third footer above the other two (I'm looking at you bento!). +`app/views/layouts/_skip_links.html.erb` provides the option to change the href or text for the skip link, or include +multiple skip links if needed. + If you need to make changes to other templates, you can also copy those to your local repo but you should check with others as the main header / footer / etc are probably best left as they are in this gem. ## Adding Additional JavaScript to HTML Head diff --git a/app/views/layouts/_skip_links.html.erb b/app/views/layouts/_skip_links.html.erb new file mode 100644 index 0000000..6f39ac1 --- /dev/null +++ b/app/views/layouts/_skip_links.html.erb @@ -0,0 +1 @@ + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6fe2528..567a2c0 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -4,7 +4,7 @@ <%= render partial: "layouts/head" %> - + <%= render partial: "layouts/skip_links" %>