Fix: login/signup forms. Update: code formating

This commit is contained in:
hyzen
2026-06-04 23:38:05 +05:30
parent cb0d929f7a
commit 16255bb690
63 changed files with 1544 additions and 1146 deletions

View File

@@ -13,43 +13,116 @@
<img src="/logo.png" alt="Freedoms4 logo" />
<h1>Freedoms4</h1>
<div class="brand__actions">
<button class="theme-toggle" id="theme-toggle" aria-label="Toggle theme" title="Toggle dark/light mode">
<svg class="theme-toggle__sun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"/></svg>
<svg class="theme-toggle__moon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"/></svg>
<button
class="theme-toggle"
id="theme-toggle"
aria-label="Toggle theme"
title="Toggle dark/light mode"
>
<svg
class="theme-toggle__sun"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path
d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"
/>
</svg>
<svg
class="theme-toggle__moon"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z" />
</svg>
</button>
<!-- Desktop: account + subscribe -->
<div class="brand__auth brand__auth--desktop">
<input type="checkbox" id="auth-dropdown" class="brand__auth-check" />
<label class="brand__auth-toggle" for="auth-dropdown" tabindex="0" aria-label="Account options">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>
<label
class="brand__auth-toggle"
for="auth-dropdown"
tabindex="0"
aria-label="Account options"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
>
<path
d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"
/>
</svg>
</label>
<div class="brand__auth-links">
<a href="/login/" class="auth-link auth-link--login">Login</a>
<a href="/signup/" class="auth-link auth-link--signup">Sign Up</a>
</div>
</div>
{{- $rssURL := "/index.xml" -}}
{{- with .OutputFormats.Get "rss" -}}
{{- $rssURL = .RelPermalink -}}
{{- end -}}
<a href="{{ $rssURL }}" class="rss-subscribe__link rss-subscribe__link--desktop" title="Subscribe via RSS">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="10" height="10" fill="currentColor" aria-hidden="true">
<path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/>
{{- $rssURL := "/index.xml" -}} {{- with .OutputFormats.Get "rss" -}} {{-
$rssURL = .RelPermalink -}} {{- end -}}
<a
href="{{ $rssURL }}"
class="rss-subscribe__link rss-subscribe__link--desktop"
title="Subscribe via RSS"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="10"
height="10"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
<span>Subscribe</span>
</a>
<!-- Mobile: combined dropdown -->
<div class="brand__mobile-menu">
<input type="checkbox" id="mobile-menu-check" class="brand__mobile-check" />
<label class="brand__mobile-toggle" for="mobile-menu-check" aria-label="Menu">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>
<label
class="brand__mobile-toggle"
for="mobile-menu-check"
aria-label="Menu"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="18"
height="18"
fill="currentColor"
>
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
</svg>
</label>
<div class="brand__mobile-links">
<a href="/login/" class="mobile-link">Login</a>
<a href="/signup/" class="mobile-link">Sign Up</a>
<a href="{{ $rssURL }}" class="mobile-link mobile-link--subscribe">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor" aria-hidden="true"><path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/></svg>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
Subscribe
</a>
</div>

View File

@@ -1,18 +1,13 @@
{{ define "main" }}
<nav class="uninotes-breadcrumbs breadcrumbs">
<a href="/blog/">Blog</a>
<span>{{ .Title }}</span>
<a href="/blog/">Blog</a>
<span>{{ .Title }}</span>
</nav>
<h1>{{ .Title }}</h1>
{{ partial "page/author.html" . }}
{{ partial "main/dates.html" . }}
{{ partial "page/translation_list.html" . }}
{{ partial "page/toc.html" . }}
{{ .Content }}
{{ partial "page/terms.html" (dict "taxonomy" "tags" "page" .) }}
{{ partial "page/terms.html" (dict "taxonomy" "categories" "page" .) }}
{{ partial "page/page_nav.html" . }}
{{ partial "page/page-end.html" . }}
{{ partial "page/author.html" . }} {{ partial "main/dates.html" . }} {{ partial
"page/translation_list.html" . }} {{ partial "page/toc.html" . }} {{ .Content }} {{ partial
"page/terms.html" (dict "taxonomy" "tags" "page" .) }} {{ partial "page/terms.html" (dict "taxonomy"
"categories" "page" .) }} {{ partial "page/page_nav.html" . }} {{ partial "page/page-end.html" . }}
{{ end }}

View File

@@ -1,39 +1,33 @@
{{ define "main" }}
{{ $sectionPagerSize := or site.Params.sectionPagerSize 10 }}
{{ $paginator := .Paginate .Pages.ByDate.Reverse $sectionPagerSize }}
{{ define "main" }} {{ $sectionPagerSize := or site.Params.sectionPagerSize 10 }} {{ $paginator :=
.Paginate .Pages.ByDate.Reverse $sectionPagerSize }}
<nav class="uninotes-breadcrumbs breadcrumbs">
<a href="/blog/">Blog</a>
<a href="/categories/">Categories</a>
<span>{{ .Title }}</span>
{{ if gt $paginator.TotalPages 1 }}
<span>Page {{ $paginator.PageNumber }} of {{ $paginator.TotalPages }}</span>
{{ end }}
<a href="/blog/">Blog</a>
<a href="/categories/">Categories</a> <span>{{ .Title }}</span> {{ if gt
$paginator.TotalPages 1 }}
<span>Page {{ $paginator.PageNumber }} of {{ $paginator.TotalPages }}</span>
{{ end }}
</nav>
{{ .Content }}
<h1>
<a href="/blog/" style="text-decoration: none; color: var(--accent-color);">All Posts</a> |
<a href="/categories/" style="text-decoration: none; color: var(--accent-color);">Categories</a>
<a href="/blog/" style="text-decoration: none; color: var(--accent-color)">All Posts</a> |
<a href="/categories/" style="text-decoration: none; color: var(--accent-color)">Categories</a>
</h1>
<h2>{{ .Title }}</h2>
<div style="margin-bottom: 2rem;"></div>
<div style="margin-bottom: 2rem"></div>
<section class="posts-list">
{{ range $paginator.Pages }}
{{ partial "main/dates.html" . }}
<h2 class="term-post-title">
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
</h2>
{{ end }}
{{ range $paginator.Pages }} {{ partial "main/dates.html" . }}
<h2 class="term-post-title">
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
</h2>
{{ end }}
</section>
<nav class="paginator">
{{- partial "pagination.html" . }}
</nav>
<nav class="paginator">{{- partial "pagination.html" . }}</nav>
{{ end }}

View File

@@ -1,117 +1,119 @@
<script>
(function () {
var btn = document.getElementById('theme-toggle');
if (!btn) return;
(function () {
var btn = document.getElementById('theme-toggle');
if (!btn) return;
function getTheme() {
var stored = localStorage.getItem('theme');
if (stored) return stored;
return window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
}
function getTheme() {
var stored = localStorage.getItem('theme');
if (stored) return stored;
return window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
}
function applyTheme(theme) {
document.documentElement.setAttribute('data-theme', theme);
localStorage.setItem('theme', theme);
}
function applyTheme(theme) {
document.documentElement.setAttribute('data-theme', theme);
localStorage.setItem('theme', theme);
}
applyTheme(getTheme());
applyTheme(getTheme());
btn.addEventListener('click', function () {
var current = document.documentElement.getAttribute('data-theme') || getTheme();
applyTheme(current === 'dark' ? 'light' : 'dark');
});
})();
btn.addEventListener('click', function () {
var current = document.documentElement.getAttribute('data-theme') || getTheme();
applyTheme(current === 'dark' ? 'light' : 'dark');
});
})();
</script>
<script>
(function () {
var BACKEND = 'https://backend.freedoms4.org/auth.php';
var username = localStorage.getItem('f4_username');
if (!username) return;
(function () {
var BACKEND = 'https://backend.freedoms4.org/auth.php';
var username = localStorage.getItem('f4_username');
if (!username) return;
function applyLoggedIn(uname) {
// ── Desktop ──────────────────────────────────────────────────────────
var authDesktop = document.querySelector('.brand__auth--desktop');
if (authDesktop) {
authDesktop.classList.add('brand__auth--loggedin');
function applyLoggedIn(uname) {
// ── Desktop ──────────────────────────────────────────────────────────
var authDesktop = document.querySelector('.brand__auth--desktop');
if (authDesktop) {
authDesktop.classList.add('brand__auth--loggedin');
// Build user button + dropdown
var userWrap = document.createElement('div');
userWrap.className = 'brand__auth-user';
// Build user button + dropdown
var userWrap = document.createElement('div');
userWrap.className = 'brand__auth-user';
var userBtn = document.createElement('button');
userBtn.className = 'brand__auth-user-btn';
userBtn.setAttribute('aria-label', 'Account menu');
var userBtn = document.createElement('button');
userBtn.className = 'brand__auth-user-btn';
userBtn.setAttribute('aria-label', 'Account menu');
var iconSvg = document.createElement('span');
iconSvg.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>';
userBtn.appendChild(iconSvg.firstChild);
userBtn.appendChild(document.createTextNode('\u00a0' + uname));
var iconSvg = document.createElement('span');
iconSvg.innerHTML =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>';
userBtn.appendChild(iconSvg.firstChild);
userBtn.appendChild(document.createTextNode('\u00a0' + uname));
var dropdown = document.createElement('div');
dropdown.className = 'brand__auth-user-dropdown';
var dropdown = document.createElement('div');
dropdown.className = 'brand__auth-user-dropdown';
var logoutBtn = document.createElement('button');
logoutBtn.className = 'brand__auth-user-logout';
logoutBtn.textContent = 'Log Out';
logoutBtn.addEventListener('click', doLogout);
var logoutBtn = document.createElement('button');
logoutBtn.className = 'brand__auth-user-logout';
logoutBtn.textContent = 'Log Out';
logoutBtn.addEventListener('click', doLogout);
dropdown.appendChild(logoutBtn);
userWrap.appendChild(userBtn);
userWrap.appendChild(dropdown);
authDesktop.appendChild(userWrap);
dropdown.appendChild(logoutBtn);
userWrap.appendChild(userBtn);
userWrap.appendChild(dropdown);
authDesktop.appendChild(userWrap);
// Toggle dropdown on button click
userBtn.addEventListener('click', function (e) {
e.stopPropagation();
userWrap.classList.toggle('is-open');
});
document.addEventListener('click', function () {
userWrap.classList.remove('is-open');
});
}
// Toggle dropdown on button click
userBtn.addEventListener('click', function (e) {
e.stopPropagation();
userWrap.classList.toggle('is-open');
});
document.addEventListener('click', function () {
userWrap.classList.remove('is-open');
});
}
// ── Mobile ────────────────────────────────────────────────────────────
var mobileLinks = document.querySelector('.brand__mobile-links');
if (mobileLinks) {
// Remove Login / Sign Up links
mobileLinks.querySelectorAll('a.mobile-link').forEach(function (a) {
if (a.href.indexOf('/login/') !== -1 || a.href.indexOf('/signup/') !== -1) {
a.remove();
}
});
// Add logout link
var mLogout = document.createElement('button');
mLogout.className = 'mobile-link mobile-link--logout';
mLogout.textContent = 'Log Out (' + uname + ')';
mLogout.style.cssText = 'background:none;border:none;cursor:pointer;font-family:inherit;font-size:inherit;padding:0;text-align:left;width:100%;';
mLogout.addEventListener('click', doLogout);
mobileLinks.insertBefore(mLogout, mobileLinks.firstChild);
}
}
// ── Mobile ────────────────────────────────────────────────────────────
var mobileLinks = document.querySelector('.brand__mobile-links');
if (mobileLinks) {
// Remove Login / Sign Up links
mobileLinks.querySelectorAll('a.mobile-link').forEach(function (a) {
if (a.href.indexOf('/login/') !== -1 || a.href.indexOf('/signup/') !== -1) {
a.remove();
}
});
// Add logout link
var mLogout = document.createElement('button');
mLogout.className = 'mobile-link mobile-link--logout';
mLogout.textContent = 'Log Out (' + uname + ')';
mLogout.style.cssText =
'background:none;border:none;cursor:pointer;font-family:inherit;font-size:inherit;padding:0;text-align:left;width:100%;';
mLogout.addEventListener('click', doLogout);
mobileLinks.insertBefore(mLogout, mobileLinks.firstChild);
}
}
function doLogout() {
fetch(BACKEND, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ action: 'logout' })
}).finally(function () {
localStorage.removeItem('f4_username');
window.location.href = '/';
});
}
function doLogout() {
fetch(BACKEND, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ action: 'logout' }),
}).finally(function () {
localStorage.removeItem('f4_username');
window.location.href = '/';
});
}
applyLoggedIn(username);
})();
applyLoggedIn(username);
})();
</script>
<script>
(function () {
var check = document.getElementById('mobile-menu-check');
if (!check) return;
document.addEventListener('click', function (e) {
if (!check.checked) return;
var menu = check.closest('.brand__mobile-menu');
if (menu && !menu.contains(e.target)) check.checked = false;
});
})();
(function () {
var check = document.getElementById('mobile-menu-check');
if (!check) return;
document.addEventListener('click', function (e) {
if (!check.checked) return;
var menu = check.closest('.brand__mobile-menu');
if (menu && !menu.contains(e.target)) check.checked = false;
});
})();
</script>

