These are chat archives for jescalan/roots

30th
Aug 2016
Jeff Escalante
@jescalan
Aug 30 2016 02:29
hey congrats @tkraak !
looks amazing :tada::tada::tada::tada:
Tom Kraak
@tkraak
Aug 30 2016 02:38
@jescalan thx!
Marc Haan
@Hoenoe
Aug 30 2016 14:53
Hey @tkraak the site looks real nice!
Can I ask you what the get-page-name.js file does?
love the transition between casestudies and videos looks really smooth
Tom Kraak
@tkraak
Aug 30 2016 15:08
@Hoenoe thanks!
Tom Kraak
@tkraak
Aug 30 2016 15:14
get-page-name.js is just a little helper that strips the .html file extension from _path, which is a native roots local
and then I use it like this:
- var page = helpers.getPageName(_path)

doctype html
include ./includes/_head
  body(id= page)
or like this:
doctype html
include ./includes/_head
  body(id= helpers.getPageName(_path))
Tom Kraak
@tkraak
Aug 30 2016 15:20
so this then compiles to:
<body id=“index”>
<body id=“work”>
<body id=“blog”>
<body id=“about”>
<body id=“contact”>
etc.

which in turn allows me to scope CSS by page as explained here:

https://github.com/jescalan/gps

Marc Haan
@Hoenoe
Aug 30 2016 15:41
Ah I see, pretty handy
thank you
Marc Haan
@Hoenoe
Aug 30 2016 19:04

Still struggling with routing.

I will try to explain my situation a bit more clearer.

I checked the dynamic content extension but Im already loading dynamic content through ajax.

The text you see and the images in the screens is the dynamic content.

The columns below are my projects, when clicked on it displays its description and images dynamically in the top
and I would like the urls to change to like this:

example.com/portfolio/project-name-one
example.com/portfolio/project-name-two

While staying on the same page.
Here is a screenshot from the page.

screencapture-localhost-1112-portfolio-1472581250919.png
Jeff Escalante
@jescalan
Aug 30 2016 20:02
so this is entirely outside the scope of roots
you need to use js to do client-side routing
I'd recommend https://vuejs.org/
this will allow you to do the routes any way you want
Marc Haan
@Hoenoe
Aug 30 2016 20:12
alright thank you!
Jeff Escalante
@jescalan
Aug 30 2016 20:13
all roots will do is generate static html files for you
so if you want to do anything outside of that, you can use js :)
Marc Haan
@Hoenoe
Aug 30 2016 20:14
👍
Oliver Stigley
@ostigley
Aug 30 2016 23:04
This message was deleted