file.njk

---
pagination:
  data: flatFiles
  size: 1
  alias: fileInfo
permalink: "repos/{{fileInfo.repoName | slugify}}/branches/{{fileInfo.branchName}}/files/{{fileInfo.file}}.html"
navTab: files
---
<h3>{{fileInfo.file | getFileName}}</h3>
{% if fileInfo.repoName | isDirectory(fileInfo.branchName, fileInfo.file) %}
<ul>
{% set dirs = fileInfo.repoName | getDirectoryContents(fileInfo.branchName, fileInfo.file) %}
{% for dir in dirs %}
  <li><a href="/repos/{{fileInfo.repoName | slugify}}/branches/{{fileInfo.branchName | slugify}}/files/{{dir}}.html">{{fileInfo.file | getRelativePath(dir)}}</a></li>
{% endfor %}
</ul>
{% else %}
<pre><code class="line-numbers language-{{fileInfo.file | languageExtension(fileInfo.repoName)}}">{{ fileInfo.repoName | getFileContents(fileInfo.branchName, fileInfo.file) }}</code></pre>
{% endif %}