Skip to content
Snippets Groups Projects
Unverified Commit cf5d7a09 authored by Pierre-André Boissinot's avatar Pierre-André Boissinot Committed by GitHub
Browse files

Merge pull request #622 from noesya/evolution_of_categories_pattern

La structure de catégories est maintenant flatten artificiellement sur Git
parents dea825cf 958dbc67
No related merge requests found
......@@ -81,7 +81,7 @@ class Communication::Website::Category < ApplicationRecord
end
def git_path(website)
"content/categories/#{path}/_index.html"
"content/categories/#{slug_with_ancestors_slugs}/_index.html"
end
def template_static
......@@ -108,7 +108,7 @@ class Communication::Website::Category < ApplicationRecord
end
def slug_with_ancestors_slugs
(ancestors.map(&:slug) << slug).join('/')
(ancestors.map(&:slug) << slug).join('-')
end
protected
......
url: "<%= @about.current_permalink_in_website(@website)&.path %>"
<% if @about.respond_to?(:slug) && @about.slug.present? %>
slug: "<%= @about.slug %>"
slug: "<%= forced_slug || @about.slug %>"
<% end %>
<%
previous_permalinks = @about.previous_permalinks_in_website(@website).where.not(path: "/")
......
---
title: "<%= @about.name %>"
<%= render 'admin/application/static/permalink' %>
<%= render 'admin/application/static/permalink', forced_slug: @about.slug_with_ancestors_slugs %>
<% if @about.parent %>
parent: "<%= @about.parent.path %>"
<% end %>
<% if @about.children.any? %>
children:
<% @about.children.ordered.each do |child| %>
- <%= child.path %>
<% end %>
<% end %>
position: <%= @about.position %>
<%= render 'admin/communication/unsplash/static' %>
description: >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment