go-twig/examples/compiled_templates/templates/user_profile.twig
semihalev f9b283c393 Add template compilation capabilities
- Implement a compiled template format using gob encoding
- Add methods to compile templates and load from compiled templates
- Create dedicated CompiledLoader for managing compiled templates
- Enable auto-reload support for compiled templates
- Add comprehensive tests including benchmarks
- Create example application for template compilation workflow
- Update documentation with compilation features and examples

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-10 09:21:20 +03:00

40 lines
No EOL
1.2 KiB
Twig

<!DOCTYPE html>
<html>
<head>
<title>User Profile</title>
</head>
<body>
<div class="profile">
<h1>User Profile</h1>
{% if user is defined %}
<div class="user-info">
<p><strong>Username:</strong> {{ user.username }}</p>
<p><strong>Email:</strong> {{ user.email }}</p>
{% if user.username starts with "admin" %}
<div class="admin-badge">Administrator</div>
{% endif %}
</div>
{% else %}
<div class="not-logged-in">
<p>You are not logged in. Please <a href="/login">login</a> to view your profile.</p>
</div>
{% endif %}
<div class="recent-activity">
<h2>Recent Activity</h2>
{% if items|length > 0 %}
<ul>
{% for item in items|slice(0, 3) %}
<li>You viewed {{ item }}</li>
{% endfor %}
</ul>
{% else %}
<p>No recent activity.</p>
{% endif %}
</div>
</div>
</body>
</html>