pretty run

This commit is contained in:
Nuno Coração
2025-06-17 23:17:26 +01:00
parent 560e927b87
commit f2e224a042
137 changed files with 5771 additions and 5017 deletions

View File

@@ -1,20 +1,13 @@
var layouts = [
"background",
"hero",
"profile",
"page",
"card"
]
var layouts = ["background", "hero", "profile", "page", "card"];
var currentLayout = 0
var currentLayout = 0;
function switchHomeLayout() {
var old = currentLayout;
currentLayout = currentLayout == layouts.length - 1 ? 0 : currentLayout + 1;
var old = currentLayout
currentLayout = currentLayout == layouts.length - 1 ? 0 : currentLayout + 1
var oldDiv = document.getElementById(layouts[old])
var currentDiv = document.getElementById(layouts[currentLayout])
var oldDiv = document.getElementById(layouts[old]);
var currentDiv = document.getElementById(layouts[currentLayout]);
const layoutCode = document.querySelectorAll("code[id=layout]");
currentDiv.style.display = "block";
@@ -22,7 +15,6 @@ function switchHomeLayout() {
layoutCode.forEach(function (el) {
el.innerText = layouts[currentLayout];
});
}
window.addEventListener("DOMContentLoaded", (event) => {
@@ -30,31 +22,26 @@ window.addEventListener("DOMContentLoaded", (event) => {
button.addEventListener("click", function (e) {
e.preventDefault();
switchHomeLayout();
})
}),
);
});
var list_config = [
"CardViewProse",
"CardViewScreenWidth",
"NormalView"
]
var list_config = ["CardViewProse", "CardViewScreenWidth", "NormalView"];
var titles = {
"CardViewProse" : "card view with constrained width",
"CardViewScreenWidth" : "card view with full width",
"NormalView" : "standard list view"
}
CardViewProse: "card view with constrained width",
CardViewScreenWidth: "card view with full width",
NormalView: "standard list view",
};
var currentConfig = 0
var currentConfig = 0;
function switchList() {
var old = currentConfig;
currentConfig = currentConfig == list_config.length - 1 ? 0 : currentConfig + 1;
var old = currentConfig
currentConfig = currentConfig == list_config.length - 1 ? 0 : currentConfig + 1
var oldDiv = document.getElementById(list_config[old])
var currentDiv = document.getElementById(list_config[currentConfig])
var oldDiv = document.getElementById(list_config[old]);
var currentDiv = document.getElementById(list_config[currentConfig]);
const configCode = document.querySelectorAll("code[id=config]");
currentDiv.style.display = "block";
@@ -63,7 +50,6 @@ function switchList() {
configCode.forEach(function (el) {
el.innerText = titles[list_config[currentConfig]];
});
}
window.addEventListener("DOMContentLoaded", (event) => {
@@ -71,6 +57,6 @@ window.addEventListener("DOMContentLoaded", (event) => {
button.addEventListener("click", function (e) {
e.preventDefault();
switchList();
})
}),
);
});

View File

@@ -1,15 +1,15 @@
{
"name": "Nuno Coração",
"image" : "img/nuno_avatar.jpg",
"bio": "Theme Creator",
"social": [
{ "linkedin": "https://linkedin.com/in/nunocoracao" },
{ "twitter": "https://twitter.com/nunocoracao" },
{ "instagram": "https://instagram.com/nunocoracao" },
{ "medium": "https://medium.com/@nunocoracao" },
{ "github": "https://github.com/nunocoracao" },
{ "goodreads": "http://goodreads.com/nunocoracao" },
{ "keybase": "https://keybase.io/nunocoracao" },
{ "reddit": "https://reddit.com/user/nunoheart" }
]
}
"name": "Nuno Coração",
"image": "img/nuno_avatar.jpg",
"bio": "Theme Creator",
"social": [
{ "linkedin": "https://linkedin.com/in/nunocoracao" },
{ "twitter": "https://twitter.com/nunocoracao" },
{ "instagram": "https://instagram.com/nunocoracao" },
{ "medium": "https://medium.com/@nunocoracao" },
{ "github": "https://github.com/nunocoracao" },
{ "goodreads": "http://goodreads.com/nunocoracao" },
{ "keybase": "https://keybase.io/nunocoracao" },
{ "reddit": "https://reddit.com/user/nunoheart" }
]
}

View File