View File

@@ -1 +1,3 @@
<p class="footer__copyright-notice">&copy; <a href="https://freedoms4.org">freedoms4.org</a> <a href="/changelog/">Changelog</a></p>
<p class="footer__copyright-notice">
&copy; <a href="https://freedoms4.org">freedoms4.org</a> <a href="/changelog/">Changelog</a>
</p>

View File

@@ -62,7 +62,6 @@
d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"
/>
</svg>
</label>
<div class="brand__auth-links">
<a href="/login/" class="auth-link auth-link--login">Login</a>

View File

@@ -1,6 +1,4 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ end }}
{{ .Content }} {{ end }}

View File

@@ -1,6 +1,4 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ end }}
{{ .Content }} {{ end }}

View File

@@ -13,43 +13,116 @@
<img src="/logo.png" alt="Freedoms4 logo" />
<h1>Freedoms4</h1>
<div class="brand__actions">
<button class="theme-toggle" id="theme-toggle" aria-label="Toggle theme" title="Toggle dark/light mode">
<svg class="theme-toggle__sun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"/></svg>
<svg class="theme-toggle__moon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"/></svg>
<button
class="theme-toggle"
id="theme-toggle"
aria-label="Toggle theme"
title="Toggle dark/light mode"
>
<svg
class="theme-toggle__sun"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path
d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"
/>
</svg>
<svg
class="theme-toggle__moon"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z" />
</svg>
</button>
<!-- Desktop: account + subscribe -->
<div class="brand__auth brand__auth--desktop">
<input type="checkbox" id="auth-dropdown" class="brand__auth-check" />
<label class="brand__auth-toggle" for="auth-dropdown" tabindex="0" aria-label="Account options">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>
<label
class="brand__auth-toggle"
for="auth-dropdown"
tabindex="0"
aria-label="Account options"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
>
<path
d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"
/>
</svg>
</label>
<div class="brand__auth-links">
<a href="/login/" class="auth-link auth-link--login">Login</a>
<a href="/signup/" class="auth-link auth-link--signup">Sign Up</a>
</div>
</div>
{{- $rssURL := "/index.xml" -}}
{{- with .OutputFormats.Get "rss" -}}
{{- $rssURL = .RelPermalink -}}
{{- end -}}
<a href="{{ $rssURL }}" class="rss-subscribe__link rss-subscribe__link--desktop" title="Subscribe via RSS">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="10" height="10" fill="currentColor" aria-hidden="true">
<path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/>
{{- $rssURL := "/index.xml" -}} {{- with .OutputFormats.Get "rss" -}} {{-
$rssURL = .RelPermalink -}} {{- end -}}
<a
href="{{ $rssURL }}"
class="rss-subscribe__link rss-subscribe__link--desktop"
title="Subscribe via RSS"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="10"
height="10"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
<span>Subscribe</span>
</a>
<!-- Mobile: combined dropdown -->
<div class="brand__mobile-menu">
<input type="checkbox" id="mobile-menu-check" class="brand__mobile-check" />
<label class="brand__mobile-toggle" for="mobile-menu-check" aria-label="Menu">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>
<label
class="brand__mobile-toggle"
for="mobile-menu-check"
aria-label="Menu"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="18"
height="18"
fill="currentColor"
>
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
</svg>
</label>
<div class="brand__mobile-links">
<a href="/login/" class="mobile-link">Login</a>
<a href="/signup/" class="mobile-link">Sign Up</a>
<a href="{{ $rssURL }}" class="mobile-link mobile-link--subscribe">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor" aria-hidden="true"><path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/></svg>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
Subscribe
</a>
</div>

View File

@@ -1,4 +1,3 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ end }}
{{ .Content }} {{ end }}

View File

@@ -1,5 +1 @@
{{ define "main" }}
{{ .Content }}
{{ end }}
{{ define "main" }} {{ .Content }} {{ end }}

View File

@@ -1,3 +1 @@
{{ define "main" }}
{{ .Content }}
{{ end }}
{{ define "main" }} {{ .Content }} {{ end }}

View File

@@ -13,43 +13,116 @@
<img src="/logo.png" alt="Freedoms4 logo" />
<h1>Freedoms4</h1>
<div class="brand__actions">
<button class="theme-toggle" id="theme-toggle" aria-label="Toggle theme" title="Toggle dark/light mode">
<svg class="theme-toggle__sun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"/></svg>
<svg class="theme-toggle__moon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"/></svg>
<button
class="theme-toggle"
id="theme-toggle"
aria-label="Toggle theme"
title="Toggle dark/light mode"
>
<svg
class="theme-toggle__sun"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path
d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"
/>
</svg>
<svg
class="theme-toggle__moon"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z" />
</svg>
</button>
<!-- Desktop: account + subscribe -->
<div class="brand__auth brand__auth--desktop">
<input type="checkbox" id="auth-dropdown" class="brand__auth-check" />
<label class="brand__auth-toggle" for="auth-dropdown" tabindex="0" aria-label="Account options">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>
<label
class="brand__auth-toggle"
for="auth-dropdown"
tabindex="0"
aria-label="Account options"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
>
<path
d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"
/>
</svg>
</label>
<div class="brand__auth-links">
<a href="/login/" class="auth-link auth-link--login">Login</a>
<a href="/signup/" class="auth-link auth-link--signup">Sign Up</a>
</div>
</div>
{{- $rssURL := "/index.xml" -}}
{{- with .OutputFormats.Get "rss" -}}
{{- $rssURL = .RelPermalink -}}
{{- end -}}
<a href="{{ $rssURL }}" class="rss-subscribe__link rss-subscribe__link--desktop" title="Subscribe via RSS">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="10" height="10" fill="currentColor" aria-hidden="true">
<path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/>
{{- $rssURL := "/index.xml" -}} {{- with .OutputFormats.Get "rss" -}} {{-
$rssURL = .RelPermalink -}} {{- end -}}
<a
href="{{ $rssURL }}"
class="rss-subscribe__link rss-subscribe__link--desktop"
title="Subscribe via RSS"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="10"
height="10"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
<span>Subscribe</span>
</a>
<!-- Mobile: combined dropdown -->
<div class="brand__mobile-menu">
<input type="checkbox" id="mobile-menu-check" class="brand__mobile-check" />
<label class="brand__mobile-toggle" for="mobile-menu-check" aria-label="Menu">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>
<label
class="brand__mobile-toggle"
for="mobile-menu-check"
aria-label="Menu"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="18"
height="18"
fill="currentColor"
>
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
</svg>
</label>
<div class="brand__mobile-links">
<a href="/login/" class="mobile-link">Login</a>
<a href="/signup/" class="mobile-link">Sign Up</a>
<a href="{{ $rssURL }}" class="mobile-link mobile-link--subscribe">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor" aria-hidden="true"><path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/></svg>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
Subscribe
</a>
</div>

