Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mixins with includes not working #2719

Closed
Creativenauts opened this issue Feb 10, 2017 · 1 comment
Closed

mixins with includes not working #2719

Creativenauts opened this issue Feb 10, 2017 · 1 comment

Comments

@Creativenauts
Copy link

Not sure what I'm doing wrong here but I have created mixins file with a couple of mixins that I have created for my project. I keep getting the following errors in console.

pug_mixins.job-card is not a function
pug_mixins.btn is not a function

Mixins file:

mixin job-card(url, title, description, date, location, type, category)

	a(href=url)

		.job-listings-body
			h5 #{title || 'Physical Therapist / Clinic Director'}

			p #{description || 'In this position the physical therapy assistant will provide physical therapy in a team environment, and under the direction and supervision of the staff physical therapist in a skilled nursing facility.'}
			
			.related-jobs-meta
				span #[i.fa.fa-calendar] #{date || '1 Day Ago'}
				span #[i.fa.fa-map-marker] #{location || 'Southern Pines, NC 28387'}
				span #[i.fa.fa-clock-o] #{type || 'Full Time'}
				span #[i.fa.fa-tag] #{category || 'Nursing'}

		.lob-listing-apply-btn #[i.fa.fa-check-circle] Apply Online!

mixin btn(url, text, type)
	- var btnType = type;

	if btnType === 'button'
		button(type="button")&attributes(attributes)= text
	else
		a(href=url)&attributes(attributes)= text

Example Include File in template:

+btn('#', 'test', 'button')

Page Template:

include mixins.pug
- var pageTitle = 'Job Details Page'

doctype html
html(lang="en")
	head
		include regions/head.pug

	body

		// Toolbar
		include menus/toolbar.pug

		// Header
		section.job-header

			.container
				p We've Got This Great Job For You!
				h1 Physical Therapist - Skilled Nursing / Cynthiana, KY

		// Sub Header
		section.job-sub-header

			.container

				.related-jobs-meta
					span #[i.fa.fa-calendar] 3 Days Ago
					span #[i.fa.fa-map-marker] Southern Pines, NC 28387
					span #[i.fa.fa-clock-o] Full Time

		// Main Content
		section.main-content

			// Sidebar
			.col-desktop-5

				// Form
				include components/job-form.pug

				// Review Carousel
				include components/testimonial-carousel.pug

				// Related Jobs
				include components/sidebar-related-jobs.pug

	// footer
	include regions/footer.pug
@ForbesLindesay
Copy link
Member

Please submit a failing test case. See #2687 for an example of how to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants