Set edit content when document doesn't exist

This commit is contained in:
Dendy 2024-02-24 11:34:35 +01:00
parent 0397f8d2d6
commit 918f9fb294
1 changed files with 5 additions and 1 deletions

View File

@ -35,7 +35,11 @@
{% endif %} {% endif %}
{% else %} {% else %}
<form method="POST" action="/{{ path }}"> <form method="POST" action="/{{ path }}">
<textarea id="markdown-textarea" name="text">{{ content }}</textarea> {% set edit_content = content %}
{% if content is none %}
{% set edit_content = '# Title\n\nContent' %}
{% endif %}
<textarea id="markdown-textarea" name="text">{{ edit_content }}</textarea>
<input type="submit" value="Save"/> <input type="submit" value="Save"/>
<form> <form>
<script> <script>