View File

@@ -1,121 +1,162 @@
{{ define "main" }}
<div class="auth-page">
<h1 class="auth-page__title">{{ .Title }}</h1>
<h1 class="auth-page__title">{{ .Title }}</h1>
<div class="auth-card">
<div id="auth-message" class="auth-message" aria-live="polite" style="display:none"></div>
<div class="auth-card">
<div id="auth-message" class="auth-message" aria-live="polite" style="display: none"></div>
<form id="login-form" class="auth-form" novalidate>
<div class="auth-form__group">
<label class="auth-form__label" for="login-username">Username</label>
<input
class="auth-form__input"
type="text"
id="login-username"
name="username"
autocomplete="username"
required
placeholder="your_username"
/>
</div>
<form id="login-form" class="auth-form" novalidate>
<div class="auth-form__input-wrap">
<div class="auth-form__group">
<label class="auth-form__label" for="login-username">Username</label>
<input
class="auth-form__input"
type="text"
id="login-username"
name="username"
autocomplete="username"
required
/>
</div>
<div class="auth-form__group">
<label class="auth-form__label" for="login-password">Password</label>
<div class="auth-form__input-wrap">
<input
class="auth-form__input"
type="password"
id="login-password"
name="password"
autocomplete="current-password"
required
placeholder="••••••••"
/>
<button type="button" class="auth-form__eye" aria-label="Toggle password visibility" tabindex="-1">
<svg class="eye-show" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>
<svg class="eye-hide" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" style="display:none"><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>
</button>
</div>
</div>
<div class="auth-form__group">
<label class="auth-form__label" for="login-password">Password</label>
<input
class="auth-form__input"
type="password"
id="login-password"
name="password"
autocomplete="current-password"
required
/>
<button
type="button"
class="auth-form__eye"
aria-label="Toggle password visibility"
tabindex="-1"
>
<svg
class="eye-show"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path
d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"
/>
</svg>
<svg
class="eye-hide"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
style="display: none"
>
<path
d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"
/>
</svg>
</button>
</div>
</div>
<button type="submit" class="auth-form__submit" id="login-submit">
<span class="auth-form__submit-text">Log In</span>
<span class="auth-form__submit-loader" style="display:none">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="spin"><path d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"/></svg>
</span>
</button>
</form>
<button type="submit" class="auth-form__submit" id="login-submit">
<span class="auth-form__submit-text">Log In</span>
<span class="auth-form__submit-loader" style="display: none">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
class="spin"
>
<path
d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"
/>
</svg>
</span>
</button>
</form>
<p class="auth-card__footer">
Don't have an account? <a href="/signup/" class="auth-card__link">Sign up</a>
</p>
</div>
<p class="auth-card__footer">
Don't have an account? <a href="/signup/" class="auth-card__link">Sign up</a>
</p>
</div>
</div>
<script>
(function () {
var BACKEND = 'https://backend.freedoms4.org/auth.php';
(function () {
var BACKEND = 'https://backend.freedoms4.org/auth.php';
var form = document.getElementById('login-form');
var msgBox = document.getElementById('auth-message');
var submitBtn = document.getElementById('login-submit');
var eyeBtn = form.querySelector('.auth-form__eye');
var pwdInput = document.getElementById('login-password');
var form = document.getElementById('login-form');
var msgBox = document.getElementById('auth-message');
var submitBtn = document.getElementById('login-submit');
var eyeBtn = form.querySelector('.auth-form__eye');
var pwdInput = document.getElementById('login-password');
eyeBtn.addEventListener('click', function () {
var isText = pwdInput.type === 'text';
pwdInput.type = isText ? 'password' : 'text';
eyeBtn.querySelector('.eye-show').style.display = isText ? '' : 'none';
eyeBtn.querySelector('.eye-hide').style.display = isText ? 'none' : '';
});
eyeBtn.addEventListener('click', function () {
var isText = pwdInput.type === 'text';
pwdInput.type = isText ? 'password' : 'text';
eyeBtn.querySelector('.eye-show').style.display = isText ? '' : 'none';
eyeBtn.querySelector('.eye-hide').style.display = isText ? 'none' : '';
});
function showMsg(text, type) {
msgBox.textContent = text;
msgBox.className = 'auth-message auth-message--' + type;
msgBox.style.display = 'block';
}
function showMsg(text, type) {
msgBox.textContent = text;
msgBox.className = 'auth-message auth-message--' + type;
msgBox.style.display = 'block';
}
form.addEventListener('submit', function (e) {
e.preventDefault();
msgBox.style.display = 'none';
form.addEventListener('submit', function (e) {
e.preventDefault();
msgBox.style.display = 'none';
var username = document.getElementById('login-username').value.trim();
var password = pwdInput.value;
var username = document.getElementById('login-username').value.trim();
var password = pwdInput.value;
if (!username || !password) {
showMsg('Please fill in all fields.', 'error');
return;
}
if (!username || !password) {
showMsg('Please fill in all fields.', 'error');
return;
}
submitBtn.disabled = true;
submitBtn.querySelector('.auth-form__submit-text').style.display = 'none';
submitBtn.querySelector('.auth-form__submit-loader').style.display = 'inline-flex';
submitBtn.disabled = true;
submitBtn.querySelector('.auth-form__submit-text').style.display = 'none';
submitBtn.querySelector('.auth-form__submit-loader').style.display = 'inline-flex';
fetch(BACKEND, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ action: 'login', username: username, password: password })
})
.then(function (r) { return r.json(); })
.then(function (data) {
if (data.success) {
showMsg('Logged in successfully! Redirecting\u2026', 'success');
localStorage.setItem('f4_username', username);
setTimeout(function () { window.location.href = data.redirect || '/'; }, 1000);
} else {
showMsg(data.message || 'Login failed. Please try again.', 'error');
}
})
.catch(function () {
showMsg('Network error. Please try again.', 'error');
})
.finally(function () {
submitBtn.disabled = false;
submitBtn.querySelector('.auth-form__submit-text').style.display = '';
submitBtn.querySelector('.auth-form__submit-loader').style.display = 'none';
});
});
})();
fetch(BACKEND, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ action: 'login', username: username, password: password }),
})
.then(function (r) {
return r.json();
})
.then(function (data) {
if (data.success) {
showMsg('Logged in successfully! Redirecting\u2026', 'success');
localStorage.setItem('f4_username', username);
setTimeout(function () {
window.location.href = data.redirect || '/';
}, 1000);
} else {
showMsg(data.message || 'Login failed. Please try again.', 'error');
}
})
.catch(function () {
showMsg('Network error. Please try again.', 'error');
})
.finally(function () {
submitBtn.disabled = false;
submitBtn.querySelector('.auth-form__submit-text').style.display = '';
submitBtn.querySelector('.auth-form__submit-loader').style.display = 'none';
});
});
})();
</script>
{{ end }}

View File

@@ -1,29 +1,23 @@
{{ define "main" }}
{{ $pages := .Pages }}
{{ $sectionPagerSize := or site.Params.sectionPagerSize 10 }}
{{ $paginator := .Paginate $pages $sectionPagerSize }}
{{ define "main" }} {{ $pages := .Pages }} {{ $sectionPagerSize := or site.Params.sectionPagerSize
10 }} {{ $paginator := .Paginate $pages $sectionPagerSize }}
<nav class="uninotes-breadcrumbs breadcrumbs">
<a href="/blog/">Blog</a>
{{ if gt $paginator.TotalPages 1 }}
<span>Page {{ $paginator.PageNumber }} of {{ $paginator.TotalPages }}</span>
{{ end }}
<a href="/blog/">Blog</a>
{{ if gt $paginator.TotalPages 1 }}
<span>Page {{ $paginator.PageNumber }} of {{ $paginator.TotalPages }}</span>
{{ end }}
</nav>
{{ .Content }}
<h1>All Posts | <a href="/categories/" style="text-decoration: none; color: var(--accent-color);">Categories</a></h1>
{{ range $paginator.Pages }}
<h2 class="home-post-title"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ partial "main/dates.html" . }}
{{ with .Summary }}
{{- /*
Create deterministic summary output for styling.
See https://github.com/gohugoio/hugo/issues/8910
*/ -}}
<p class="summary">{{ . | plainify | htmlUnescape | chomp | truncate 150 }}</p>
{{- end }}
{{ end }}
<nav class="paginator">
{{- partial "pagination.html" . }} {{/* embedded template */}}
</nav>
{{ .Content }}
<h1>
All Posts |
<a href="/categories/" style="text-decoration: none; color: var(--accent-color)">Categories</a>
</h1>
{{ range $paginator.Pages }}
<h2 class="home-post-title"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ partial "main/dates.html" . }} {{ with .Summary }} {{- /* Create deterministic summary output for
styling. See https://github.com/gohugoio/hugo/issues/8910 */ -}}
<p class="summary">{{ . | plainify | htmlUnescape | chomp | truncate 150 }}</p>
{{- end }} {{ end }}
<nav class="paginator">{{- partial "pagination.html" . }} {{/* embedded template */}}</nav>
{{ end }}

View File

