artofthesmart / hypertext

An incredibly fast, compatible, and efficient Grav CMS theme.
http://hypertext.artofthesmart.com
MIT License
50 stars 13 forks source link

SVG Logo in header #66

Closed handmeatowel closed 2 years ago

handmeatowel commented 2 years ago

I would like to use an SVG logo instead of using the site title as text. I'd prefer to have it inline instead of linking it to minimize request. How do I do this?

artofthesmart commented 2 years ago

Great suggestion, I'll take a look when I can.

artofthesmart commented 2 years ago

OK, so, turns out you cannot upload an image to Grav and then have the theme/template turn around and base_64 encode it to inline it. Not without lots and lots of work that I don't have time for. Also this kind of goes against the principle of the theme of minimalism and text-centrism.

If I were to do this, and not today because I'm feeling sick, I'm thinking it would be three new fields:

  1. An image upload, where you can drop a header image you want Hypertext to use instead of text,
  2. A text area, where you can put base_64 encoded image data or SVG content, and
  3. A dropdown of what kind of image that data is (SVG, png, jpg, gif).

No resizing; the user is responsible for selecting the right size they want the image to be.

handmeatowel commented 2 years ago

I alignment with the themes core principles (except that SVG isn't HTML3 compatible) I'd focus on inline SVG (treating it as text and leave everything to the web browser). This way an uploader shouldn't be necessary. If needed someone can add some resizing features later, until then the user would be resp. for selecting the right size. What do you think @artofthesmart?

artofthesmart commented 2 years ago

Seems reasonable. I'll add it in the next release. I think I found a simple workaround.

artofthesmart commented 2 years ago

P.S. I got arbitrary HTML in the header working. I want to get the translator plugin in this release but I haven't written it yet. You can await the next release (a couple days tops) or go ahead and download the current version and install it manually if you want SVG right away. :)