Remove image loading, some other stuff
This commit is contained in:
parent
e675b0d722
commit
c2d3c99022
3
.editorconfig
Normal file
3
.editorconfig
Normal file
|
@ -0,0 +1,3 @@
|
|||
[*.erb]
|
||||
indent_style = space
|
||||
indent_size = 2
|
7
Rules
7
Rules
|
@ -7,7 +7,8 @@ preprocess do
|
|||
content = ''
|
||||
attributes = {
|
||||
naam: thema,
|
||||
verenigingen: @items.filter{|i| i[:themas] and i[:themas].include?(thema)}.flatten.uniq.compact
|
||||
verenigingen: @items.filter { |i| i[:themas] and i[:themas].include?(thema) }.flatten.uniq.compact,
|
||||
image: '/assets/placeholder.png'
|
||||
}
|
||||
identifier = "/themas/#{thema}"
|
||||
|
||||
|
@ -15,6 +16,9 @@ preprocess do
|
|||
end
|
||||
end
|
||||
|
||||
# Don't just render items from external sources
|
||||
ignore '/external/**/*'
|
||||
|
||||
compile '/{verenigingen,projecten}/*.md' do
|
||||
filter :kramdown
|
||||
layout '/vereniging.*'
|
||||
|
@ -42,6 +46,7 @@ end
|
|||
compile '/themas/*' do
|
||||
layout '/thema.*'
|
||||
layout '/default.*'
|
||||
layout '/base.*'
|
||||
write ext: 'html'
|
||||
end
|
||||
|
||||
|
|
BIN
content/assets/placeholder.png
Normal file
BIN
content/assets/placeholder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.5 KiB |
|
@ -1,54 +1,58 @@
|
|||
<div class="details-container details-logo">
|
||||
<img src="https://dsa.ugent.be/api/verenigingen/<%= abbreviation(item) %>/logo?size=huge" alt="<%= item[:naam] %>">
|
||||
<%= image_tag item %>
|
||||
</div>
|
||||
<div class="details-container details-contact">
|
||||
<% if item[:deelname_link] %>
|
||||
<a href="<%= item[:deelname_link] %>"><%= item[:deelname_link] %></a>
|
||||
<% end %>
|
||||
<div class="contact-container">
|
||||
<p><a href="<%= item[:contact] %>"><%= item[:contact] %></a></p>
|
||||
<p><a href="<%= item[:website] %>"><%= item[:website] %></a></p>
|
||||
</div>
|
||||
<div class="social-container">
|
||||
<ul>
|
||||
<% if item[:social] %>
|
||||
<% for social in item[:social] %>
|
||||
<li class="social-<%= social[:platform] %>">
|
||||
<a href="<%= social[:link] %>"><%= social[:link] %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% if item[:deelname_link] %>
|
||||
<a href="<%= item[:deelname_link] %>"><%= item[:deelname_link] %></a>
|
||||
<% end %>
|
||||
<div class="contact-container">
|
||||
<p><a href="<%= item[:contact] %>"><%= item[:contact] %></a></p>
|
||||
<p><a href="<%= item[:website] %>"><%= item[:website] %></a></p>
|
||||
</div>
|
||||
<div class="social-container">
|
||||
<ul>
|
||||
<% if item[:social] %>
|
||||
<% for social in item[:social] %>
|
||||
<li class="social-<%= social[:platform] %>">
|
||||
<a href="<%= social[:link] %>"><%= social[:link] %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="details-container details-photo">
|
||||
<div class="showcase-container">
|
||||
<div class="showcase-container">
|
||||
<% if item[:showcase] %>
|
||||
<% for showcase_img in item[:showcase] %>
|
||||
<div class="showcase-image">
|
||||
<img src="<%= showcase_img[:photo]%>" alt="showcase img"></img>
|
||||
</div>
|
||||
<% end %>
|
||||
<% for showcase_img in item[:showcase] %>
|
||||
<div class="showcase-image">
|
||||
<img src="<%= showcase_img[:photo] %>" alt="showcase img"></img>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="thema-container">
|
||||
<% if item[:themas] %>
|
||||
<p><span class="thema-title">Thema's:</span>
|
||||
<ul>
|
||||
<% for thema in item[:themas] %>
|
||||
<li><%= thema %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</p>
|
||||
<% end %>
|
||||
<% if item[:themas] %>
|
||||
<p><span class="thema-title">Thema's:</span></p>
|
||||
<ul>
|
||||
<% for thema in item[:themas] %>
|
||||
<li>
|
||||
<%= thema %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% if item[:verenigingen] %>
|
||||
</div>
|
||||
<% if item[:verenigingen] %>
|
||||
<div class="details-container details-verenigingen">
|
||||
<% for vereniging in item[:verenigingen] %>
|
||||
<ul>
|
||||
<% item[:verenigingen].each do |vereniging| %>
|
||||
<li>
|
||||
<div class="vereninging-container">
|
||||
<p><%= vereniging[:naam] %></p>
|
||||
<img src="<%= vereniging[:photo] %>" alt="vereniging logo"></img>
|
||||
<p><%= vereniging[:naam] %></p>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<h1> <%= item[:naam] %> </h1>
|
||||
<h1> Thema: <%= item[:naam] %> </h1>
|
||||
<div class="details-wrapper">
|
||||
<div class="details-container details-text">
|
||||
<%= yield %>
|
||||
|
|
|
@ -1,13 +1,4 @@
|
|||
<div class="flex-horz">
|
||||
<div class="horz-child">
|
||||
<h1> Verenigingen </h1>
|
||||
<ul>
|
||||
<% for v in sorted_dsa_verenigingen %>
|
||||
<!-- <img src="<%#= image_url(thema) %>" alt="<%#= thema[:naam] %>">-->
|
||||
<li> <%= link_to("test", v) %> </li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="horz-child">
|
||||
<h1> Thema's </h1>
|
||||
<ul>
|
||||
|
|
|
@ -16,20 +16,20 @@ class DSADataSource < ::Nanoc::DataSource
|
|||
vereniging,
|
||||
"/verenigingen/#{vereniging["abbreviation"]}"
|
||||
)
|
||||
new_item(
|
||||
Faraday.get(vereniging["logo"]).body,
|
||||
vereniging,
|
||||
"/images/#{vereniging["abbreviation"]}"
|
||||
)
|
||||
end
|
||||
verenigingen["associations"].map do |vereniging|
|
||||
# byebug
|
||||
puts "Loading #{vereniging["abbreviation"]} from dsa api"
|
||||
new_item(
|
||||
Faraday.get(vereniging["logo"]).body,
|
||||
vereniging,
|
||||
"/images/#{vereniging["abbreviation"]}.jpg"
|
||||
)
|
||||
# new_item(
|
||||
# Faraday.get(vereniging["logo"]).body,
|
||||
# vereniging,
|
||||
# "/images/#{vereniging["abbreviation"]}"
|
||||
# )
|
||||
end
|
||||
# verenigingen["associations"].map do |vereniging|
|
||||
# # byebug
|
||||
# puts "Loading #{vereniging["abbreviation"]} from dsa api"
|
||||
# new_item(
|
||||
# Faraday.get(vereniging["logo"]).body,
|
||||
# vereniging,
|
||||
# "/images/#{vereniging["abbreviation"]}.jpg"
|
||||
# )
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -46,14 +46,6 @@ module VerenigingenHelper
|
|||
item.identifier.without_ext.split('/').last
|
||||
end
|
||||
|
||||
def image_url(item)
|
||||
if item[:image].nil?
|
||||
"https://dsa.ugent.be/api/verenigingen/#{ abbreviation item }/logo?size=medium"
|
||||
else
|
||||
item[:image]
|
||||
end
|
||||
end
|
||||
|
||||
def verenigingen_random(amount)
|
||||
@items.find_all("**/verenigingen/*").map { |x| {
|
||||
"titel" => x[:titel],
|
||||
|
@ -63,8 +55,16 @@ module VerenigingenHelper
|
|||
} }.to_a.shuffle[0..amount]
|
||||
end
|
||||
|
||||
def image_url(item)
|
||||
if item[:image].nil?
|
||||
"https://dsa.ugent.be/api/verenigingen/#{ abbreviation item }/logo?size=medium"
|
||||
else
|
||||
item[:image]
|
||||
end
|
||||
end
|
||||
|
||||
def image_tag(item)
|
||||
"<img src='#{ image_url item }' alt='#{ item[:naam] } logo' />"
|
||||
"<img src='#{ image_url item }' alt='#{ item[:naam] } logo' style='width:15vw;' />"
|
||||
end
|
||||
|
||||
def sorted_dsa_verenigingen
|
||||
|
|
Loading…
Reference in a new issue