Improvements in template handling and loading
This commit is contained in:
@@ -39,9 +39,22 @@
|
||||
<button class="template-select-btn">Create Your Own Protocol</button>
|
||||
<p class="template-description">Start with a blank protocol and build it from scratch.</p>
|
||||
</div>
|
||||
<!-- Template options will be populated by JavaScript -->
|
||||
|
||||
<!-- Template options from Hugo data -->
|
||||
{{ range $filename, $template := .Site.Data.templates }}
|
||||
<div class="template-option" data-template-id="{{ $template.id }}">
|
||||
<button class="template-select-btn">{{ $template.title }}</button>
|
||||
<p class="template-description">{{ $template.description }}</p>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Make template data available to JavaScript -->
|
||||
<script>
|
||||
window.allTemplates = {{ .Site.Data.templates | jsonify }};
|
||||
console.log('Templates loaded from Hugo data:', Object.keys(window.allTemplates).length, 'templates');
|
||||
</script>
|
||||
</div>
|
||||
|
||||
|
||||
|
@@ -16,8 +16,7 @@
|
||||
<!-- Custom JS for the builder -->
|
||||
{{ if eq .Layout "builder" }}
|
||||
<script defer src="{{ "js/debug.js" | relURL }}"></script>
|
||||
<script type="module" src="{{ "js/templates/index.js" | relURL }}"></script>
|
||||
<script type="module" src="{{ "js/builder.js" | relURL }}"></script>
|
||||
<script defer src="{{ "js/builder.js" | relURL }}"></script>
|
||||
|
||||
<!-- Auto-resize textareas script -->
|
||||
<script>
|
||||
|
Reference in New Issue
Block a user