elm-pages icon indicating copy to clipboard operation
elm-pages copied to clipboard

Can't create a custom link attribute in the Site.elm file

Open sdaves opened this issue 3 years ago • 3 comments

Currently I am unable to create a custom link attribute because I cannot call the Tag constructor without the Head.node function being exposed. I created a 1 line PR to expose the Head.node function here

sdaves avatar Feb 12 '22 22:02 sdaves

Similar problem here. I would like to preload a font, like in this stackoverflow answer.

ffigiel avatar Mar 22 '22 11:03 ffigiel

I'd also like to preload a font, and can't see how to with the way things are.

asteroidb612 avatar Apr 07 '22 21:04 asteroidb612

I've found a workaround for this in my case. This may not apply to others. I had a font that only appeared after some user interactions, and it the font which was flickering. I've now added an empty text node in that font to my view unconditionally, and it seems the font loads before the user interaction takes place now.

asteroidb612 avatar Apr 07 '22 21:04 asteroidb612

Hey there, so this is now possible in the v3 beta as I've added a hook in the config file to allow you to customize the head tags (with Vite processing as well): https://github.com/dillonkearns/elm-pages-v3-beta/blob/6a067671200f896c2a9b10a31aab307f88943973/examples/docs/elm-pages.config.mjs#L12-L15. See my comment here for more background: https://github.com/dillonkearns/elm-pages/pull/268#issuecomment-1296545316.

I think there are still some ideas to explore, but I'm going to close this issue since this is the current next step for this direction. Let's create some new discussion threads to explore ideas if any use cases that come up that aren't handled by that functionality. Thanks!

dillonkearns avatar Oct 31 '22 05:10 dillonkearns