Advertisement
Guest User

Untitled

a guest
Aug 15th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.34 KB | None | 0 0
  1. # Section template
  2. tpl = File.read 'section-tpl.txt'
  3.  
  4. ['list', 'of', 'section', 'names'].each do |name|
  5.     # Replaces [name] with the section name, you can expand on this...
  6.     liquid = tpl.gsub '[name]', name
  7.  
  8.     # Create sections/(name).liquid
  9.     File.open "sections/#{name}.liquid", 'w' do |f|
  10.              f.write liquid
  11.         end
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement