Class: Trifle::Docs::PageController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Trifle::Docs::PageController
- Includes:
- PageControllerHelpers
- Defined in:
- lib/trifle/docs/engine.rb
Instance Method Summary collapse
- #configuration ⇒ Object
- #docs_layout ⇒ Object
- #llms ⇒ Object
- #llms_full ⇒ Object
- #search ⇒ Object
- #show ⇒ Object
- #sitemap ⇒ Object
Instance Method Details
#configuration ⇒ Object
145 146 147 |
# File 'lib/trifle/docs/engine.rb', line 145 def configuration params[:configuration] || Trifle::Docs.default end |
#docs_layout ⇒ Object
149 150 151 |
# File 'lib/trifle/docs/engine.rb', line 149 def docs_layout "layouts/trifle/docs/#{configuration.layout}" end |
#llms ⇒ Object
173 174 175 176 177 178 179 180 181 182 |
# File 'lib/trifle/docs/engine.rb', line 173 def llms base_url = llms_scope llms_url = [base_url, 'llms.txt'].reject(&:empty?).join('/') render_llms(llms_url, allow_empty: true) do Trifle::Docs::Helper::Llms.homepage_markdown( config: configuration, base_url: base_url ) end end |
#llms_full ⇒ Object
184 185 186 187 188 189 190 191 192 193 |
# File 'lib/trifle/docs/engine.rb', line 184 def llms_full base_url = llms_scope llms_url = [base_url, 'llms-full.txt'].reject(&:empty?).join('/') render_llms(llms_url) do Trifle::Docs::Helper::Llms.full_markdown( config: configuration, base_url: base_url ) end end |
#search ⇒ Object
161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/trifle/docs/engine.rb', line 161 def search results = Trifle::Docs.search(query: params[:query], scope: params[:scope]) render 'search', locals: { results: results, query: params[:query], scope: params[:scope], sitemap: Trifle::Docs.sitemap, meta: { description: 'Search' } } end |
#show ⇒ Object
153 154 155 156 157 158 159 |
# File 'lib/trifle/docs/engine.rb', line 153 def show url, wants_md = resolve_url(params) = (url) return render_not_found if .nil? (, url, wants_md, request) end |