@@ -13,43 +13,116 @@
<img src="/logo.png" alt="Freedoms4 logo" />
<h1>Freedoms4</h1>
<div class="brand__actions">
<button class="theme-toggle" id="theme-toggle" aria-label="Toggle theme" title="Toggle dark/light mode">
<svg class="theme-toggle__sun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"/></svg>
<svg class="theme-toggle__moon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"/></svg>
<button
class="theme-toggle"
id="theme-toggle"
aria-label="Toggle theme"
title="Toggle dark/light mode"
>
<svg
class="theme-toggle__sun"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path
d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"
/>
</svg>
<svg
class="theme-toggle__moon"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z" />
</svg>
</button>
<!-- Desktop: account + subscribe -->
<div class="brand__auth brand__auth--desktop">
<input type="checkbox" id="auth-dropdown" class="brand__auth-check" />
<label class="brand__auth-toggle" for="auth-dropdown" tabindex="0" aria-label="Account options">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>
<label
class="brand__auth-toggle"
for="auth-dropdown"
tabindex="0"
aria-label="Account options"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
>
<path
d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"
/>
</svg>
</label>
<div class="brand__auth-links">
<a href="/login/" class="auth-link auth-link--login">Login</a>
<a href="/signup/" class="auth-link auth-link--signup">Sign Up</a>
</div>
</div>
{{- $rssURL := "/index.xml" -}}
{{- with .OutputFormats.Get "rss" -}}
{{- $rssURL = .RelPermalink -}}
{{- end -}}
<a href="{{ $rssURL }}" class="rss-subscribe__link rss-subscribe__link--desktop" title="Subscribe via RSS">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="10" height="10" fill="currentColor" aria-hidden="true">
<path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/>
{{- $rssURL := "/index.xml" -}} {{- with .OutputFormats.Get "rss" -}} {{-
$rssURL = .RelPermalink -}} {{- end -}}
<a
href="{{ $rssURL }}"
class="rss-subscribe__link rss-subscribe__link--desktop"
title="Subscribe via RSS"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="10"
height="10"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
<span>Subscribe</span>
</a>
<!-- Mobile: combined dropdown -->
<div class="brand__mobile-menu">
<input type="checkbox" id="mobile-menu-check" class="brand__mobile-check" />
<label class="brand__mobile-toggle" for="mobile-menu-check" aria-label="Menu">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>
<label
class="brand__mobile-toggle"
for="mobile-menu-check"
aria-label="Menu"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="18"
height="18"
fill="currentColor"
>
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
</svg>
</label>
<div class="brand__mobile-links">
<a href="/login/" class="mobile-link">Login</a>
<a href="/signup/" class="mobile-link">Sign Up</a>
<a href="{{ $rssURL }}" class="mobile-link mobile-link--subscribe">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor" aria-hidden="true"><path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/></svg>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
Subscribe
</a>
</div>

View File

@@ -1,60 +1,41 @@
{{ define "main" }}
{{ $semesterName := .Title }}
{{ define "main" }} {{ $semesterName := .Title }}
<nav class="uninotes-breadcrumbs breadcrumbs">
<a href="/uninotes/">UniNotes</a>
<span>{{ $semesterName }}</span>
<a href="/uninotes/">UniNotes</a>
<span>{{ $semesterName }}</span>
</nav>
<h1>{{ $semesterName }}</h1>
{{/* Collect unique subject codes from posts in this semester */}}
{{ $subjectCodes := slice }}
{{ range .Pages }}
{{ $raw := .Params.subjectcode }}
{{ $code := "" }}
{{ if reflect.IsSlice $raw }}
{{ $code = index $raw 0 }}
{{ else }}
{{ $code = $raw }}
{{ end }}
{{ if and $code (not (in $subjectCodes $code)) }}
{{ $subjectCodes = $subjectCodes | append $code }}
{{ end }}
{{ end }}
{{ $subjectCodes = sort $subjectCodes }}
{{/* Collect unique subject codes from posts in this semester */}} {{ $subjectCodes := slice }} {{
range .Pages }} {{ $raw := .Params.subjectcode }} {{ $code := "" }} {{ if reflect.IsSlice $raw }} {{
$code = index $raw 0 }} {{ else }} {{ $code = $raw }} {{ end }} {{ if and $code (not (in
$subjectCodes $code)) }} {{ $subjectCodes = $subjectCodes | append $code }} {{ end }} {{ end }} {{
$subjectCodes = sort $subjectCodes }}
<ol class="uninotes-list uninotes-list--subjects">
{{ range $subjectCodes }}
{{ $tp := site.GetPage (printf "/subjectcode/%s" (. | urlize)) }}
<li class="uninotes-list__item">
{{ if $tp }}
<a class="uninotes-list__link" href="{{ $tp.RelPermalink }}">{{ . }}</a>
{{ else }}
<span class="uninotes-list__link">{{ . }}</span>
{{ end }}
</li>
{{ end }}
{{ range $subjectCodes }} {{ $tp := site.GetPage (printf "/subjectcode/%s" (. | urlize)) }}
<li class="uninotes-list__item">
{{ if $tp }}
<a class="uninotes-list__link" href="{{ $tp.RelPermalink }}">{{ . }}</a>
{{ else }}
<span class="uninotes-list__link">{{ . }}</span>
{{ end }}
</li>
{{ end }}
</ol>
{{/* Semester prev/next */}}
{{ $allSemesters := site.Taxonomies.semester.Alphabetical }}
{{ if gt (len $allSemesters) 1 }}
{{ $currentIdx := 0 }}
{{ range $i, $s := $allSemesters }}
{{ if eq $s.Page.Title $semesterName }}{{ $currentIdx = $i }}{{ end }}
{{ end }}
<nav class="page-nav">
{{ if gt $currentIdx 0 }}
{{ $prev := index $allSemesters (sub $currentIdx 1) }}
<a class="page-nav__previous-link" href="{{ $prev.Page.RelPermalink }}">{{ $prev.Page.Title }}</a>
{{ end }}
{{ if lt $currentIdx (sub (len $allSemesters) 1) }}
{{ $next := index $allSemesters (add $currentIdx 1) }}
<a class="page-nav__next-link" href="{{ $next.Page.RelPermalink }}">{{ $next.Page.Title }} →</a>
{{ end }}
</nav>
{{ end }}
{{ end }}
{{/* Semester prev/next */}} {{ $allSemesters := site.Taxonomies.semester.Alphabetical }} {{ if gt
(len $allSemesters) 1 }} {{ $currentIdx := 0 }} {{ range $i, $s := $allSemesters }} {{ if eq
$s.Page.Title $semesterName }}{{ $currentIdx = $i }}{{ end }} {{ end }}
<nav class="page-nav">
{{ if gt $currentIdx 0 }} {{ $prev := index $allSemesters (sub $currentIdx 1) }}
<a class="page-nav__previous-link" href="{{ $prev.Page.RelPermalink }}"
>← {{ $prev.Page.Title }}</a
>
{{ end }} {{ if lt $currentIdx (sub (len $allSemesters) 1) }} {{ $next := index $allSemesters
(add $currentIdx 1) }}
<a class="page-nav__next-link" href="{{ $next.Page.RelPermalink }}">{{ $next.Page.Title }}</a>
{{ end }}
</nav>
{{ end }} {{ end }}

View File

@@ -13,43 +13,116 @@
<img src="/logo.png" alt="Freedoms4 logo" />
<h1>Freedoms4</h1>
<div class="brand__actions">
<button class="theme-toggle" id="theme-toggle" aria-label="Toggle theme" title="Toggle dark/light mode">
<svg class="theme-toggle__sun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"/></svg>
<svg class="theme-toggle__moon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"/></svg>
<button
class="theme-toggle"
id="theme-toggle"
aria-label="Toggle theme"
title="Toggle dark/light mode"
>
<svg
class="theme-toggle__sun"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path
d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"
/>
</svg>
<svg
class="theme-toggle__moon"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z" />
</svg>
</button>
<!-- Desktop: account + subscribe -->
<div class="brand__auth brand__auth--desktop">
<input type="checkbox" id="auth-dropdown" class="brand__auth-check" />
<label class="brand__auth-toggle" for="auth-dropdown" tabindex="0" aria-label="Account options">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>
<label
class="brand__auth-toggle"
for="auth-dropdown"
tabindex="0"
aria-label="Account options"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
>
<path
d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"
/>
</svg>
</label>
<div class="brand__auth-links">
<a href="/login/" class="auth-link auth-link--login">Login</a>
<a href="/signup/" class="auth-link auth-link--signup">Sign Up</a>
</div>
</div>
{{- $rssURL := "/index.xml" -}}
{{- with .OutputFormats.Get "rss" -}}
{{- $rssURL = .RelPermalink -}}
{{- end -}}
<a href="{{ $rssURL }}" class="rss-subscribe__link rss-subscribe__link--desktop" title="Subscribe via RSS">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="10" height="10" fill="currentColor" aria-hidden="true">
<path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/>
{{- $rssURL := "/index.xml" -}} {{- with .OutputFormats.Get "rss" -}} {{-
$rssURL = .RelPermalink -}} {{- end -}}
<a
href="{{ $rssURL }}"
class="rss-subscribe__link rss-subscribe__link--desktop"
title="Subscribe via RSS"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="10"
height="10"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
<span>Subscribe</span>
</a>
<!-- Mobile: combined dropdown -->
<div class="brand__mobile-menu">
<input type="checkbox" id="mobile-menu-check" class="brand__mobile-check" />
<label class="brand__mobile-toggle" for="mobile-menu-check" aria-label="Menu">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>
<label
class="brand__mobile-toggle"
for="mobile-menu-check"
aria-label="Menu"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="18"
height="18"
fill="currentColor"
>
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
</svg>
</label>
<div class="brand__mobile-links">
<a href="/login/" class="mobile-link">Login</a>
<a href="/signup/" class="mobile-link">Sign Up</a>
<a href="{{ $rssURL }}" class="mobile-link mobile-link--subscribe">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor" aria-hidden="true"><path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/></svg>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
Subscribe
</a>
</div>

View File

@@ -1,17 +1,17 @@
{{ define "main" }}
<nav class="uninotes-breadcrumbs breadcrumbs">
<a href="/services/">Services</a>
<a href="/services/">Services</a>
</nav>
<h1>Services</h1>
<ol class="uninotes-list uninotes-list--subjects">
{{ range .Pages.ByTitle }}
<li class="uninotes-list__item">
<a class="uninotes-list__link" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
</li>
{{ end }}
{{ range .Pages.ByTitle }}
<li class="uninotes-list__item">
<a class="uninotes-list__link" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
</li>
{{ end }}
</ol>
{{ end }}

View File

