<!-- prettier-ignore -->
{{ $terminalShell := resources.Get "js/terminal.js" }}
{{ $init := resources.Get "js/init.js" }}
{{ $commandFiles := resources.Match "js/commands/*.js" }}
{{ $subfolderFiles := resources.Match "js/*/*.js" }}
{{ $deepSubfolderFiles := resources.Match "js/*/*/*.js" }}
{{ $remaining := resources.Match "js/*.js" }}
{{ $filtered := slice }}
{{ range $remaining }}
  {{ $path := .RelPermalink }}
  {{ if and (not (strings.Contains $path "/terminal.js")) (not (strings.Contains $path "/init.js")) (not (strings.Contains $path "/button-generator.js")) (not (strings.Contains $path "/adoptables/")) (not (strings.Contains $path "/guestbook.js")) }}
    {{ $filtered = $filtered | append . }}
  {{ end }}
{{ end }}
{{ $filteredSubfolders := slice }}
{{ range $subfolderFiles }}
  {{ $path := .RelPermalink }}
  {{ if not (strings.Contains $path "/adoptables/") }}
    {{ $filteredSubfolders = $filteredSubfolders | append . }}
  {{ end }}
{{ end }}
{{ $filteredDeepSubfolders := slice }}
{{ range $deepSubfolderFiles }}
  {{ $path := .RelPermalink }}
  {{ if not (strings.Contains $path "/adoptables/") }}
    {{ $filteredDeepSubfolders = $filteredDeepSubfolders | append . }}
  {{ end }}
{{ end }}
{{ $allFiles := slice $terminalShell | append $filtered | append $init | append $commandFiles | append $filteredSubfolders | append $filteredDeepSubfolders }}
{{ $terminalBundle := $allFiles | resources.Concat "js/terminal-bundle.js" | resources.Minify | resources.Fingerprint }}
<!-- prettier-ignore-end -->
<script
  src="{{ $terminalBundle.RelPermalink }}"
  integrity="{{ $terminalBundle.Data.Integrity }}"
></script>
