mirror of
https://github.com/litruv/lit.ruv.wtf.git
synced 2026-07-24 02:36:02 +10:00
update build
This commit is contained in:
33
.github/workflows/build-site.yml
vendored
33
.github/workflows/build-site.yml
vendored
@@ -1,33 +0,0 @@
|
|||||||
name: Build Site
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.actor != 'github-actions[bot]' && github.ref == 'refs/heads/main'
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20'
|
|
||||||
|
|
||||||
- name: Build site
|
|
||||||
run: node build.js
|
|
||||||
|
|
||||||
- name: Commit and push changes
|
|
||||||
run: |
|
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config --local user.name "github-actions[bot]"
|
|
||||||
# Add all HTML files in the website directory
|
|
||||||
git add -- 'website/*.html'
|
|
||||||
# Only commit if there are staged changes
|
|
||||||
git diff --staged --quiet || git commit -m "Automated build: Update generated site files"
|
|
||||||
git push
|
|
||||||
44
build.js
44
build.js
@@ -13,16 +13,53 @@ function extractBlock(content, startDelimiter, endDelimiter) {
|
|||||||
return { blockContent: block, remainingContent: remaining.trim() };
|
return { blockContent: block, remainingContent: remaining.trim() };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Helper function to copy files recursively
|
||||||
|
async function copyWebsiteFiles() {
|
||||||
|
const websiteDir = path.join(__dirname, 'website');
|
||||||
|
const buildDir = path.join(__dirname, 'build');
|
||||||
|
|
||||||
|
try {
|
||||||
|
const websiteExists = await fs.access(websiteDir).then(() => true).catch(() => false);
|
||||||
|
if (!websiteExists) {
|
||||||
|
console.log("No website directory found, skipping copy.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function copyRecursive(src, dest) {
|
||||||
|
const stats = await fs.stat(src);
|
||||||
|
|
||||||
|
if (stats.isDirectory()) {
|
||||||
|
await fs.mkdir(dest, { recursive: true });
|
||||||
|
const items = await fs.readdir(src);
|
||||||
|
|
||||||
|
for (const item of items) {
|
||||||
|
const srcPath = path.join(src, item);
|
||||||
|
const destPath = path.join(dest, item);
|
||||||
|
await copyRecursive(srcPath, destPath);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
await fs.copyFile(src, dest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await copyRecursive(websiteDir, buildDir);
|
||||||
|
console.log("Website files copied successfully.");
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error copying website files:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function buildPage(pageName, outputName) {
|
async function buildPage(pageName, outputName) {
|
||||||
const layoutPath = path.join(__dirname, 'templates', '_layout.html');
|
const layoutPath = path.join(__dirname, 'templates', '_layout.html');
|
||||||
const commonHeaderPath = path.join(__dirname, 'templates', '_header.html');
|
const commonHeaderPath = path.join(__dirname, 'templates', '_header.html');
|
||||||
const commonFooterPath = path.join(__dirname, 'templates', '_footer.html');
|
const commonFooterPath = path.join(__dirname, 'templates', '_footer.html');
|
||||||
const contentPath = path.join(__dirname, 'src', `${pageName}.html`);
|
const contentPath = path.join(__dirname, 'src', `${pageName}.html`);
|
||||||
const outputDir = path.join(__dirname, 'website');
|
const outputDir = path.join(__dirname, 'build');
|
||||||
const outputPath = path.join(outputDir, `${outputName}.html`);
|
const outputPath = path.join(outputDir, `${outputName}.html`);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Ensure the website directory exists
|
// Ensure the build directory exists
|
||||||
await fs.mkdir(outputDir, { recursive: true });
|
await fs.mkdir(outputDir, { recursive: true });
|
||||||
|
|
||||||
let layoutContent = await fs.readFile(layoutPath, 'utf-8');
|
let layoutContent = await fs.readFile(layoutPath, 'utf-8');
|
||||||
@@ -110,6 +147,9 @@ async function buildPage(pageName, outputName) {
|
|||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
try {
|
try {
|
||||||
|
// Copy website files first
|
||||||
|
await copyWebsiteFiles();
|
||||||
|
|
||||||
const srcDir = path.join(__dirname, 'src');
|
const srcDir = path.join(__dirname, 'src');
|
||||||
const files = await fs.readdir(srcDir);
|
const files = await fs.readdir(srcDir);
|
||||||
|
|
||||||
|
|||||||
@@ -1,87 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
||||||
|
|
||||||
<meta name="description" content="Litruv - Dev/Tech Artist at MatesMedia. Follow for coding, game development, and creative projects.">
|
|
||||||
<meta name="author" content="Litruv">
|
|
||||||
|
|
||||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; connect-src https://public.api.bsky.app;">
|
|
||||||
|
|
||||||
<meta property="og:title" content="Litruv - Dev/Tech Artist">
|
|
||||||
<meta property="og:description" content="Dev/Tech Artist at MatesMedia. Follow for coding, game development, and creative projects.">
|
|
||||||
<meta property="og:image" content="https://lit.ruv.wtf/banner.webp"> <!-- Common image -->
|
|
||||||
<meta property="og:url" content="https://lit.ruv.wtf">
|
|
||||||
<meta property="og:type" content="website">
|
|
||||||
<meta property="og:site_name" content="Lit.ruv.wtf" /> <!-- Common site name -->
|
|
||||||
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
<meta name="twitter:title" content="Litruv - Dev/Tech Artist">
|
|
||||||
<meta name="twitter:description" content="Dev/Tech Artist at MatesMedia. Follow for coding, game development, and creative projects.">
|
|
||||||
<meta name="twitter:image" content="https://lit.ruv.wtf/banner.webp"> <!-- Common image -->
|
|
||||||
<meta name="twitter:url" content="https://lit.ruv.wtf">
|
|
||||||
|
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="/icons/16.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/icons/32.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="48x48" href="/icons/48.png">
|
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/icons/180.png">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="style.css">
|
|
||||||
|
|
||||||
|
|
||||||
<script src="main.js" defer></script> <!-- Common main script -->
|
|
||||||
<script src="dynamic-rotation.js" defer></script> <!-- Common main script -->
|
|
||||||
<script src="tape.js" defer></script>
|
|
||||||
|
|
||||||
|
|
||||||
<title>Litruv - Dev/Tech Artist</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="bg-pattern"></div>
|
|
||||||
<div class="container">
|
|
||||||
<img src="avatar.webp" alt="Avatar" class="avatar-img" width="250" height="250">
|
|
||||||
<header>
|
|
||||||
<h1>Litruv</h1>
|
|
||||||
<div class="subtext">Dev/Tech Artist @<a href="https://mates.dev/">MatesMedia</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="social-links">
|
|
||||||
<a href="https://github.com/Litruv" target="_blank" title="GitHub - Litruv">
|
|
||||||
<i class="fab fa-github"></i>
|
|
||||||
</a>
|
|
||||||
<a href="https://www.youtube.com/c/Litruv" target="_blank" title="YouTube - Litruv">
|
|
||||||
<i class="fab fa-youtube"></i>
|
|
||||||
</a>
|
|
||||||
<a href="https://steamcommunity.com/id/Litruv" target="_blank" title="Steam - Litruv">
|
|
||||||
<i class="fab fa-steam"></i>
|
|
||||||
</a>
|
|
||||||
<a href="https://discordapp.com/users/220772082055774210" target="_blank" title="Discord - @Litruv">
|
|
||||||
<i class="fab fa-discord"></i>
|
|
||||||
</a>
|
|
||||||
<a href="https://bsky.app/profile/lit.mates.dev" target="_blank" title="Bluesky - lit.mates.dev">
|
|
||||||
<i class="fa-brands fa-bluesky"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="project-links">
|
|
||||||
<a href="https://mates.dev" target="_blank">MatesMedia</a>
|
|
||||||
<a href="https://lit.ruv.wtf/materials/" target="_blank">UE Material Snippets</a>
|
|
||||||
<a href="https://lit.ruv.wtf/docs/" target="_blank">Documentation</a>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div id="posts"></div>
|
|
||||||
<footer>
|
|
||||||
<a href="privacy.html">Privacy Policy</a>
|
|
||||||
<p>© 2013-<span id="current-year"></span> Max Litruv Boonzaayer</p>
|
|
||||||
<script>
|
|
||||||
document.getElementById('current-year').textContent = new Date().getFullYear();
|
|
||||||
</script>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
||||||
|
|
||||||
<meta name="description" content="Privacy Policy for Litruv's website and applications.">
|
|
||||||
<meta name="author" content="Litruv">
|
|
||||||
|
|
||||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';">
|
|
||||||
|
|
||||||
<meta property="og:title" content="Privacy Policy - Litruv">
|
|
||||||
<meta property="og:description" content="Privacy Policy for Litruv's website and applications.">
|
|
||||||
<meta property="og:image" content="https://lit.ruv.wtf/banner.webp"> <!-- Common image -->
|
|
||||||
<meta property="og:url" content="https://lit.ruv.wtf/privacy.html">
|
|
||||||
<meta property="og:type" content="website">
|
|
||||||
<meta property="og:site_name" content="Lit.ruv.wtf" /> <!-- Common site name -->
|
|
||||||
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
<meta name="twitter:title" content="Privacy Policy - Litruv">
|
|
||||||
<meta name="twitter:description" content="Privacy Policy for Litruv's website and applications.">
|
|
||||||
<meta name="twitter:image" content="https://lit.ruv.wtf/banner.webp"> <!-- Common image -->
|
|
||||||
<meta name="twitter:url" content="https://lit.ruv.wtf/privacy.html">
|
|
||||||
|
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="/icons/16.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/icons/32.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="48x48" href="/icons/48.png">
|
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/icons/180.png">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="style.css">
|
|
||||||
<style>
|
|
||||||
.privacy-content {
|
|
||||||
background: white;
|
|
||||||
padding: 1.5rem 2rem;
|
|
||||||
margin-top: 2rem;
|
|
||||||
border: 2px solid #000;
|
|
||||||
box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.1), 6px 6px 0 rgba(0, 0, 0, 0.05);
|
|
||||||
color: #333;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
.privacy-content h1 {
|
|
||||||
text-align: center;
|
|
||||||
font-size: 1.8rem;
|
|
||||||
color: #242424;
|
|
||||||
text-shadow: 1px 1px 0 #ffffff52, 2px 2px 0 #00000080;
|
|
||||||
margin-bottom: 1.5rem;
|
|
||||||
}
|
|
||||||
.privacy-content h2 {
|
|
||||||
font-size: 1.3rem;
|
|
||||||
color: #242424;
|
|
||||||
margin-top: 1.5rem;
|
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
}
|
|
||||||
.privacy-content p {
|
|
||||||
line-height: 1.6;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
.privacy-content a {
|
|
||||||
color: #2563eb;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
.privacy-content a:hover {
|
|
||||||
color: #1d4ed8;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script src="main.js" defer></script> <!-- Common main script -->
|
|
||||||
<script src="dynamic-rotation.js" defer></script> <!-- Common main script -->
|
|
||||||
<script src="tape.js" defer></script>
|
|
||||||
|
|
||||||
|
|
||||||
<title>Privacy Policy - Litruv</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="bg-pattern"></div>
|
|
||||||
<div class="container">
|
|
||||||
|
|
||||||
<!-- Main page content for privacy.html -->
|
|
||||||
<img src="avatar.webp" alt="Avatar" class="avatar-img" width="250" height="250">
|
|
||||||
<header>
|
|
||||||
<h1><a href="/">Litruv</a></h1>
|
|
||||||
<div class="subtext">Privacy Policy</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="privacy-content">
|
|
||||||
<h1>Privacy Policy</h1>
|
|
||||||
|
|
||||||
<p>I respect your privacy.</p>
|
|
||||||
|
|
||||||
<h2>Apps</h2>
|
|
||||||
<p>My apps do not collect, store, or share any personal information. No analytics, no tracking, no funny business.</p>
|
|
||||||
|
|
||||||
<h2>Website</h2>
|
|
||||||
<p>This site may collect anonymous usage data (such as page views or general browser information) to help improve functionality and performance. This data is non-personal and cannot be used to identify you. I do not sell or share this data with third parties.</p>
|
|
||||||
<p>Additionally, this site uses Cloudflare for performance and security. Cloudflare may collect its own analytics and statistical data, subject to their <a href="https://www.cloudflare.com/privacypolicy/" target="_blank" rel="noopener noreferrer">privacy policy</a>.</p>
|
|
||||||
|
|
||||||
<p>By using this site, you agree to this policy.</p>
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<a href="privacy.html">Privacy Policy</a>
|
|
||||||
<p>© 2013-<span id="current-year"></span> Max Litruv Boonzaayer</p>
|
|
||||||
<script>
|
|
||||||
document.getElementById('current-year').textContent = new Date().getFullYear();
|
|
||||||
</script>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
function getRandomRotation() {
|
|
||||||
return (Math.random() * 3) - 1.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
|
||||||
const privacyBox = document.querySelector('.privacy-content');
|
|
||||||
if (privacyBox) {
|
|
||||||
privacyBox.style.transform = `rotate(${getRandomRotation()}deg)`;
|
|
||||||
}
|
|
||||||
// Ensure avatar also gets random rotation if desired for this page
|
|
||||||
const avatarImg = document.querySelector('.avatar-img');
|
|
||||||
if (avatarImg) {
|
|
||||||
// You might want a different rotation range or logic here
|
|
||||||
// For consistency with how posts might be styled if they were on this page:
|
|
||||||
// avatarImg.style.transform = `rotate(${(Math.random() * 6) - 3}deg)`;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Reference in New Issue
Block a user