@@ -1,33 +1,22 @@
{{ define "main" }}
<nav class="uninotes-breadcrumbs breadcrumbs">
<a href="/services/">Services</a>
<span>{{ .Title }}</span>
<a href="/services/">Services</a>
<span>{{ .Title }}</span>
</nav>
<h1>{{ .Title }}</h1>
{{ .Content }}
{{/* Prev/next among sibling services */}}
{{ $allPages := .CurrentSection.Pages.ByTitle }}
{{ $currentTitle := .Title }}
{{ $currentIdx := 0 }}
{{ range $i, $p := $allPages }}
{{ if eq $p.Title $currentTitle }}{{ $currentIdx = $i }}{{ end }}
{{ end }}
{{ if gt (len $allPages) 1 }}
{{ .Content }} {{/* Prev/next among sibling services */}} {{ $allPages :=
.CurrentSection.Pages.ByTitle }} {{ $currentTitle := .Title }} {{ $currentIdx := 0 }} {{ range $i,
$p := $allPages }} {{ if eq $p.Title $currentTitle }}{{ $currentIdx = $i }}{{ end }} {{ end }} {{ if
gt (len $allPages) 1 }}
<nav class="page-nav">
{{ if gt $currentIdx 0 }}
{{ $prev := index $allPages (sub $currentIdx 1) }}
<a class="page-nav__previous-link" href="{{ $prev.RelPermalink }}">← {{ $prev.LinkTitle }}</a>
{{ end }}
{{ if lt $currentIdx (sub (len $allPages) 1) }}
{{ $next := index $allPages (add $currentIdx 1) }}
<a class="page-nav__next-link" href="{{ $next.RelPermalink }}">{{ $next.LinkTitle }} →</a>
{{ end }}
{{ if gt $currentIdx 0 }} {{ $prev := index $allPages (sub $currentIdx 1) }}
<a class="page-nav__previous-link" href="{{ $prev.RelPermalink }}">← {{ $prev.LinkTitle }}</a>
{{ end }} {{ if lt $currentIdx (sub (len $allPages) 1) }} {{ $next := index $allPages (add
$currentIdx 1) }}
<a class="page-nav__next-link" href="{{ $next.RelPermalink }}">{{ $next.LinkTitle }} →</a>
{{ end }}
</nav>
{{ end }}
{{ end }}
{{ end }} {{ end }}

View File

@@ -13,43 +13,116 @@
<img src="/logo.png" alt="Freedoms4 logo" />
<h1>Freedoms4</h1>
<div class="brand__actions">
<button class="theme-toggle" id="theme-toggle" aria-label="Toggle theme" title="Toggle dark/light mode">
<svg class="theme-toggle__sun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"/></svg>
<svg class="theme-toggle__moon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"/></svg>
<button
class="theme-toggle"
id="theme-toggle"
aria-label="Toggle theme"
title="Toggle dark/light mode"
>
<svg
class="theme-toggle__sun"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path
d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"
/>
</svg>
<svg
class="theme-toggle__moon"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z" />
</svg>
</button>
<!-- Desktop: account + subscribe -->
<div class="brand__auth brand__auth--desktop">
<input type="checkbox" id="auth-dropdown" class="brand__auth-check" />
<label class="brand__auth-toggle" for="auth-dropdown" tabindex="0" aria-label="Account options">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>
<label
class="brand__auth-toggle"
for="auth-dropdown"
tabindex="0"
aria-label="Account options"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
>
<path
d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"
/>
</svg>
</label>
<div class="brand__auth-links">
<a href="/login/" class="auth-link auth-link--login">Login</a>
<a href="/signup/" class="auth-link auth-link--signup">Sign Up</a>
</div>
</div>
{{- $rssURL := "/index.xml" -}}
{{- with .OutputFormats.Get "rss" -}}
{{- $rssURL = .RelPermalink -}}
{{- end -}}
<a href="{{ $rssURL }}" class="rss-subscribe__link rss-subscribe__link--desktop" title="Subscribe via RSS">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="10" height="10" fill="currentColor" aria-hidden="true">
<path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/>
{{- $rssURL := "/index.xml" -}} {{- with .OutputFormats.Get "rss" -}} {{-
$rssURL = .RelPermalink -}} {{- end -}}
<a
href="{{ $rssURL }}"
class="rss-subscribe__link rss-subscribe__link--desktop"
title="Subscribe via RSS"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="10"
height="10"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
<span>Subscribe</span>
</a>
<!-- Mobile: combined dropdown -->
<div class="brand__mobile-menu">
<input type="checkbox" id="mobile-menu-check" class="brand__mobile-check" />
<label class="brand__mobile-toggle" for="mobile-menu-check" aria-label="Menu">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>
<label
class="brand__mobile-toggle"
for="mobile-menu-check"
aria-label="Menu"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="18"
height="18"
fill="currentColor"
>
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
</svg>
</label>
<div class="brand__mobile-links">
<a href="/login/" class="mobile-link">Login</a>
<a href="/signup/" class="mobile-link">Sign Up</a>
<a href="{{ $rssURL }}" class="mobile-link mobile-link--subscribe">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor" aria-hidden="true"><path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/></svg>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
Subscribe
</a>
</div>

View File

@@ -1,168 +1,214 @@
{{ define "main" }}
<div class="auth-page">
<h1 class="auth-page__title">{{ .Title }}</h1>
<h1 class="auth-page__title">{{ .Title }}</h1>
<div class="auth-card">
<div id="auth-message" class="auth-message" aria-live="polite" style="display:none"></div>
<div class="auth-card">
<div id="auth-message" class="auth-message" aria-live="polite" style="display: none"></div>
<form id="signup-form" class="auth-form" novalidate>
<div class="auth-form__group">
<label class="auth-form__label" for="signup-username">Username</label>
<input
class="auth-form__input"
type="text"
id="signup-username"
name="username"
autocomplete="username"
required
placeholder="choose_a_username"
minlength="3"
maxlength="32"
pattern="[a-zA-Z0-9_\-]+"
/>
<span class="auth-form__hint">332 characters; letters, numbers, _ and - only.</span>
</div>
<form id="signup-form" class="auth-form" novalidate>
<div class="auth-form__input-wrap">
<div class="auth-form__group">
<label class="auth-form__label" for="signup-username">Username</label>
<input
class="auth-form__input"
type="text"
id="signup-username"
name="username"
autocomplete="username"
required
minlength="3"
maxlength="32"
pattern="[a-zA-Z0-9_\-]+"
/>
<span class="auth-form__hint"
>(3-32 characters; letters, numbers, _ and - only)</span
>
</div>
<div class="auth-form__group">
<label class="auth-form__label" for="signup-email">Email</label>
<input
class="auth-form__input"
type="email"
id="signup-email"
name="email"
autocomplete="email"
required
placeholder="you@example.com"
/>
</div>
<div class="auth-form__group">
<label class="auth-form__label" for="signup-email">Email</label>
<input
class="auth-form__input"
type="email"
id="signup-email"
name="email"
autocomplete="email"
required
/>
</div>
<div class="auth-form__group">
<label class="auth-form__label" for="signup-password">Password</label>
<div class="auth-form__input-wrap">
<input
class="auth-form__input"
type="password"
id="signup-password"
name="password"
autocomplete="new-password"
required
placeholder="••••••••"
minlength="8"
/>
<button type="button" class="auth-form__eye" aria-label="Toggle password visibility" tabindex="-1">
<svg class="eye-show" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>
<svg class="eye-hide" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" style="display:none"><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>
</button>
</div>
<span class="auth-form__hint">At least 8 characters.</span>
</div>
<div class="auth-form__group">
<label class="auth-form__label" for="signup-password">Password</label>
<input
class="auth-form__input"
type="password"
id="signup-password"
name="password"
autocomplete="new-password"
required
minlength="8"
/>
<button
type="button"
class="auth-form__eye"
aria-label="Toggle password visibility"
tabindex="-1"
>
<svg
class="eye-show"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path
d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"
/>
</svg>
<svg
class="eye-hide"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
style="display: none"
>
<path
d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"
/>
</svg>
</button>
<span class="auth-form__hint">(at least 8 characters)</span>
</div>
<div class="auth-form__group">
<label class="auth-form__label" for="signup-confirm">Confirm Password</label>
<div class="auth-form__input-wrap">
<input
class="auth-form__input"
type="password"
id="signup-confirm"
name="confirm_password"
autocomplete="new-password"
required
placeholder="••••••••"
/>
</div>
</div>
<div class="auth-form__group">
<label class="auth-form__label" for="signup-confirm">Confirm Password</label>
<input
class="auth-form__input"
type="password"
id="signup-confirm"
name="confirm_password"
autocomplete="new-password"
required
/>
</div>
</div>
<button type="submit" class="auth-form__submit" id="signup-submit">
<span class="auth-form__submit-text">Create Account</span>
<span class="auth-form__submit-loader" style="display: none">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
class="spin"
>
<path
d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"
/>
</svg>
</span>
</button>
</form>
<button type="submit" class="auth-form__submit" id="signup-submit">
<span class="auth-form__submit-text">Create Account</span>
<span class="auth-form__submit-loader" style="display:none">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="spin"><path d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"/></svg>
</span>
</button>
</form>
<p class="auth-card__footer">
Already have an account? <a href="/login/" class="auth-card__link">Log in</a>
</p>
</div>
<p class="auth-card__footer">
Already have an account? <a href="/login/" class="auth-card__link">Log in</a>
</p>
</div>
</div>
<script>
(function () {
var BACKEND = 'https://backend.freedoms4.org/auth.php';
(function () {
var BACKEND = 'https://backend.freedoms4.org/auth.php';
var form = document.getElementById('signup-form');
var msgBox = document.getElementById('auth-message');
var submitBtn = document.getElementById('signup-submit');
var pwdInput = document.getElementById('signup-password');
var eyeBtn = form.querySelector('.auth-form__eye');
var form = document.getElementById('signup-form');
var msgBox = document.getElementById('auth-message');
var submitBtn = document.getElementById('signup-submit');
var pwdInput = document.getElementById('signup-password');
var eyeBtn = form.querySelector('.auth-form__eye');
eyeBtn.addEventListener('click', function () {
var isText = pwdInput.type === 'text';
pwdInput.type = isText ? 'password' : 'text';
eyeBtn.querySelector('.eye-show').style.display = isText ? '' : 'none';
eyeBtn.querySelector('.eye-hide').style.display = isText ? 'none' : '';
});
eyeBtn.addEventListener('click', function () {
var isText = pwdInput.type === 'text';
pwdInput.type = isText ? 'password' : 'text';
eyeBtn.querySelector('.eye-show').style.display = isText ? '' : 'none';
eyeBtn.querySelector('.eye-hide').style.display = isText ? 'none' : '';
});
function showMsg(text, type) {
msgBox.textContent = text;
msgBox.className = 'auth-message auth-message--' + type;
msgBox.style.display = 'block';
}
function showMsg(text, type) {
msgBox.textContent = text;
msgBox.className = 'auth-message auth-message--' + type;
msgBox.style.display = 'block';
}
form.addEventListener('submit', function (e) {
e.preventDefault();
msgBox.style.display = 'none';
form.addEventListener('submit', function (e) {
e.preventDefault();
msgBox.style.display = 'none';
var username = document.getElementById('signup-username').value.trim();
var email = document.getElementById('signup-email').value.trim();
var password = pwdInput.value;
var confirm = document.getElementById('signup-confirm').value;
var username = document.getElementById('signup-username').value.trim();
var email = document.getElementById('signup-email').value.trim();
var password = pwdInput.value;
var confirm = document.getElementById('signup-confirm').value;
if (!username || !email || !password || !confirm) {
showMsg('Please fill in all fields.', 'error');
return;
}
if (!/^[a-zA-Z0-9_\-]{3,32}$/.test(username)) {
showMsg('Username must be 3\u201332 characters: letters, numbers, _ or -.', 'error');
return;
}
if (password.length < 8) {
showMsg('Password must be at least 8 characters.', 'error');
return;
}
if (password !== confirm) {
showMsg('Passwords do not match.', 'error');
return;
}
if (!username || !email || !password || !confirm) {
showMsg('Please fill in all fields.', 'error');
return;
}
if (!/^[a-zA-Z0-9_\-]{3,32}$/.test(username)) {
showMsg(
'Username must be 3\u201332 characters: letters, numbers, _ or -.',
'error'
);
return;
}
if (password.length < 8) {
showMsg('Password must be at least 8 characters.', 'error');
return;
}
if (password !== confirm) {
showMsg('Passwords do not match.', 'error');
return;
}
submitBtn.disabled = true;
submitBtn.querySelector('.auth-form__submit-text').style.display = 'none';
submitBtn.querySelector('.auth-form__submit-loader').style.display = 'inline-flex';
submitBtn.disabled = true;
submitBtn.querySelector('.auth-form__submit-text').style.display = 'none';
submitBtn.querySelector('.auth-form__submit-loader').style.display = 'inline-flex';
fetch(BACKEND, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ action: 'signup', username: username, email: email, password: password })
})
.then(function (r) { return r.json(); })
.then(function (data) {
if (data.success) {
showMsg('Account created! Redirecting to login\u2026', 'success');
setTimeout(function () { window.location.href = '/login/'; }, 1500);
} else {
showMsg(data.message || 'Sign-up failed. Please try again.', 'error');
}
})
.catch(function () {
showMsg('Network error. Please try again.', 'error');
})
.finally(function () {
submitBtn.disabled = false;
submitBtn.querySelector('.auth-form__submit-text').style.display = '';
submitBtn.querySelector('.auth-form__submit-loader').style.display = 'none';
});
});
})();
fetch(BACKEND, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
action: 'signup',
username: username,
email: email,
password: password,
}),
})
.then(function (r) {
return r.json();
})
.then(function (data) {
if (data.success) {
showMsg('Account created! Redirecting to login\u2026', 'success');
setTimeout(function () {
window.location.href = '/login/';
}, 1500);
} else {
showMsg(data.message || 'Sign-up failed. Please try again.', 'error');
}
})
.catch(function () {
showMsg('Network error. Please try again.', 'error');
})
.finally(function () {
submitBtn.disabled = false;
submitBtn.querySelector('.auth-form__submit-text').style.display = '';
submitBtn.querySelector('.auth-form__submit-loader').style.display = 'none';
});
});
})();
</script>
{{ end }}

