my first sharing back …
I wrote a shortcode that allows you to use Google Fonts and a variety of styles, etc
Read here …
How to use custom fonts with shortcode
Gist for Shortcode is here
my first sharing back …
I wrote a shortcode that allows you to use Google Fonts and a variety of styles, etc
Read here …
How to use custom fonts with shortcode
Gist for Shortcode is here
This is a good start, but
My attempt would look like this:
<link fontfile>
and then add a <style>.fontstyle1 {font-family: andsoone;}</style>
fontname
Probably .Scratch
might help.
Your shortcode is good if it’s only used once per page and in an HTML5 document (they are less strict with the location of the link
tag I think… but maybe it’s just the browser who accomodates you… in my head it’s like “link in the head, link in the head, link in the head”.
Hi @davidsneighbour - this part made me laugh,
and thanks for the feedback
so the idea would be - anyone in their .md files writes
{{< shortcode1 font-family font-family2 >}}
{{< shortcode2 >}}
some text
{{< /shortcode2 >}}`
This way you only get one hopefully at the top of the page.
But … I think you’re suggesting the shortcode.html
file has to use scratch and call / write a partial-head layout (listing the fonts the user wants) – which is above my code skills today.
Next for me … I’ve got a few other shortcodes which I’m writing and will share here - and been playing with a theme-component (in lieu of Hugo supporting plugins)
all comments welcome - and on the {{}} shortcode ill keep playing
cheers
Damien