hugo-tranquilpeak-theme icon indicating copy to clipboard operation
hugo-tranquilpeak-theme copied to clipboard

unable to insert raw html to the posts

Open grojar opened this issue 2 years ago • 8 comments

Configuration

  • Operating system with its version: Windows 11 Home
  • Browser with its version: Chrome 110.0.5481.77 / FireFox 108.0.2 (64-bit)
  • Hugo version: hugo v0.100.1-0afb4866e345d31cbbcbab4349e43f1d36122806+extended windows/amd64 BuildDate=2022-06-01T10:11:48Z VendorInfo=gohugoio
  • Tranquilpeak version: 0.5.3-BETA
  • Do you reproduce on https://tranquilpeak.kakawait.com demo?: No

Issue: I tried to get some stuff in the posts using HTML tags directly in the .md files, but i was unable to do it. I don't know if this is a general problem, some people's problem, or just me, but I'd be very pleased it if you would allow me to share a possible solution for those who might be affected by this issue.

Possible solution: (shortcodes) In this webpage you can find the steps to do it.

I apologize if this post was created in the wrong place.

My best,

Pablo

grojar avatar Feb 17 '23 02:02 grojar

Thank you!

dacanizares avatar Jan 24 '24 02:01 dacanizares

I have the same problem

luojing94 avatar Apr 18 '24 18:04 luojing94

Hey @luojing94 !

You can try the possible solution that grojar propossed: Raw html short code

Here is a live example:

  1. Add the rawhtml shorcode: https://github.com/TheScienceOfCode/hugo-tranquilpeak-theme/blob/0eae7fa35a095271d12723edf9dcc57d405727a8/layouts/shortcodes/rawhtml.html

  2. Use it on your post: https://github.com/TheScienceOfCode/thescienceofcode.github.io/blob/0e14609ec5be6de7c5e0b40fcf69cc25fa3415be/content/post/sdl-vscode-c-cpp-debug.en.md?plain=1#L185

  3. Results here: https://thescienceofcode.com/sdl-vscode-c-cpp-debug/

dacanizares avatar Apr 21 '24 23:04 dacanizares

@dacanizares Thank you very much I solved it according to your method. Good luck to U!

luojing94 avatar Apr 22 '24 19:04 luojing94

@dacanizares hello ,Sorry for bothering you I have a problem with switching languages. In your example, you have a button that switches between English and Spanish. Can I ask how you do that?

luojing94 avatar May 06 '24 03:05 luojing94

Hi @luojing94 !

Sorry for the delay.

Here is the button: https://github.com/TheScienceOfCode/hugo-tranquilpeak-theme/blob/0eae7fa35a095271d12723edf9dcc57d405727a8/layouts/partials/lang_translations.html

Also check my site config: https://github.com/TheScienceOfCode/thescienceofcode.github.io/blob/dev/config.toml

And finally, just create the posts as here: https://github.com/TheScienceOfCode/thescienceofcode.github.io/tree/dev/content/post

Regarding your layout, here you can find config files for internationalization: https://github.com/TheScienceOfCode/hugo-tranquilpeak-theme/tree/0eae7fa35a095271d12723edf9dcc57d405727a8/i18n

Good luck!

dacanizares avatar May 11 '24 16:05 dacanizares

@dacanizares Thank you! I have found another way these days, but it takes up a lot of space, which is to combine the same blogs in two languages. The reference is https://saltyleo.com/en/1448.html

But I'm going to use your method instead because it's something I really want to master and is better at.

Thank you very much! I wish you all the best~

luojing94 avatar May 12 '24 14:05 luojing94

Hey @luojing94 !

You can double-check the official Hugo documentation regarding i18n: https://gohugo.io/content-management/multilingual/

Good luck!

dacanizares avatar May 14 '24 02:05 dacanizares