View File

@@ -13,43 +13,116 @@
<img src="/logo.png" alt="Freedoms4 logo" />
<h1>Freedoms4</h1>
<div class="brand__actions">
<button class="theme-toggle" id="theme-toggle" aria-label="Toggle theme" title="Toggle dark/light mode">
<svg class="theme-toggle__sun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"/></svg>
<svg class="theme-toggle__moon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"/></svg>
<button
class="theme-toggle"
id="theme-toggle"
aria-label="Toggle theme"
title="Toggle dark/light mode"
>
<svg
class="theme-toggle__sun"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path
d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-12.37l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41s-1.03-.39-1.41 0z"
/>
</svg>
<svg
class="theme-toggle__moon"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="16"
height="16"
fill="currentColor"
>
<path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z" />
</svg>
</button>
<!-- Desktop: account + subscribe -->
<div class="brand__auth brand__auth--desktop">
<input type="checkbox" id="auth-dropdown" class="brand__auth-check" />
<label class="brand__auth-toggle" for="auth-dropdown" tabindex="0" aria-label="Account options">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>
<label
class="brand__auth-toggle"
for="auth-dropdown"
tabindex="0"
aria-label="Account options"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
>
<path
d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"
/>
</svg>
</label>
<div class="brand__auth-links">
<a href="/login/" class="auth-link auth-link--login">Login</a>
<a href="/signup/" class="auth-link auth-link--signup">Sign Up</a>
</div>
</div>
{{- $rssURL := "/index.xml" -}}
{{- with .OutputFormats.Get "rss" -}}
{{- $rssURL = .RelPermalink -}}
{{- end -}}
<a href="{{ $rssURL }}" class="rss-subscribe__link rss-subscribe__link--desktop" title="Subscribe via RSS">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="10" height="10" fill="currentColor" aria-hidden="true">
<path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/>
{{- $rssURL := "/index.xml" -}} {{- with .OutputFormats.Get "rss" -}} {{-
$rssURL = .RelPermalink -}} {{- end -}}
<a
href="{{ $rssURL }}"
class="rss-subscribe__link rss-subscribe__link--desktop"
title="Subscribe via RSS"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="10"
height="10"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
<span>Subscribe</span>
</a>
<!-- Mobile: combined dropdown -->
<div class="brand__mobile-menu">
<input type="checkbox" id="mobile-menu-check" class="brand__mobile-check" />
<label class="brand__mobile-toggle" for="mobile-menu-check" aria-label="Menu">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>
<label
class="brand__mobile-toggle"
for="mobile-menu-check"
aria-label="Menu"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="18"
height="18"
fill="currentColor"
>
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
</svg>
</label>
<div class="brand__mobile-links">
<a href="/login/" class="mobile-link">Login</a>
<a href="/signup/" class="mobile-link">Sign Up</a>
<a href="{{ $rssURL }}" class="mobile-link mobile-link--subscribe">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor" aria-hidden="true"><path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"/></svg>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="12"
height="12"
fill="currentColor"
aria-hidden="true"
>
<path
d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19.01 7.38 20 6.18 20C4.98 20 4 19.01 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1z"
/>
</svg>
Subscribe
</a>
</div>

View File

