Have you been wondering how to make your Blogger XML
easy on your eyes and your blood pressure?
I bet you have. But since nobody talks about this (maybe), then I shall talk about this 🫡
5,000+ lines of code is not something to take lightly. We need consistent indentation to clearly see where each tag begins and ends.
This Is An Example
THREE MAGIC STEPS
-
We select everything on the
XML
template. Hit:CTRL + A
-
Put some "fake" indentation by pressing
TAB
-
Finally, hit:
SHIFT + TAB
Afterward, we can save that.
This auto indentation feature also works in post edit/create!
Actually, we do not need to make the "fake" indentation, that was just me doing it because I am used to VSCode behavior. Probably even VSCode does not need it 🤔 But that does not matter at the moment.
So then it is just two magical steps:
- Select: highlight some parts or select all using
CTRL + A
. - Tidy it up:
SHIFT + TAB
Anyway, for your information, this feature "does not" auto-indent JavaScript or CSS code block, or anything "unparsed" inside <![CDATA[ ]]>
(Character Data) section. Well, it does sort of work, but... 🤔 You might want to try that.
We can tidy those parts (JS/CSS) manually in VSCode or other editor, then paste that into Blogger XML
.
That is all from me. I hope this tip is useful.
Comments
Post a Comment