rename portfoliolite - gamegrid, add babel JS translate + minify to main codex.js

This commit is contained in:
Wouter Groeneveld 2022-04-10 09:52:54 +02:00
parent 40da5d623a
commit 8fc29dc5b6
13 changed files with 2630 additions and 23 deletions

Binary file not shown.

13
babel.config.js Normal file
View File

@ -0,0 +1,13 @@
module.exports = function (api) {
api.cache(true);
const presets = [
require('@babel/preset-env')
];
const plugins = [ ];
return {
presets,
plugins
};
}

View File

@ -20,6 +20,12 @@ paginate = 20
mastodonlink = "https://chat.brainbaking.com/@wouter"
githublink = "https://github.com/wgroeneveld"
# added since Hugo 0.9x to allow babel to be executed
[security]
enableInlineShortcodes = false
[security.exec]
allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$', 'babel']
[markup]
defaultMarkdownHandler = "goldmark"

View File

@ -21,5 +21,10 @@
"homepage": "https://jefklakscodex.com",
"dependencies": {
"jam-my-stack": "^1.0.21"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.9",
"@babel/preset-env": "^7.16.11"
}
}

View File

@ -7,7 +7,7 @@
<h1>Page not found</h1>
<p>
No Worries! Try to <a href="/tags">dig through the Codex Appendix</a> instead to find something similar to what you were looking for. Good luck!
No Worries! Try to dig through <a href="/games">all games</a> or <a href="/tags">the appendix</a> instead to find something similar to what you were looking for. Good luck!
</p>
</article>
</div>

View File

@ -1,3 +1,3 @@
{{ define "main" }}
{{ partial "portfoliolite.html" . }}
{{ partial "gamegrid.html" . }}
{{ end }}

View File

@ -1,3 +0,0 @@
| Template by <a href="https://bootstrapious.com/free-templates" class="external">Bootstrapious.com</a>
<!-- Not removing this link is part of the licence conditions of the template. Thanks for understanding :) -->
&amp; ported to Hugo by <a href="https://github.com/kishaningithub">Kishan B</a>

View File

@ -11,6 +11,8 @@
<h2>Game Codex &raquo;</h2>
{{ $pages := .RegularPagesRecursive }}
{{ if $pages }}
<div class="gamegridcontrols">
Sort by:
<button class="sortbtn sorted sorted-asc" data-sort="date" data-sorted="asc">Date added</button>&nbsp;&nbsp;
@ -23,12 +25,17 @@
Sorting relies on JavaScript which is currently disabled.
</noscript>
<div class="gamegrid">
{{ range .RegularPagesRecursive }}
{{ if isset .Params "game_name" }}
{{ partial "portfoliolite-block.html" . }}
{{ range $pages }}
{{ if isset .Params "game_name" }}
{{ partial "gamegrid-block.html" . }}
{{ end }}
{{ end }}
{{ end }}
</div>
{{ else }}
<p>
No entries yet. Check back soon!
</p>
{{ end }}
<p>
Browse the Codex: <a href="/games">all games</a> | <a href="/platforms">by platform</a> | <a href="/tags">the appendix</a>.

View File

@ -147,10 +147,6 @@
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="Jefklak's Codex" />
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="Jefklak's Codex" />
{{ end }}
{{- if (ne hugo.Environment "development") }}
<script data-goatcounter="https://stats.jefklakscodex.com/count"
async src="//stats.jefklakscodex.com/count.js"></script>
{{- end }}
<!-- twitter cards -->
<meta name="twitter:card" content="summary_large_image">

View File

@ -1,3 +1,11 @@
<script defer src="{{ "js/scrollingelement.js" | absURL }}"></script>
<script defer src='/js/simple-lightbox.min.js'></script>
<script src="{{ "js/codex.js" | absURL }}"></script>
{{- $mainScriptPath := "js/codex.js" }}
{{- $scripts := resources.Get $mainScriptPath | resources.ExecuteAsTemplate $mainScriptPath . | babel | resources.Minify | resources.Fingerprint "sha512" }}
<script defer src='{{ $scripts.Permalink }}'></script>
{{- if (ne hugo.Environment "development") }}
<script data-goatcounter="https://stats.jefklakscodex.com/count"
async src="//stats.jefklakscodex.com/count.js"></script>
{{- end }}

2593
yarn.lock

File diff suppressed because it is too large Load Diff