<commit_before>#!/usr/bin/env perl

use strict;
use warnings;
use v5.14;
use Git::Hooks;
use File::Slurp qw(read_file write_file);

my $layout_preffix=<<EOT;
---
layout: index

EOT

POST_COMMIT {
  my ($git) = @_;
  my $branch =  $git->command(qw/rev-parse --abbrev-ref HEAD/);
  if ( $branch =~ /master/ ) {
    my $changed = $git->command(qw/show --name-status/);
    my @changed_files = ($changed =~ /\s\w\s+(\S+)/g);
    my @mds = grep ( /\.md/, @changed_files );
    #Now change branch and process
    #Inspired by http://stackoverflow.com/questions/15214762/how-can-i-sync-documentation-with-github-pages
    $git->command(qw/checkout gh-pages/);
    for my $f ( @mds ) {
      $git->command( 'checkout', 'master', '--', $f );
      my $file_content = read_file( $f );
      $file_content =~ s/\.md\)/\)/g; # Change links

      if ( $f =~ /temas/ ) {
	  my ($breadcrumb) = ($file_content =~ /<!--@(.+)-->/gs);
	  $file_content = $layout_preffix."$breadcrumb---\n\n".$file_content;
	  write_file($f, $file_content);
	  $git->command('add', $f );
      } else {
	  if ( $f eq 'README.md' ) {
	      $f = index.md;
	  }
	  $file_content = $layout_preffix."\n---\n".$file_content;
	  write_file($f, $file_content );
	  $git->command('add', 'index.md' );<commit_msg>Corrige error<commit_after>#!/usr/bin/env perl

use strict;
use warnings;
use v5.14;
use Git::Hooks;
use File::Slurp qw(read_file write_file);

my $layout_preffix=<<EOT;
---
layout: index

EOT

POST_COMMIT {
  my ($git) = @_;
  my $branch =  $git->command(qw/rev-parse --abbrev-ref HEAD/);
  if ( $branch =~ /master/ ) {
    my $changed = $git->command(qw/show --name-status/);
    my @changed_files = ($changed =~ /\s\w\s+(\S+)/g);
    my @mds = grep ( /\.md/, @changed_files );
    #Now change branch and process
    #Inspired by http://stackoverflow.com/questions/15214762/how-can-i-sync-documentation-with-github-pages
    $git->command(qw/checkout gh-pages/);
    for my $f ( @mds ) {
      $git->command( 'checkout', 'master', '--', $f );
      my $file_content = read_file( $f );
      $file_content =~ s/\.md\)/\)/g; # Change links

      if ( $f =~ /temas/ ) {
	  my ($breadcrumb) = ($file_content =~ /<!--@(.+)-->/gs);
	  $file_content = $layout_preffix."$breadcrumb---\n\n".$file_content;
	  write_file($f, $file_content);
	  $git->command('add', $f );
      } else {
	  if ( $f eq 'README.md' ) {
	      $f = 'index.md';
	  }
	  $file_content = $layout_preffix."\n---\n".$file_content;
	  write_file($f, $file_content );
	  $git->command('add', 'index.md' );
{'fraction_non_alphanumeric': 0.219070133963751, 'fraction_numerical': 0.008668242710795903, 'mean_word_length': 2.870426829268293, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, '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': '5168640', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1012, 'n_words': 191}