Tuesday, April 27, 2021

Mobile Setting is Broken in a Different Way, But At Least It Shows Up Properly Now

Sometimes, I hate myself.

If you pour through all the text, you will find that I have described the problem. Take particular note of this paragraph:
Notice that I kept on saying ``desktop version''. Because it turns out that there is a hidden set of theme information that Blogger did not expose that handles the mobile layout. Even if I set the mobile layout to be ``custom'', it would still be drawing on the ``simple'' theme and ignore anything that was changed in the main theme's HTML. And any changes that I made to the HTML will immediately revert the mobile setting to using ``simple'', and to get it to look roughly like the Icy variant of this theme by Awesome Inc would require me to manually re-set it in the mobile theme settings.
Ever wondered how I knew all that?

That's right. Staring at the contents of the generated HTML page yielded the line that looked something like
<body class="mobile icy-variant">
...
The bloody thing was staring at me then. Why would the <body>'s class be generated like this?

I dug into the HTML file for the theme and found the generator information for that class and removed the bit that added the stupid class for one of the other themes.

Essentially, I took this:
<body expr:class='&quot;loading&quot; + data:blog.mobileClass'>
and changed it to this:
<body expr:class='&quot;loading&quot; '>
And what do you know, I get almost exactly the theme that is the same as the desktop version.

🤦‍♂️

The only snafu is the positioning of the date---it is sitting too close to the blog description. I spent/wasted nearly 30 min to try and adjust it away, but to no avail.

But you know what, I'm done. I said I would deal with it in the morning, but well, I couldn't, and I have succeeded. It's probably a janky hack that might bite me in the ass at some point in the future, but I am happy that I have finally gotten something much closer to my vision working over the mobile settings.

That's it. Shower time, and then bed time.

Till the next update.

No comments: