The backend of a gist server written in Rust
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

show.html.tera 922B

1234567891011121314151617181920212223242526
  1. {% set snippet = context.snippet %}
  2. <html>
  3. <head>
  4. <title>{{ snippet.title }}</title>
  5. <link rel="stylesheet" href="/static/style.css">
  6. <meta name="viewport" content="width=device-width">
  7. </head>
  8. <body>
  9. <div class="container">
  10. <h1 class="header">
  11. <span class="header__title">{{ snippet.title }}</span>
  12. <div class="header__right">
  13. <span class="header__date">{{ snippet.created_at | date(format="%Y-%m-%d %H:%M:%S") }} UTC</span>
  14. <a class="header__raw-link" href="/snippets/{{ snippet.uuid }}/raw">
  15. view raw
  16. </a>
  17. </div>
  18. </h1>
  19. <div class="body">
  20. {% set length = context.lines | length - 1 %}
  21. {{ context.lines | first | safe }}{% for line in context.lines | slice(start=1, end=length) %}<code id="line-{{ loop.index }}">{{ line | safe }}</code>
  22. {% endfor %}</pre>
  23. </div>
  24. </div>
  25. </body>
  26. </html>