new examples

This commit is contained in:
Andras Bacsai
2025-12-26 11:40:00 +01:00
parent 35e4d33085
commit d3a2a9d83b
1164 changed files with 101362 additions and 160055 deletions

View File

@@ -0,0 +1,10 @@
node_modules/
.git/
.gitignore
.env
.env.local
*.md
.DS_Store
*.log
npm-debug.log*
_site/

2
node/eleventy/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
node_modules/
_site/

14
node/eleventy/README.md Normal file
View File

@@ -0,0 +1,14 @@
# Eleventy (11ty)
Eleventy static site generator example.
## Getting Started
```bash
npm install
npm run dev # development server
npm run build # build to '_site' directory
npm start # serve static files
```
Eleventy is a static site generator only - no SSR mode.

View File

@@ -0,0 +1,15 @@
module.exports = function(eleventyConfig) {
// Build-time public var (baked into bundle)
const buildPublicVar = process.env.BUILD_PUBLIC_VAR || 'default-value';
console.log('=== Build-time Variables ===');
console.log('BUILD_PUBLIC_VAR:', buildPublicVar);
eleventyConfig.addGlobalData('buildPublicVar', buildPublicVar);
return {
dir: {
input: "src",
output: "_site"
}
};
};

View File

@@ -0,0 +1,12 @@
{
"name": "eleventy",
"version": "1.0.0",
"scripts": {
"dev": "eleventy --serve",
"build": "eleventy",
"start": "npx serve@latest _site"
},
"devDependencies": {
"@11ty/eleventy": "^3.0.0"
}
}

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }}</title>
</head>
<body>
{{ content | safe }}
<script>
console.log('TEST_ENV_VAR:', '{{ testEnvVar }}');
</script>
</body>
</html>

View File

@@ -0,0 +1,15 @@
---
layout: base.njk
title: Home
---
<div style="padding: 20px; background: #f0f0f0; margin: 20px; border-radius: 8px;">
<h2>Environment Variable Test</h2>
<h3>Build-time (baked into bundle)</h3>
<p><strong>BUILD_PUBLIC_VAR:</strong> {{ buildPublicVar }}</p>
<p style="color: #666; font-size: 14px;">
Note: Static sites only support build-time env vars (no server at runtime)
</p>
</div>
# Hello from Eleventy!