@@ -1,15 +1,15 @@
{
"name": "Dummy Second Author",
"image" : "img/author2.png",
"bio": "Dummy",
"social": [
{ "linkedin": "https://linkedin.com/in/nunocoracao" },
{ "twitter": "https://twitter.com/nunocoracao" },
{ "instagram": "https://instagram.com/nunocoracao" },
{ "medium": "https://medium.com/@nunocoracao" },
{ "github": "https://github.com/nunocoracao" },
{ "goodreads": "http://goodreads.com/nunocoracao" },
{ "keybase": "https://keybase.io/nunocoracao" },
{ "reddit": "https://reddit.com/user/nunoheart" }
]
}
"name": "Dummy Second Author",
"image": "img/author2.png",
"bio": "Dummy",
"social": [
{ "linkedin": "https://linkedin.com/in/nunocoracao" },
{ "twitter": "https://twitter.com/nunocoracao" },
{ "instagram": "https://instagram.com/nunocoracao" },
{ "medium": "https://medium.com/@nunocoracao" },
{ "github": "https://github.com/nunocoracao" },
{ "goodreads": "http://goodreads.com/nunocoracao" },
{ "keybase": "https://keybase.io/nunocoracao" },
{ "reddit": "https://reddit.com/user/nunoheart" }
]
}

View File

@@ -1 +1 @@
<a rel="me" href="https://masto.ai/@blowfish"></a>
<a rel="me" href="https://masto.ai/@blowfish"></a>

View File

@@ -17,4 +17,8 @@
<section>
{{ partial "recent-articles-demo.html" . }}
</section>
<script defer type="text/javascript" src="{{ $jsHome.RelPermalink }}" integrity="{{ $jsHome.Data.Integrity }}"></script>
<script
defer
type="text/javascript"
src="{{ $jsHome.RelPermalink }}"
integrity="{{ $jsHome.Data.Integrity }}"></script>

View File

@@ -1,44 +1,47 @@
{{ $recentArticles := 5 }}
{{ $showMoreLinkDest := "/posts/" }}
{{ if index .Site.Params.homepage "showRecentItems" }}
{{ $recentArticles = .Site.Params.homepage.showRecentItems }}
{{ $recentArticles = .Site.Params.homepage.showRecentItems }}
{{ end }}
<h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "shortcode.recent_articles" | emojify }}</h2>
<div class="flex mb-6 px-4 py-2 mb-8 text-base rounded-md bg-primary-100 dark:bg-primary-900">
<span class="flex items-center justify-between grow dark:text-neutral-300">
<span class="prose dark:prose-invert">This is a demo of theme's list configurations: <code
id="config">card view</code></span>
<button id="switch-config-button"
class="px-4 !text-neutral !no-underline rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700">
Switch config &orarr;
</button>
</span>
<span class="flex items-center justify-between grow dark:text-neutral-300">
<span class="prose dark:prose-invert"
>This is a demo of theme's list configurations: <code id="config">card view</code></span
>
<button
id="switch-config-button"
class="px-4 !text-neutral !no-underline rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700">
Switch config &orarr;
</button>
</span>
</div>
<div id="CardViewProse" class="h-full">
{{ partial "recent-articles/cardview.html" . }}
{{ partial "recent-articles/cardview.html" . }}
</div>
<div id="CardViewScreenWidth" class="hidden h-full">
{{ partial "recent-articles/cardview-fullwidth.html" . }}
{{ partial "recent-articles/cardview-fullwidth.html" . }}
</div>
<div id="NormalView" class="hidden h-full">
{{ partial "recent-articles/list.html" . }}
{{ partial "recent-articles/list.html" . }}
</div>
{{ if .Site.Params.homepage.showMoreLink | default false }}
{{ if index .Site.Params.homepage "showRecentItems" }}
{{ $showMoreLinkDest = .Site.Params.homepage.showMoreLinkDest }}
{{ end }}
<div class="mt-10 flex justify-center">
{{ if index .Site.Params.homepage "showRecentItems" }}
{{ $showMoreLinkDest = .Site.Params.homepage.showMoreLinkDest }}
{{ end }}
<div class="mt-10 flex justify-center">
<a href="{{ $showMoreLinkDest }}">
<button
class="bg-transparent hover:text-primary-500 prose dark:prose-invert font-semibold hover:text-white py-2 px-4 border border-primary-500 hover:border-transparent rounded">
{{ i18n "recent.show_more" | markdownify }}
</button>
<button
class="bg-transparent hover:text-primary-500 prose dark:prose-invert font-semibold hover:text-white py-2 px-4 border border-primary-500 hover:border-transparent rounded">
{{ i18n "recent.show_more" | markdownify }}
</button>
</a>
</div>
</div>
{{ end }}