mirror of
https://github.com/System-End/highway.git
synced 2026-04-19 19:45:10 +00:00
Add project highlighting via config file
This commit is contained in:
parent
986a103e1e
commit
7e257d5db3
3 changed files with 10 additions and 1 deletions
|
|
@ -13,6 +13,14 @@ class Project
|
|||
@content = attributes[:content]
|
||||
end
|
||||
|
||||
def self.highlighted_projects
|
||||
@highlighted_projects ||= YAML.load_file(Rails.root.join("config/highlighted_projects.yml"))
|
||||
end
|
||||
|
||||
def is_highlighted?
|
||||
self.class.highlighted_projects.include?(github_slug)
|
||||
end
|
||||
|
||||
def name
|
||||
title.presence || project_name.titleize
|
||||
end
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
<div class="grid xl:grid-cols-3 gap-4 mt-4 md:grid-cols-2 grid-cols-1">
|
||||
<% @projects.each do |project| %>
|
||||
<div class="bg-[#2E2A54] border-2 border-[#403A88] hover:border-[#544FFF] rounded-lg text-white hover:bg-[#3A3A6D] transition duration-100 transition-transform hover:scale-102 p-8 h-full flex flex-col">
|
||||
<div class="bg-[#2E2A54] border-2 <%= project.is_highlighted? ? "border-yellow-800" : "border-[#403A88]" %> hover:border-[#544FFF] rounded-lg text-white hover:bg-[#3A3A6D] transition duration-100 transition-transform hover:scale-102 p-8 h-full flex flex-col">
|
||||
<% if project.has_journal? %>
|
||||
<%= link_to project_path(user: project.user, project_name: project.project_name), class: "block mb-2" do %>
|
||||
<h1 class="text-2xl font-bold"><%= project.name.truncate(25) %></h1>
|
||||
|
|
|
|||
1
config/highlighted_projects.yml
Normal file
1
config/highlighted_projects.yml
Normal file
|
|
@ -0,0 +1 @@
|
|||
- hackclub/awesome-project
|
||||
Loading…
Add table
Reference in a new issue