<commit_before><?php

namespace Horne;

/* @var $this Application */

$m = $vars['meta'];

$next = null;
$prev = null;

$metas = $this->getMetasByType('article', ['date_created' => 'DESC']);

for ($i = 0; $i < count($metas); $i++) {
    $metaTest = $metas[$i];

    if ($metaTest->getId() === $m['id']) {
        break;
    }
}

if ($i > 0) {
    $prev = $metas[$i - 1];
}

if ($i < count($metas) - 1) {
    $next = $metas[$i + 1];
}

?>

<div class="horne-blog-article">

<h1><?=$this->e($m['title'])?></h1>

<?php if ($this->getSetting('blog.showInfoline')) : ?>
<p class="horne-blog-infoline">
Written

<?php if (
    $this->getSetting('blog.showAuthor')
    && isset($m['author'])
) : ?>
    by <?=$this->e($m['author']);?>
<?php endif; ?>
    on <?=$this->e($this->datef($m['date_created']))?>.

    <?php if (
        $this->getSetting('blog.useTags')
        && isset($m['tags'])
        && count($m['tags']) > 0
    ) : ?>
        Tags:
        <?php $sep = ''; ?>
        <?php foreach ($m['tags'] as $tag) : ?>
            <?=$sep?><a href="<?=$this->e($this->url('horne-blog-tag-' . $tag))?>"><?=$this->e($tag)?></a>
            <?php $sep = ', '; ?>
        <?php endforeach; ?>
    <?php endif; ?>

</p>
<?php endif; ?>



<?=$vars['content']?>

<?php if ($next !== null || $prev !== null) : ?>

<div class="cf">

<?php if ($prev !== null) : ?>
<?php $article = $prev->getMetaPayload(); ?>
<div style="float: left; width: 45%; text-align: left;">
    <a id="horne-system-navigation-previous" accesskey="p" href="<?=$this->url($article['id'])?>">← <?=$this->e($article['title'])?></a>
</div>
<?php endif; ?>

<?php if ($next !== null) : ?>
<?php $article = $next->getMetaPayload(); ?>
<div style="float: right; width: 45%; text-align: right;">
    <a id="horne-system-navigation-next" accesskey="n" href="<?=$this->url($article['id'])?>"><?=$this->e($article['title'])?> →</a><commit_msg>Removes accesskey attributes from article template<commit_after><?php

namespace Horne;

/* @var $this Application */

$m = $vars['meta'];

$next = null;
$prev = null;

$metas = $this->getMetasByType('article', ['date_created' => 'DESC']);

for ($i = 0; $i < count($metas); $i++) {
    $metaTest = $metas[$i];

    if ($metaTest->getId() === $m['id']) {
        break;
    }
}

if ($i > 0) {
    $prev = $metas[$i - 1];
}

if ($i < count($metas) - 1) {
    $next = $metas[$i + 1];
}

?>

<div class="horne-blog-article">

<h1><?=$this->e($m['title'])?></h1>

<?php if ($this->getSetting('blog.showInfoline')) : ?>
<p class="horne-blog-infoline">
Written

<?php if (
    $this->getSetting('blog.showAuthor')
    && isset($m['author'])
) : ?>
    by <?=$this->e($m['author']);?>
<?php endif; ?>
    on <?=$this->e($this->datef($m['date_created']))?>.

    <?php if (
        $this->getSetting('blog.useTags')
        && isset($m['tags'])
        && count($m['tags']) > 0
    ) : ?>
        Tags:
        <?php $sep = ''; ?>
        <?php foreach ($m['tags'] as $tag) : ?>
            <?=$sep?><a href="<?=$this->e($this->url('horne-blog-tag-' . $tag))?>"><?=$this->e($tag)?></a>
            <?php $sep = ', '; ?>
        <?php endforeach; ?>
    <?php endif; ?>

</p>
<?php endif; ?>



<?=$vars['content']?>

<?php if ($next !== null || $prev !== null) : ?>

<div class="cf">

<?php if ($prev !== null) : ?>
<?php $article = $prev->getMetaPayload(); ?>
<div style="float: left; width: 45%; text-align: left;">
    <a id="horne-system-navigation-previous" href="<?=$this->url($article['id'])?>">← <?=$this->e($article['title'])?></a>
</div>
<?php endif; ?>

<?php if ($next !== null) : ?>
<?php $article = $next->getMetaPayload(); ?>
<div style="float: right; width: 45%; text-align: right;">
    <a id="horne-system-navigation-next" href="<?=$this->url($article['id'])?>"><?=$this->e($article['title'])?> →</a>
{'fraction_non_alphanumeric': 0.3003412969283277, 'fraction_numerical': 0.006300866369125755, 'mean_word_length': 3.50354609929078, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 131, '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': '7310124', 'n_tokens_mistral': 1465, 'n_tokens_neox': 1438, 'n_words': 274}