Skip to content
Snippets Groups Projects
Commit 958dbc67 authored by pabois's avatar pabois
Browse files

La structure de catégories est maintenant flatten artificiellement sur github

parent dea825cf
No related branches found
No related tags found
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