<commit_before>---
layout: false
---

:ruby
  export = ""
  content = ""

  results = req.env['rack.request.form_hash']

  if results
    slug = results['title'].to_s.gsub(/'/,'').parameterize
    timestamp = Time.now
    filename = "#{root}/#{source}#{blog.options.prefix}#{timestamp.to_date}-#{slug}.md"

    meta = {
      'title' => results['title'],
      'author' => results['author'],
      'date' => timestamp.strftime('%F %T %Z'),
      'published' => false
    }

    yamlized = meta.to_yaml.gsub(/^----$/, '---').gsub(/^date: '(.*)'$/, 'date: \1')

    export = "#{yamlized}---\n\n#{content}"

    File.write filename, export
  end

!!!
%html
  %head
    - if export
      %meta{"http-equiv" => "refresh", content: "1;url=/admin/edit?date=#{timestamp.to_date}&slug=#{slug}"}
    - else
      %meta{"http-equiv" => "refresh", content: "1;url=/admin/"}
    %title Creating post...

    :sass<commit_msg>increased delay time to prevent a post issue<commit_after>---
layout: false
---

:ruby
  export = ""
  content = ""

  results = req.env['rack.request.form_hash']

  if results
    slug = results['title'].to_s.gsub(/'/,'').parameterize
    timestamp = Time.now
    filename = "#{root}/#{source}#{blog.options.prefix}#{timestamp.to_date}-#{slug}.md"

    meta = {
      'title' => results['title'],
      'author' => results['author'],
      'date' => timestamp.strftime('%F %T %Z'),
      'published' => false
    }

    yamlized = meta.to_yaml.gsub(/^----$/, '---').gsub(/^date: '(.*)'$/, 'date: \1')

    export = "#{yamlized}---\n\n#{content}"

    File.write filename, export
  end

!!!
%html
  %head
    - if export
      %meta{"http-equiv" => "refresh", content: "2; url=/admin/edit?date=#{timestamp.to_date}&slug=#{slug}"}
    - else
      %meta{"http-equiv" => "refresh", content: "2; url=/admin/"}
    %title Creating post...

    :sass
{'fraction_non_alphanumeric': 0.23478729133010232, 'fraction_numerical': 0.0032310177705977385, 'mean_word_length': 2.807377049180328, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5807001', 'n_tokens_mistral': 680, 'n_tokens_neox': 662, 'n_words': 118}