-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Assets and use external links class (#79)
* Add External Link Indicator * Adds CSS for ::after psuedo to use an icon to indicate external Link * Adds a controller to automatically process links to add target blank * Update event description to always use external links with target blank WIP: Flash of unstyled SVG on load - how to I fix this? * Update logo, favicon and OG share assets
- Loading branch information
Showing
8 changed files
with
46 additions
and
13 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
static targets = ['container']; | ||
|
||
connect() { | ||
console.log("Links controller connect") | ||
if (this.hasContainerTarget) { | ||
this.containerTarget.querySelectorAll('a').forEach((link) => { | ||
link.setAttribute('target', '_blank'); | ||
link.classList.add('external-link') | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
<header class="flex flex-col content-center justify-center"> | ||
<%= image_tag "logo-transparent.png", class: "mx-auto max-w-[16rem] h-auto" %> | ||
<nav class="text-center grid grid-cols-2 gap-2 text-ruby sm:flex sm:flex-row sm:justify-center sm:gap-5"> | ||
<%= link_to 'Home', root_path %> | ||
<%= link_to 'https://github.com/toronto-ruby/talks', class: 'flex gap-1 justify-center items-center' do %> | ||
Propose a talk<svg class="stroke-ruby w-4 h-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25" /></svg> | ||
<nav | ||
class=" | ||
text-center grid grid-cols-2 gap-2 text-ruby sm:flex sm:flex-row | ||
sm:justify-center sm:gap-5 | ||
" | ||
> | ||
<%= link_to "Home", root_path %> | ||
<%= link_to 'https://github.com/toronto-ruby/talks', class: 'external-link flex gap-1 justify-center items-center' do %> | ||
Propose a talk | ||
<% end %> | ||
<%= link_to 'About', about_path %> | ||
<%= link_to 'Code of Conduct', code_of_conduct_path %> | ||
<%= link_to 'Calendar', calendar_path %> | ||
<%= link_to 'https://www.youtube.com/@TorontoRuby', class: 'flex gap-1 justify-center items-center' do %> | ||
Youtube<svg class="stroke-ruby w-4 h-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25" /></svg> | ||
<%= link_to "About", about_path %> | ||
<%= link_to "Code of Conduct", code_of_conduct_path %> | ||
<%= link_to "Calendar", calendar_path %> | ||
<%= link_to 'https://www.youtube.com/@TorontoRuby', class: 'external-link flex gap-1 justify-center items-center' do %> | ||
Youtube | ||
<% end %> | ||
<%= link_to 'Chat', chat_path %> | ||
<%= link_to 'Past Events', past_events_path %> | ||
<%= link_to "Chat", chat_path %> | ||
<%= link_to "Past Events", past_events_path %> | ||
</nav> | ||
</header> |