Routes

Perron uses standard Rails routing, allowing the use of familiar route helpers.

The config/routes.rb could look like this:

Rails.application.routes.draw do
  resources :posts, module: :content, only: %w[index show]
  resources :pages, module: :content, only: %w[show]

  root to: "content/pages#root"
end

Route configuraton

Change the site's route configuration in config/initializers/perron.rb:

Perron.configure do |config|
  #  config.default_url_options = {host: "perron.railsdesigner.com", protocol: "https", trailing_slash: true}
  #end

For a typical “clean slug”, the filename without extension serves as the id parameter.

<%# For app/content/posts/announcement.md %>
<%= link_to "Announcement", post_path("announcement") %>

This would render <a href="/posts/announcement/">Announcement</a>.