diff --git a/app/models/project.rb b/app/models/project.rb index ae7c273..bdf9f9b 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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 diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index 591a818..a6db00f 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -17,7 +17,7 @@
<% @projects.each do |project| %> -
+
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 %>

<%= project.name.truncate(25) %>

diff --git a/config/highlighted_projects.yml b/config/highlighted_projects.yml new file mode 100644 index 0000000..3ce0e45 --- /dev/null +++ b/config/highlighted_projects.yml @@ -0,0 +1 @@ +- hackclub/awesome-project \ No newline at end of file