TransitionbyDesign / homemaker

GNU Affero General Public License v3.0
0 stars 1 forks source link

Add open house logo on Little Clarendon St #66

Open wu-lee opened 3 years ago

wu-lee commented 3 years ago

As per @JasLewicki 2/11 feedback document

wu-lee commented 3 years ago

Location: 51.758417, -1.261972

Icon received from Jas.

Charlie-TbD commented 3 years ago

Solution agreed for user to add the icon image in Forestry as a dialogue in each article

wu-lee commented 3 years ago

Ok, this is now implemented.

The field in question is custom_icon, which is a file selector, so you can select any image in the assets folder. (Most of the images won't be suitable of course, but that's just a consequence of forestry.io allowing only one place to store uploaded media.)

I've added a stub article for open house, in the right location and with the custom icon set. The icon I've got is very pale, so it might be hard to spot on the pale map background. If you upload a more contrasted icon it should work

It seems to work currently, although I had a lot of problems with errors, which I've described in the code itself here: e8b6ee2c4ea0612ccc90e8d6f6d483a3740d5462

There seems to be what might be a bug in Gatsby, or just a design "feature", in which the types of fields in the markdown pages' front-matter order is inferred from what's present, but if fields are optionally absent, this can result in Gatsby inferring something else, which then triggers a build error because the query then doesn't work as intended.

However, having hammered my head against this for some time, this does seem to be working fairly reliably now. We shall have to watch for build failures, and see if this is the reason. If it is, some more hacky way of implementing the Open House icon may be called for, which is reliable if a bit less general.