From 5ce4194199d8bbb3ab25c27470745b0b91dddcba Mon Sep 17 00:00:00 2001 From: Lorin Werthen Date: Fri, 26 Feb 2021 12:22:29 +0100 Subject: [PATCH] fix spacing issue and add a bit more flair --- .../assets/stylesheets/includes/blogpost.scss | 7 +- .../assets/stylesheets/includes/general.scss | 8 +++ content/index.erb | 70 +++++++++++-------- layouts/partials/_blog_preview.erb | 8 +-- layouts/partials/_events_tile.erb | 4 +- lib/helpers/events.rb | 4 +- 6 files changed, 59 insertions(+), 42 deletions(-) diff --git a/content/assets/stylesheets/includes/blogpost.scss b/content/assets/stylesheets/includes/blogpost.scss index 86ce67c..b361171 100644 --- a/content/assets/stylesheets/includes/blogpost.scss +++ b/content/assets/stylesheets/includes/blogpost.scss @@ -70,11 +70,8 @@ display: flex; > a { flex-grow: 1; - - > h3 { - margin-bottom: 0; - display: inline-block; - } + margin-bottom: 0; + display: inline-block; } } > .blogpreview-extra { diff --git a/content/assets/stylesheets/includes/general.scss b/content/assets/stylesheets/includes/general.scss index e75af98..436488b 100644 --- a/content/assets/stylesheets/includes/general.scss +++ b/content/assets/stylesheets/includes/general.scss @@ -223,3 +223,11 @@ footer.footer { .has-small-caps { font-variant: small-caps; } + +.underline--magical { + background-image: -webkit-linear-gradient(to right, #F09819, #FF512F); /* Chrome 10-25, Safari 5.1-6 */ + background-image: linear-gradient(to right, #F09819, #FF512F); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */ + background-repeat: no-repeat; + background-size: 100% 0.2em; + background-position: 0 88%; +} diff --git a/content/index.erb b/content/index.erb index 9fa0212..3c38585 100644 --- a/content/index.erb +++ b/content/index.erb @@ -14,15 +14,48 @@
- <%= if studytime? then render '/tiles/blokmap.*'end %> - + <% if studytime? %> + <%= render '/tiles/blokmap.*' %> + <% end %> + + <% unless upcoming_events.empty? %>
- <%= render '/partials/_events_tile.*', event: front_page_events.first %> +
+ Upcoming Events + <% upcoming_events.each do |event| %> +
+ <%= render '/partials/_events_tile.*', event: event %> +
+ <% end %> +
-
- -
-
+ <% end %> +
+
+
+ Previous Events + <% previous_events[0..2].each do |event| %> +
+ <%= render '/partials/_events_tile.*', event: event %> +
+ <%end%> +
+
+
+
+ Blogposts + <% sorted_articles[0..3].each do |post| %> + <%= render '/partials/_blog_preview.*', post: post %> + <%end%> +
+
+
+
+ +
+
+ Top Coders +

@@ -38,27 +71,6 @@

-
-
-
-

Events

-
- <% front_page_events[1..3].each do |event| %> -
- <%= render '/partials/_events_tile.*', event: event %> -
- <%end%> -
-
-
-

Blogposts

-
- <% sorted_articles[0..3].each do |post| %> -
- <%= render '/partials/_blog_preview.*', post: post %> -
- <%end%> -
-
+
diff --git a/layouts/partials/_blog_preview.erb b/layouts/partials/_blog_preview.erb index da8f314..031dcc6 100644 --- a/layouts/partials/_blog_preview.erb +++ b/layouts/partials/_blog_preview.erb @@ -1,13 +1,13 @@
- -

<%= post[:title] %>

+
+ <%= post[:title] %>
<% post[:tags]&.each do |tag| %> - > - <%= tag %> + > + <%= tag %> <% end %>
diff --git a/layouts/partials/_events_tile.erb b/layouts/partials/_events_tile.erb index c1ca994..f527644 100644 --- a/layouts/partials/_events_tile.erb +++ b/layouts/partials/_events_tile.erb @@ -12,9 +12,9 @@ <% end %>
-

+

<%= @event[:title] %> -

+
<%= @event[:description] %> diff --git a/lib/helpers/events.rb b/lib/helpers/events.rb index 198d1b7..14aadf4 100644 --- a/lib/helpers/events.rb +++ b/lib/helpers/events.rb @@ -65,8 +65,8 @@ module EventsHelper @items.find_all('/events/*/*/main.md') end - def front_page_events - upcoming_events + all_events.reverse[(upcoming_events.length)..] + def previous_events + all_events.reverse[(upcoming_events.length)..] end def sub_events(grouped_event)