Skip to content

Commit 0640c7c

Browse files
committed
Add active link helper and styles and bump gems
1 parent ebefd59 commit 0640c7c

5 files changed

Lines changed: 29 additions & 17 deletions

File tree

Gemfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ GIT
99
GEM
1010
remote: https://rubygems.org/
1111
specs:
12-
activesupport (8.0.3)
12+
activesupport (8.1.1)
1313
base64
14-
benchmark (>= 0.3)
1514
bigdecimal
1615
concurrent-ruby (~> 1.0, >= 1.3.1)
1716
connection_pool (>= 2.2.5)
1817
drb
1918
i18n (>= 1.6, < 2)
19+
json
2020
logger (>= 1.4.2)
2121
minitest (>= 5.1)
2222
securerandom (>= 0.3)
@@ -25,7 +25,6 @@ GEM
2525
addressable (2.8.7)
2626
public_suffix (>= 2.0.2, < 7.0)
2727
base64 (0.3.0)
28-
benchmark (0.4.1)
2928
bigdecimal (3.3.1)
3029
coffee-script (2.4.1)
3130
coffee-script-source
@@ -48,7 +47,7 @@ GEM
4847
favicon_maker (1.3.1)
4948
docile (~> 1.1)
5049
ffi (1.17.2)
51-
haml (6.3.0)
50+
haml (7.0.1)
5251
temple (>= 0.8.2)
5352
thor
5453
tilt
@@ -59,6 +58,7 @@ GEM
5958
http_parser.rb (0.8.0)
6059
i18n (1.14.7)
6160
concurrent-ruby (~> 1.0)
61+
json (2.15.2)
6262
kramdown (2.5.1)
6363
rexml (>= 3.3.9)
6464
listen (3.9.0)
@@ -136,7 +136,7 @@ GEM
136136
rack
137137
rackup (2.2.1)
138138
rack (>= 3)
139-
rake (13.3.0)
139+
rake (13.3.1)
140140
rb-fsevent (0.11.2)
141141
rb-inotify (0.11.1)
142142
ffi (~> 1.0)
@@ -154,7 +154,7 @@ GEM
154154
concurrent-ruby (~> 1.0)
155155
uglifier (4.2.1)
156156
execjs (>= 0.3.0, < 3)
157-
uri (1.0.4)
157+
uri (1.1.0)
158158
webrick (1.9.1)
159159

160160
PLATFORMS

config.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
end
1313
activate :livereload
1414
activate :i18n,
15-
mount_at_root: :en,
16-
lang_map: { fr: :acp, de: :solawi }
15+
mount_at_root: :en,
16+
lang_map: { fr: :acp, de: :solawi }
1717

1818
configure :development do
1919
set :debug_assets, true
@@ -29,8 +29,8 @@
2929
activate :minify_html
3030
activate :relative_assets
3131
activate :robots,
32-
rules: [{ user_agent: '*', allow: %w[/] }],
33-
sitemap: File.join(@app.data.site.host, 'sitemap.xml')
32+
rules: [{ user_agent: '*', allow: %w[/] }],
33+
sitemap: File.join(@app.data.site.host, 'sitemap.xml')
3434
end
3535
activate :inline_svg
3636

@@ -58,3 +58,9 @@
5858
icon: 'favicon.ico'
5959
}
6060
]
61+
62+
helpers do
63+
def current_page?(path)
64+
current_page.url.chomp('/') == path.chomp('/')
65+
end
66+
end

source/_footer.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<footer class="w-full pt-32 pb-4">
22
<ul class="flex justify-center items-center tracking-tight gap-2 text-lg">
33
<li>
4-
<%= link_to 'EN', '/', class: 'font-semibold p-1' %>
4+
<%= link_to "EN", "/", class: "font-semibold p-1 #{"active" unless current_page?("/") }" %>
55
</li>
66
<li class="text-gray-500 font-extralight text-xs">
77
/
88
</li>
99
<li>
10-
<%= link_to 'FR', '/acp', class: 'font-semibold p-1' %>
10+
<%= link_to "FR", '/acp', class: "font-semibold p-1 #{"active" unless current_page?('/acp') }" %>
1111
</li>
1212
<li class="text-gray-500 font-extralight text-xs">
1313
/
1414
</li>
1515
<li>
16-
<%= link_to 'DE', '/solawi', class: 'font-semibold p-1' %>
16+
<%= link_to 'DE', '/solawi', class: "font-semibold p-1 #{"active" unless current_page?('/solawi') }" %>
1717
</li>
1818
</ul>
1919

source/stylesheets/site.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,12 @@ a:hover {
456456
color: rgb(21 137 35 / var(--tw-text-opacity));
457457
}
458458

459+
a {
460+
&.active {
461+
text-decoration-line: none;
462+
}
463+
}
464+
459465
p {
460466
margin-top: 1.25rem;
461467
line-height: 1.375;

source/stylesheets/tailwind.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
@layer base {
66
a {
7-
@apply underline underline-offset-4 font-semibold decoration-1;
8-
}
7+
@apply underline underline-offset-4 font-semibold decoration-1 hover:text-logo-green;
98

10-
a:hover {
11-
@apply text-logo-green;
9+
&.active {
10+
@apply no-underline;
11+
}
1212
}
1313

1414
p {

0 commit comments

Comments
 (0)