Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Précalcul des blocs de listes #1248

Merged
merged 7 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,19 @@
<% next unless element.person %>
- slug: "<%= element.person.slug %>"
<%= block_component_static block, :role, template: element, depth: 5 %>
<% end %>
elements:
<% block.template.elements.each do |element| %>
<% next unless element.person %>
- title: >-
<%= prepare_text_for_static element.person.to_s %>
summary: >-
<% if element.role.present? %>
<%= prepare_text_for_static element.role, 6 %>
<% else %>
<%= prepare_text_for_static element.person.summary, 6 %>
<% end %>
kind: "osuny"
slug: "<%= element.person.slug %>"
url: "<%= element.person.current_permalink_in_website(@website)&.path %>"
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@
layout: <%= block.template.layout %>
pages:
<% block.template.selected_pages.each do |element| %>
- page: <%= element.path %>
slug: <%= element.path %>
- page: "<%= element.path %>"
slug: "<%= element.path %>"
<% end %>
elements:
<% block.template.selected_pages.each do |element| %>
- title: >-
<%= prepare_text_for_static element.title %>
summary: >-
<%= prepare_text_for_static element.summary, 6 %>
slug: "<%= element.slug %>"
path: "<%= element.path %>"
url: "<%= element.current_permalink_in_website(@website)&.path %>"
bodyclass: >-
<%= prepare_text_for_static element.bodyclass, 6 %>
<% if element.best_featured_image.attached? %>
image:
id: "<%= element.best_featured_image.id %>"
alt: >-
<%= prepare_text_for_static element.best_featured_image_alt, 7 %>
credit: >-
<%= prepare_html_for_static element.best_featured_image_credit, @website.university %>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,30 @@
<%= block_component_static block, :url, template: element, depth: 5 %>
logo: "<%= element.logo_component.blob&.id %>"
<% end %>
<% end %>
elements:
<% block.template.elements.each do |element| %>
- title: >-
<%= prepare_text_for_static element.name %>
<% if element.organization %>
kind: "osuny"
slug: "<%= element.organization.slug %>"
url: "<%= element.organization.current_permalink_in_website(@website)&.path %>"
logo:
<% if element.organization.logo.attached? %>
light_background:
id: "<%= element.organization.logo.blob.id %>"
<% end %>
<% if element.organization.logo_on_dark_background.attached? %>
dark_background:
id: "<%= element.organization.logo_on_dark_background.blob.id %>"
<% end %>
<% else %>
kind: "external"
url: "<%= element.url %>"
<% if element.logo_component.blob %>
logo:
id: "<%= element.logo_component.blob&.id %>"
<% end %>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,37 @@
posts:
<% block.template.selected_posts.each do |post| %>
- "<%= post.static_path %>"
<% end %>
elements:
<% block.template.selected_posts.each do |element| %>
- title: >-
<%= prepare_text_for_static element.title %>
summary: >-
<%= prepare_text_for_static element.summary, 6 %>
slug: "<%= element.slug %>"
path: "<%= element.path %>"
url: "<%= element.current_permalink_in_website(@website)&.path %>"
<% if element.best_featured_image.attached? %>
image:
id: "<%= element.best_featured_image.id %>"
alt: >-
<%= prepare_text_for_static element.best_featured_image_alt, 7 %>
credit: >-
<%= prepare_html_for_static element.best_featured_image_credit, @website.university %>
<% end %>
categories:
<% element.categories.each do |category| %>
- title: >-
<%= prepare_text_for_static category.name, 8 %>
slug: "<%= category.slug %>"
path: "<%= category.path %>"
url: "<%= category.current_permalink_in_website(@website)&.path %>"
<% end %>
<% if element.author %>
author:
name: >-
<%= prepare_text_for_static element.author.name, 7 %>
slug: "<%= element.author.slug %>"
url: "<%= element.author.current_permalink_in_website(@website)&.path %>"
<% end %>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,31 @@
<% block.template.elements.each do |element| %>
<% next unless element.program %>
- path: "<%= element.program.path %>"
<% end %>
elements:
<% block.template.elements.each do |element| %>
<% program = element.program %>
<% next unless program %>
- title: >-
<%= prepare_text_for_static element.program.name %>
summary: >-
<%= prepare_text_for_static element.program.summary, 6 %>
slug: "<%= program.slug %>"
path: "<%= program.path %>"
url: "<%= program.current_permalink_in_website(@website)&.path %>"
<% if program.best_featured_image.attached? %>
image:
id: "<%= program.best_featured_image.blob.id %>"
alt: >-
<%= prepare_text_for_static program.best_featured_image_alt, 7 %>
credit: >-
<%= prepare_html_for_static program.best_featured_image_credit, @website.university %>
<% end %>
<% diploma = program.diploma %>
<% if diploma.present? %>
diploma:
- title: >-
<%= prepare_text_for_static diploma.name %>
slug: "<%= diploma.slug %>"
url: "<%= diploma.current_permalink_in_website(@website)&.path %>"<% end %>
<% end %>
Loading