You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
how to pass categories to "include header.jade"?
i'm calling Index() once to display all. Any ideas how to pass the categories to the inside of header.jade fille too?
go compile error :
header.jade.go:25:27: undefined: categories
index.jade
:go:func Index(pageTitle string, categories []Category, currentYear int)
mixin for(golang)
#cmd Precompile jade templates to #{golang} code.
//- :go:func Index(pageTitle string, vendors []Vendor)
doctype html
html(lang="en")
head
title= pageTitle
link(href='https://classless.de/classless.css', rel='stylesheet')
link(href='https://classless.de/addons/tabbox.css', rel='stylesheet')
meta(name='viewport', content='width=device-width, initial-scale=1')
style.
:root, html[data-theme='light'] {
--width: 78rem;
}
.login-signup-tab {
width: 30%; /* change to desired percentage */
margin: auto;
}
body
header
include header.jade
#container.col
p
center Use SPRAPP Account
.login-signup-tab
div.tabs
//- Login Tab
input(type='radio', name='tabs', id='loginTab', checked)
label(for='loginTab') Log In
div.tab
//- Login Form
form(method='POST', action='/u/l')
label(for='e') Email
input#e(type='email', name='e', required)
label(for='p') Password
input#p(type='password', name='p', required)
input(type='submit', value='Log In')
//- Signup Tab
input(type='radio', name='tabs', id='signupTab')
label(for='signupTab') Sign Up
div.tab
//- Signup Form
include signup.jade
//- Reset Password Tab
input(type='radio', name='tabs', id='resetTab')
label(for='resetTab') Reset Password
div.tab
//- Signup Form
form(method='POST', action='/u/r')
label(for='e') Email
input#email(type='email', name='e', required)
input(type='submit', value='Reset')
footer
include footer.jade
header.jade
center
h3 SPRAPP
nav
ul.navbar
li.logo
a(href='/')
strong SPRAPP
each category in categories
li.dropdown
a(href=category.URL)= category.Name
ul.dropdown-content
each subcategory in category.Subcategories
li
a(href=subcategory.URL)= subcategory.Name
The text was updated successfully, but these errors were encountered:
hiqsociety
changed the title
nice work but not sure how to pass variable of function call to include jade file.
amazing work but not sure how to pass variable of function call to include jade file.
Jul 31, 2023
how to pass categories to "include header.jade"?
i'm calling Index() once to display all. Any ideas how to pass the categories to the inside of header.jade fille too?
go compile error :
index.jade
header.jade
The text was updated successfully, but these errors were encountered: