All Articles

Day 32

Formatstring

Angular or maybe just Gatsby uses an npm tool called moment. There are so many features, I can’t even imagine a use for the majority.

That being said, I’ve had day of the year turned on on my Gcal for years now, its a something I enjoy seeing. I think the day of the year is pretty awesome as well. I may or may not have added some extra markers in as well, you know, just for fun.

moment formatstring

Excerpt

The next lesson today, since we have a short video is formatting the excerpt. Following what seems to be normal procedure, we hover on excerpt and get the little bubble window to pop up. Click that to show us what we can do.

exceprt formatting

As you can see the in Docs tab for excerpt we have 3 options, two of which or useful right away.

Arguments

  • Format | What you might expect, we can format how the excerpt is printed out. We get HTML, MD and plain text.
  • PruneLength | Default is 140 characters, we can adjust as we see fit.
  • Truncate | A boolean, which at the current moment doesn’t seem to make much of a difference if its true or false. (I tried both and noticed no change in my query return)

Interesting thing to note, when trying to pull my fancy date formatting into this repo my date is a string not a Date. Researching now.