server-side-rendering by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill server-side-rendering使用现代模板引擎、视图层和数据驱动的 HTML 生成技术构建服务端渲染应用程序,支持缓存、流式处理和性能优化,适用于 Python、Node.js 和 Ruby 框架。
最小工作示例:
# app.py
from flask import Flask, render_template, request, jsonify
from datetime import datetime
app = Flask(__name__)
# Custom Jinja2 filters
@app.template_filter('currency')
def format_currency(value):
return f"${value:.2f}"
@app.template_filter('date_format')
def format_date(date_obj):
return date_obj.strftime('%Y-%m-%d %H:%M:%S')
@app.context_processor
def inject_globals():
"""向模板注入全局变量"""
return {
'app_name': 'My App',
'current_year': datetime.now().year,
'support_email': 'support@example.com'
}
# routes.py
// ... (完整实现请参阅参考指南)
references/ 目录下的详细实现:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 指南 | 内容 |
|---|---|
| Flask with Jinja2 Templates | Flask 与 Jinja2 模板 |
| Jinja2 Template Examples | Jinja2 模板示例 |
| Node.js/Express with EJS Templates | Node.js/Express 与 EJS 模板 |
| EJS Template Examples | EJS 模板示例 |
| Caching and Performance | 缓存与性能 |
| Django Template Examples | Django 模板示例 |
| Django Templates | Django 模板 |
每周安装量
103
代码仓库
GitHub 星标数
116
首次出现
2026年1月21日
安全审计
安装于
opencode87
gemini-cli85
codex83
cursor78
claude-code78
github-copilot71
Build server-side rendered applications using modern template engines, view layers, and data-driven HTML generation with caching, streaming, and performance optimization across Python, Node.js, and Ruby frameworks.
Minimal working example:
# app.py
from flask import Flask, render_template, request, jsonify
from datetime import datetime
app = Flask(__name__)
# Custom Jinja2 filters
@app.template_filter('currency')
def format_currency(value):
return f"${value:.2f}"
@app.template_filter('date_format')
def format_date(date_obj):
return date_obj.strftime('%Y-%m-%d %H:%M:%S')
@app.context_processor
def inject_globals():
"""Inject global variables into templates"""
return {
'app_name': 'My App',
'current_year': datetime.now().year,
'support_email': 'support@example.com'
}
# routes.py
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Flask with Jinja2 Templates | Flask with Jinja2 Templates |
| Jinja2 Template Examples | Jinja2 Template Examples |
| Node.js/Express with EJS Templates | Node.js/Express with EJS Templates |
| EJS Template Examples | EJS Template Examples |
| Caching and Performance | Caching and Performance |
| Django Template Examples | Django Template Examples |
| Django Templates |
Weekly Installs
103
Repository
GitHub Stars
116
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode87
gemini-cli85
codex83
cursor78
claude-code78
github-copilot71
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
120,000 周安装
| Django Templates |