mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-02-20 06:18:57 +00:00
new examples
This commit is contained in:
10
node/eleventy/.dockerignore
Normal file
10
node/eleventy/.dockerignore
Normal 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
2
node/eleventy/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
_site/
|
||||
14
node/eleventy/README.md
Normal file
14
node/eleventy/README.md
Normal 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.
|
||||
15
node/eleventy/eleventy.config.js
Normal file
15
node/eleventy/eleventy.config.js
Normal 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"
|
||||
}
|
||||
};
|
||||
};
|
||||
12
node/eleventy/package.json
Normal file
12
node/eleventy/package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
14
node/eleventy/src/_includes/base.njk
Normal file
14
node/eleventy/src/_includes/base.njk
Normal 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>
|
||||
15
node/eleventy/src/index.md
Normal file
15
node/eleventy/src/index.md
Normal 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!
|
||||
Reference in New Issue
Block a user