@@ -1,120 +1,57 @@
{{ define "main" }}
{{ $subjectCode := .Title }}
{{/* Get semester from first post */}}
{{ $semester := "" }}
{{ range .Pages }}
{{ if eq $semester "" }}
{{ $raw := .Params.semester }}
{{ if reflect.IsSlice $raw }}
{{ $semester = index $raw 0 }}
{{ else }}
{{ $semester = $raw }}
{{ end }}
{{ end }}
{{ end }}
{{ define "main" }} {{ $subjectCode := .Title }} {{/* Get semester from first post */}} {{ $semester
:= "" }} {{ range .Pages }} {{ if eq $semester "" }} {{ $raw := .Params.semester }} {{ if
reflect.IsSlice $raw }} {{ $semester = index $raw 0 }} {{ else }} {{ $semester = $raw }} {{ end }}
{{ end }} {{ end }}
<nav class="uninotes-breadcrumbs breadcrumbs">
<a href="/uninotes/">UniNotes</a>
{{ if $semester }}
{{ $semPage := site.GetPage (printf "/semester/%s" ($semester | urlize)) }}
{{ if $semPage }}
<a href="{{ $semPage.RelPermalink }}">{{ $semester }}</a>
{{ end }}
{{ end }}
<span>{{ $subjectCode }}</span>
<a href="/uninotes/">UniNotes</a>
{{ if $semester }} {{ $semPage := site.GetPage (printf "/semester/%s" ($semester | urlize)) }}
{{ if $semPage }} <a href="{{ $semPage.RelPermalink }}">{{ $semester }}</a> {{ end }} {{ end
}} <span>{{ $subjectCode }}</span>
</nav>
<h1>{{ $subjectCode }}</h1>
{{/* Collect unique unit labels and sort numerically */}}
{{ $seenUnits := slice }}
{{ $unitDicts := slice }}
{{ range .Pages }}
{{ $unitLabel := (.Params.unit | default .Title) }}
{{ if not (in $seenUnits $unitLabel) }}
{{ $seenUnits = $seenUnits | append $unitLabel }}
{{/* Extract unit number for numeric sort, e.g. "Unit 11" → 11 */}}
{{ $uParts := split $unitLabel " " }}
{{ $uLast := index $uParts (sub (len $uParts) 1) }}
{{ $uNumStr := "" }}
{{ range (split $uLast "") }}
{{ if ge . "0" }}{{ if le . "9" }}{{ $uNumStr = printf "%s%s" $uNumStr . }}{{ end }}{{ end }}
{{ end }}
{{ $uNum := int ($uNumStr | default "0") }}
{{ $unitDicts = $unitDicts | append (dict "label" $unitLabel "page" . "num" $uNum) }}
{{ end }}
{{ end }}
{{ $sortedUnitDicts := sort $unitDicts "num" }}
{{/* Collect unique unit labels and sort numerically */}} {{ $seenUnits := slice }} {{ $unitDicts :=
slice }} {{ range .Pages }} {{ $unitLabel := (.Params.unit | default .Title) }} {{ if not (in
$seenUnits $unitLabel) }} {{ $seenUnits = $seenUnits | append $unitLabel }} {{/* Extract unit number
for numeric sort, e.g. "Unit 11" → 11 */}} {{ $uParts := split $unitLabel " " }} {{ $uLast := index
$uParts (sub (len $uParts) 1) }} {{ $uNumStr := "" }} {{ range (split $uLast "") }} {{ if ge . "0"
}}{{ if le . "9" }}{{ $uNumStr = printf "%s%s" $uNumStr . }}{{ end }}{{ end }} {{ end }} {{ $uNum :=
int ($uNumStr | default "0") }} {{ $unitDicts = $unitDicts | append (dict "label" $unitLabel "page"
. "num" $uNum) }} {{ end }} {{ end }} {{ $sortedUnitDicts := sort $unitDicts "num" }}
<ul class="uninotes-list uninotes-list--units">
{{ range $sortedUnitDicts }}
<li class="uninotes-list__item">
<a class="uninotes-list__link" href="{{ .page.Params.uniturl }}">
{{ .label }}
</a>
</li>
{{ end }}
{{ range $sortedUnitDicts }}
<li class="uninotes-list__item">
<a class="uninotes-list__link" href="{{ .page.Params.uniturl }}"> {{ .label }} </a>
</li>
{{ end }}
</ul>
{{/* Subject prev/next — siblings in same semester, sorted numerically by code number */}}
{{ if $semester }}
{{ $semPage := site.GetPage (printf "/semester/%s" ($semester | urlize)) }}
{{ if $semPage }}
{{/* Collect unique subject codes */}}
{{ $siblingCodes := slice }}
{{ range $semPage.Pages }}
{{ $raw := .Params.subjectcode }}
{{ $code := "" }}
{{ if reflect.IsSlice $raw }}
{{ $code = index $raw 0 }}
{{ else }}
{{ $code = $raw }}
{{ end }}
{{ if and $code (not (in $siblingCodes $code)) }}
{{ $siblingCodes = $siblingCodes | append $code }}
{{ end }}
{{ end }}
{{/* Sort subject codes numerically by extracting the number (e.g. "BO DCM1109" → 1109) */}}
{{ $codeDicts := slice }}
{{ range $siblingCodes }}
{{ $code := . }}
{{ $parts := split $code " " }}
{{ $lastPart := index $parts (sub (len $parts) 1) }}
{{ $numStr := "" }}
{{ range (split $lastPart "") }}
{{ if ge . "0" }}{{ if le . "9" }}{{ $numStr = printf "%s%s" $numStr . }}{{ end }}{{ end }}
{{ end }}
{{ $num := int ($numStr | default "0") }}
{{ $codeDicts = $codeDicts | append (dict "code" $code "num" $num) }}
{{ end }}
{{ $sortedCodeDicts := sort $codeDicts "num" }}
{{ if gt (len $sortedCodeDicts) 1 }}
{{ $currentIdx := 0 }}
{{ range $i, $d := $sortedCodeDicts }}
{{ if eq $d.code $subjectCode }}{{ $currentIdx = $i }}{{ end }}
{{ end }}
<nav class="page-nav">
{{ if gt $currentIdx 0 }}
{{ $prevCode := (index $sortedCodeDicts (sub $currentIdx 1)).code }}
{{ $prevPage := site.GetPage (printf "/subjectcode/%s" ($prevCode | urlize)) }}
{{ if $prevPage }}
<a class="page-nav__previous-link" href="{{ $prevPage.RelPermalink }}">← {{ $prevCode }}</a>
{{ end }}
{{ end }}
{{ if lt $currentIdx (sub (len $sortedCodeDicts) 1) }}
{{ $nextCode := (index $sortedCodeDicts (add $currentIdx 1)).code }}
{{ $nextPage := site.GetPage (printf "/subjectcode/%s" ($nextCode | urlize)) }}
{{ if $nextPage }}
<a class="page-nav__next-link" href="{{ $nextPage.RelPermalink }}">{{ $nextCode }} →</a>
{{ end }}
{{ end }}
</nav>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{/* Subject prev/next — siblings in same semester, sorted numerically by code number */}} {{ if
$semester }} {{ $semPage := site.GetPage (printf "/semester/%s" ($semester | urlize)) }} {{ if
$semPage }} {{/* Collect unique subject codes */}} {{ $siblingCodes := slice }} {{ range
$semPage.Pages }} {{ $raw := .Params.subjectcode }} {{ $code := "" }} {{ if reflect.IsSlice $raw }}
{{ $code = index $raw 0 }} {{ else }} {{ $code = $raw }} {{ end }} {{ if and $code (not (in
$siblingCodes $code)) }} {{ $siblingCodes = $siblingCodes | append $code }} {{ end }} {{ end }} {{/*
Sort subject codes numerically by extracting the number (e.g. "BO DCM1109" → 1109) */}} {{
$codeDicts := slice }} {{ range $siblingCodes }} {{ $code := . }} {{ $parts := split $code " " }} {{
$lastPart := index $parts (sub (len $parts) 1) }} {{ $numStr := "" }} {{ range (split $lastPart "")
}} {{ if ge . "0" }}{{ if le . "9" }}{{ $numStr = printf "%s%s" $numStr . }}{{ end }}{{ end }} {{
end }} {{ $num := int ($numStr | default "0") }} {{ $codeDicts = $codeDicts | append (dict "code"
$code "num" $num) }} {{ end }} {{ $sortedCodeDicts := sort $codeDicts "num" }} {{ if gt (len
$sortedCodeDicts) 1 }} {{ $currentIdx := 0 }} {{ range $i, $d := $sortedCodeDicts }} {{ if eq
$d.code $subjectCode }}{{ $currentIdx = $i }}{{ end }} {{ end }}
<nav class="page-nav">
{{ if gt $currentIdx 0 }} {{ $prevCode := (index $sortedCodeDicts (sub $currentIdx 1)).code }}
{{ $prevPage := site.GetPage (printf "/subjectcode/%s" ($prevCode | urlize)) }} {{ if $prevPage
}}
<a class="page-nav__previous-link" href="{{ $prevPage.RelPermalink }}">← {{ $prevCode }}</a>
{{ end }} {{ end }} {{ if lt $currentIdx (sub (len $sortedCodeDicts) 1) }} {{ $nextCode :=
(index $sortedCodeDicts (add $currentIdx 1)).code }} {{ $nextPage := site.GetPage (printf
"/subjectcode/%s" ($nextCode | urlize)) }} {{ if $nextPage }}
<a class="page-nav__next-link" href="{{ $nextPage.RelPermalink }}">{{ $nextCode }} →</a>
{{ end }} {{ end }}
</nav>
{{ end }} {{ end }} {{ end }} {{ end }}

View File

@@ -1,20 +1,23 @@
{{ define "main" }}
<nav class="uninotes-breadcrumbs breadcrumbs">
<a href="/blog/">Blog</a>
<span>Categories</span>
<a href="/blog/">Blog</a>
<span>Categories</span>
</nav>
<h1><a href="/blog/" style="text-decoration: none; color: var(--accent-color);">All Posts</a> | Categories</h1>
<h1>
<a href="/blog/" style="text-decoration: none; color: var(--accent-color)">All Posts</a> |
Categories
</h1>
<section class="term-list">
{{ range .Data.Terms.Alphabetical }}
<h2 class="term-list__item">
<a class="term-list__link" href="{{ .Page.RelPermalink }}">
{{ .Page.Title }} ({{ .Count }})
</a>
</h2>
{{ end }}
{{ range .Data.Terms.Alphabetical }}
<h2 class="term-list__item">
<a class="term-list__link" href="{{ .Page.RelPermalink }}">
{{ .Page.Title }} ({{ .Count }})
</a>
</h2>
{{ end }}
</section>
{{ end }}

View File

