Which .Term is user looking at -- brain fart

For the life of me, I can’t figure this one out as my brain is tied in knots.

http://localhost:1313/categories/health/#/
http://localhost:1313/categories/economics/#/
http://localhost:1313/tags/history/#/
http://localhost:1313/tags/health/#/

I’m in page-title.html partial, and am trying to get what slug the taxonomy template is showing. I’d like to know (from above):
health
econonmics
history
health

The best I can get to is a list of all Tags, or Categories.
Thanks.

if you’re passing the dot to page-title.html like this: {{ partial "page-title" . }}

then the term you are currently viewing should be stored in {{ .Title }}

Thanks.

Not the keyword I would’ve guessed, obviously. Also, I happened to be within : {{ with .Site.GetPage "section" (path.Dir .Path) }} which was giving me “Tags”. Once I moved that out of the with statement all is good.
(Sorry for the stinky post)

1 Like