slack5-1770541397/docs/config.rb
jordan b0357fa33a
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/manual/woodpecker Pipeline was successful
Initialize project from skeleton template
2026-02-08 09:03:18 +00:00

57 lines
1.1 KiB
Ruby

# Slate/Middleman configuration
# Based on slatedocs/slate with customizations for monorepo API docs
# Markdown rendering
set :markdown_engine, :redcarpet
set :markdown,
fenced_code_blocks: true,
smartypants: true,
disable_indented_code_blocks: true,
prettify: true,
strikethrough: true,
tables: true,
with_toc_data: true,
no_intra_emphasis: true
# Syntax highlighting
activate :syntax
set :haml, { ugly: true }
# Assets
set :css_dir, 'stylesheets'
set :js_dir, 'javascripts'
set :images_dir, 'images'
set :fonts_dir, 'fonts'
# Build directory
set :build_dir, 'build'
# Relative assets for static hosting
activate :relative_assets
set :relative_links, true
# Build-specific configuration
configure :build do
activate :minify_css
activate :minify_javascript, ignore: [/all_.*\.js/]
activate :asset_hash
end
# Development helpers
helpers do
def toc_data(page_content)
content = page_content.dup
toc = []
content.scan(/<h([12]).*?id="([^"]+)".*?>(.+?)<\/h\1>/m) do |level, id, text|
toc << {
level: level.to_i,
id: id,
text: text.gsub(/<[^>]+>/, '')
}
end
toc
end
end