@@ -1,99 +1,52 @@
{{ define "main" }}
{{ $semesterRaw := .Params.semester }}
{{ $subjectcodeRaw := .Params.subjectcode }}
{{ $semester := "" }}
{{ if reflect.IsSlice $semesterRaw }}
{{ $semester = index $semesterRaw 0 }}
{{ else }}
{{ $semester = $semesterRaw }}
{{ end }}
{{ $subjectcode := "" }}
{{ if reflect.IsSlice $subjectcodeRaw }}
{{ $subjectcode = index $subjectcodeRaw 0 }}
{{ else }}
{{ $subjectcode = $subjectcodeRaw }}
{{ end }}
{{ define "main" }} {{ $semesterRaw := .Params.semester }} {{ $subjectcodeRaw := .Params.subjectcode
}} {{ $semester := "" }} {{ if reflect.IsSlice $semesterRaw }} {{ $semester = index $semesterRaw 0
}} {{ else }} {{ $semester = $semesterRaw }} {{ end }} {{ $subjectcode := "" }} {{ if
reflect.IsSlice $subjectcodeRaw }} {{ $subjectcode = index $subjectcodeRaw 0 }} {{ else }} {{
$subjectcode = $subjectcodeRaw }} {{ end }}
<nav class="uninotes-breadcrumbs breadcrumbs">
<a href="/uninotes/">UniNotes</a>
{{ if $semester }}
{{ $semPage := site.GetPage (printf "/semester/%s" ($semester | urlize)) }}
{{ if $semPage }}
<a href="{{ $semPage.RelPermalink }}">{{ $semester }}</a>
{{ end }}
{{ end }}
{{ if $subjectcode }}
{{ $subPage := site.GetPage (printf "/subjectcode/%s" ($subjectcode | urlize)) }}
{{ if $subPage }}
<a href="{{ $subPage.RelPermalink }}">{{ $subjectcode }}</a>
{{ end }}
{{ end }}
<a href="{{ .Params.uniturl }}">{{ .Params.unit | default .Title }}</a>
<span>{{ .Params.notecategory | default "Notes" }}</span>
<a href="/uninotes/">UniNotes</a>
{{ if $semester }} {{ $semPage := site.GetPage (printf "/semester/%s" ($semester | urlize)) }}
{{ if $semPage }} <a href="{{ $semPage.RelPermalink }}">{{ $semester }}</a> {{ end }} {{ end
}} {{ if $subjectcode }} {{ $subPage := site.GetPage (printf "/subjectcode/%s" ($subjectcode |
urlize)) }} {{ if $subPage }} <a href="{{ $subPage.RelPermalink }}">{{ $subjectcode }}</a> {{
end }} {{ end }} <a href="{{ .Params.uniturl }}">{{ .Params.unit | default .Title }}</a>
<span>{{ .Params.notecategory | default "Notes" }}</span>
</nav>
<div class="uninotes-meta">
{{ with $semester }}<span class="uninotes-meta__pill">{{ . }}</span>{{ end }}
{{ with $subjectcode }}<span class="uninotes-meta__pill">{{ . }}</span>{{ end }}
{{ with .Params.notecategory }}
<span class="uninotes-meta__pill uninotes-meta__pill--{{ . | lower }}">{{ . }}</span>
{{ end }}
{{ with $semester }}<span class="uninotes-meta__pill">{{ . }}</span>{{ end }} {{ with
$subjectcode }}<span class="uninotes-meta__pill">{{ . }}</span>{{ end }} {{ with
.Params.notecategory }}
<span class="uninotes-meta__pill uninotes-meta__pill--{{ . | lower }}">{{ . }}</span>
{{ end }}
</div>
<h1>{{ .Params.unit | default .Title }}</h1>
{{ partial "page/toc.html" . }}
{{ .Content }}
{{ partial "page/terms.html" (dict "taxonomy" "tags" "page" .) }}
{{ partial "page/terms.html" (dict "taxonomy" "categories" "page" .) }}
{{/* Next/prev among sibling UNITS in the same subjectcode — sorted numerically */}}
{{ if $subjectcode }}
{{ $subPage := site.GetPage (printf "/subjectcode/%s" ($subjectcode | urlize)) }}
{{ if $subPage }}
{{/* Build deduplicated unit list with numeric sort key */}}
{{ $seenUnits := slice }}
{{ $unitDicts := slice }}
{{ range $subPage.Pages }}
{{ $unitLabel := (.Params.unit | default .Title) }}
{{ if not (in $seenUnits $unitLabel) }}
{{ $seenUnits = $seenUnits | append $unitLabel }}
{{/* Extract unit number for numeric sort, e.g. "Unit 11" → 11 */}}
{{ $uParts := split $unitLabel " " }}
{{ $uLast := index $uParts (sub (len $uParts) 1) }}
{{ $uNumStr := "" }}
{{ range (split $uLast "") }}
{{ if ge . "0" }}{{ if le . "9" }}{{ $uNumStr = printf "%s%s" $uNumStr . }}{{ end }}{{ end }}
{{ end }}
{{ $uNum := int ($uNumStr | default "0") }}
{{ $unitDicts = $unitDicts | append (dict "label" $unitLabel "page" . "num" $uNum) }}
{{ end }}
{{ end }}
{{ $sortedUnitDicts := sort $unitDicts "num" }}
{{ $currentUnit := (.Params.unit | default .Title) }}
{{ $currentIdx := 0 }}
{{ range $i, $d := $sortedUnitDicts }}
{{ if eq $d.label $currentUnit }}{{ $currentIdx = $i }}{{ end }}
{{ end }}
{{ if gt (len $sortedUnitDicts) 1 }}
<nav class="page-nav">
{{ if gt $currentIdx 0 }}
{{ $prev := (index $sortedUnitDicts (sub $currentIdx 1)) }}
<a class="page-nav__previous-link" href="{{ $prev.page.Params.uniturl }}">← {{ $prev.label }}</a>
{{ end }}
{{ if lt $currentIdx (sub (len $sortedUnitDicts) 1) }}
{{ $next := (index $sortedUnitDicts (add $currentIdx 1)) }}
<a class="page-nav__next-link" href="{{ $next.page.Params.uniturl }}">{{ $next.label }} →</a>
{{ end }}
</nav>
{{ end }}
{{ end }}
{{ end }}
{{ partial "page/page-end.html" . }}
{{ end }}
{{ partial "page/toc.html" . }} {{ .Content }} {{ partial "page/terms.html" (dict "taxonomy" "tags"
"page" .) }} {{ partial "page/terms.html" (dict "taxonomy" "categories" "page" .) }} {{/* Next/prev
among sibling UNITS in the same subjectcode — sorted numerically */}} {{ if $subjectcode }} {{
$subPage := site.GetPage (printf "/subjectcode/%s" ($subjectcode | urlize)) }} {{ if $subPage }}
{{/* Build deduplicated unit list with numeric sort key */}} {{ $seenUnits := slice }} {{ $unitDicts
:= slice }} {{ range $subPage.Pages }} {{ $unitLabel := (.Params.unit | default .Title) }} {{ if not
(in $seenUnits $unitLabel) }} {{ $seenUnits = $seenUnits | append $unitLabel }} {{/* Extract unit
number for numeric sort, e.g. "Unit 11" → 11 */}} {{ $uParts := split $unitLabel " " }} {{ $uLast :=
index $uParts (sub (len $uParts) 1) }} {{ $uNumStr := "" }} {{ range (split $uLast "") }} {{ if ge .
"0" }}{{ if le . "9" }}{{ $uNumStr = printf "%s%s" $uNumStr . }}{{ end }}{{ end }} {{ end }} {{
$uNum := int ($uNumStr | default "0") }} {{ $unitDicts = $unitDicts | append (dict "label"
$unitLabel "page" . "num" $uNum) }} {{ end }} {{ end }} {{ $sortedUnitDicts := sort $unitDicts "num"
}} {{ $currentUnit := (.Params.unit | default .Title) }} {{ $currentIdx := 0 }} {{ range $i, $d :=
$sortedUnitDicts }} {{ if eq $d.label $currentUnit }}{{ $currentIdx = $i }}{{ end }} {{ end }} {{ if
gt (len $sortedUnitDicts) 1 }}
<nav class="page-nav">
{{ if gt $currentIdx 0 }} {{ $prev := (index $sortedUnitDicts (sub $currentIdx 1)) }}
<a class="page-nav__previous-link" href="{{ $prev.page.Params.uniturl }}"
>← {{ $prev.label }}</a
>
{{ end }} {{ if lt $currentIdx (sub (len $sortedUnitDicts) 1) }} {{ $next := (index
$sortedUnitDicts (add $currentIdx 1)) }}
<a class="page-nav__next-link" href="{{ $next.page.Params.uniturl }}">{{ $next.label }} →</a>
{{ end }}
</nav>
{{ end }} {{ end }} {{ end }} {{ partial "page/page-end.html" . }} {{ end }}

View File

@@ -1,4 +1,5 @@
{{ define "main" }}
{{/* Get semester and subjectcode from child pages since _index.md doesn't carry taxonomy params */}}
{{ $semester := "" }}
{{ $subjectcode := "" }}
@@ -12,6 +13,7 @@
{{ $subjectcode = cond (reflect.IsSlice $raw) (index $raw 0) $raw }}
{{ end }}
{{ end }}
<nav class="uninotes-breadcrumbs breadcrumbs">
<a href="/uninotes/">UniNotes</a>
{{ if $semester }}
@@ -28,36 +30,32 @@
{{ end }}
<span>{{ .Params.unit | default .Title }}</span>
</nav>
<div class="uninotes-meta">
{{ with $semester }}<span class="uninotes-meta__pill">{{ . }}</span>{{ end }}
{{ with $subjectcode }}<span class="uninotes-meta__pill">{{ . }}</span>{{ end }}
</div>
<h1>{{ .Params.unit | default .Title }}</h1>
<p class="unit-choice__subtitle">Choose type:</p>
{{/* Check if self/live pages exist */}}
{{ $hasSelf := false }}
{{/* Check if a live page exists at the expected URL */}}
{{ $hasLive := false }}
{{ range .Pages }}
{{ if eq (lower .Params.notecategory) "self" }}{{ $hasSelf = true }}{{ end }}
{{ if eq (lower .Params.notecategory) "live" }}{{ $hasLive = true }}{{ end }}
{{ end }}
<div class="unit-choice__options">
{{ if $hasSelf }}
<a class="unit-choice__card unit-choice__card--self" href="{{ .RelPermalink }}self/">
{{ else }}
<div class="unit-choice__card unit-choice__card--self unit-choice__card--unavailable">
{{ end }}
<div class="unit-choice__icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="32" height="32" fill="currentColor">
<path d="M12 3L1 9l4 2.18v6L12 21l7-3.82v-6l2-1.09V17h2V9L12 3zm6.82 6L12 12.72 5.18 9 12 5.28 18.82 9zM17 15.99l-5 2.73-5-2.73v-3.72L12 15l5-2.73v3.72z"/>
</svg>
</div>
<div class="unit-choice__label">Self</div>
<div class="unit-choice__desc">
{{ if $hasSelf }}Self-study notes
{{ else }}Not available{{ end }}
</div>
{{ if $hasSelf }}</a>{{ else }}</div>{{ end }}
<div class="unit-choice__desc">Self-study notes</div>
</a>
{{ if $hasLive }}
<a class="unit-choice__card unit-choice__card--live" href="{{ .RelPermalink }}live/">
@@ -76,4 +74,5 @@
</div>
{{ if $hasLive }}</a>{{ else }}</div>{{ end }}
</div>
{{ end }}