Skip to content

0.5.0-BETA

Compare
Choose a tag to compare
@kakawait kakawait released this 14 Aug 18:05
· 51 commits to master since this release
fbf3239

Forwords

Theme activities were pretty low since 2019. I maintain the theme on my free time and in 2019 I became a dad. You may (or not) understand that it was hard for me to find time to maintain the project.

I recently find a great motiviation to re-maintain with more frequent updates and releases!
Some big changes will comes to try to use latest Hugo's improvements and features.
The goal is to release the 1.0.0 for the end of this year.

I'd like to thank every existing contributors. And not only people that pushing code.
During that period, I've seen some people trying to help other people on issue! I really appreciate.

If you'd like to start helping you can firstly look on that list of labelled issues good first issue, ideal for contribution, help wanted


Notable changes

  • Synch from Hexo Tranquilpeak theme 3.1.0 (#287)
  • Revamp sidebar translation in order to use transform3d which is way more efficiant in term of performance (#364)
  • De-hardcode main section as recommended in Hugo documentation (#444)
  • Create a new shortcode {{< toc >}} to replace previous HTML comment <!-- toc --> that does not work anymore with latest Hugo's markdown engine (#395)
  • Update every 3rd party dependencies (except MathJax*):
    • highlight.js 9.12.0 -> 11.1.0
    • jQuery 2.2.4 -> 3.6.0
    • jQuery fancybox 2.1.4 -> 3.5.7
    • prism 1.8.3 -> 1.24.1
    • font-awesome 4.7.0 -> 5.15.3
  • Add touch event support for closing sidebar when opened (#475)

* I'm not using Math's stuffs at all, so it's hard for me to check no-regression. That why I'm looking for some help by creating a new post that expose Math feature. See issue #478.

Breaking changes

Update Font Awesome to v5

Hugo Tranquilpeak now uses Font Awesome v5. In this new version, Font Awesome has separated web fonts in 3 categories: regular, solid and brands. Because of that, you now have to update your icons in the sidebar configuration and sharing options in the theme configuration to tell Font Awesome in which web fonts your icons are:

  • fa: for regular and solid icon
    • fas: for solid icon only
    • far: for regular icon only
  • fab: for brand icons

Some icon names have also changed, so if at the end of the process, some icons are not displayed, make sure they still exist here: Font Awesome v5 - icons

Here is an example to help you upgrade to the new version:

Before (config.toml):

# ------------
# Sidebar menu
# ------------
[[menu.main]]
  weight = 1
  identifier = "home"
  name = "Home"
  pre = "<i class=\"sidebar-button-icon fa fa-lg fa-home\"></i>"
  url = "/"
[[menu.main]]
  weight = 2
  identifier = "categories"
  name = "Categories"
  pre = "<i class=\"sidebar-button-icon fa fa-lg fa-bookmark\"></i>"
  url = "/categories"
[[menu.main]]
  weight = 3
  identifier = "tags"
  name = "Tags"
  pre = "<i class=\"sidebar-button-icon fa fa-lg fa-tags\"></i>"
  url = "/tags"
[[menu.main]]
  weight = 4
  identifier = "archives"
  name = "Archives"
  pre = "<i class=\"sidebar-button-icon fa fa-lg fa-archive\"></i>"
  url = "/archives"
[[menu.main]]
  weight = 5
  identifier = "about"
  name = "About"
  pre = "<i class=\"sidebar-button-icon fa fa-lg fa-question\"></i>"
  url = "/#about"

[[menu.links]]
  weight = 1
  identifier = "github"
  name = "GitHub"
  pre = "<i class=\"sidebar-button-icon fa fa-lg fa-github\"></i>"
  url = "https://github.com/kakawait"
[[menu.links]]
  weight = 2
  identifier = "stackoverflow"
  name = "Stack Overflow"
  pre = "<i class=\"sidebar-button-icon fa fa-lg fa-stack-overflow\"></i>"
  url = "https://stackoverflow.com/users/636472/kakawait"

[[menu.misc]]
  weight = 1
  identifier = "rss"
  name = "RSS"
  pre = "<i class=\"sidebar-button-icon fa fa-lg fa-rss\"></i>"
  url = "/index.xml"

[params]
  # Sharing options
  # Comment and uncomment to enable or disable sharing options
  # If you wanna add a sharing option, read user documentation :
  # Tranquilpeak configuration > Theme configuration > sharing-options
  [[params.sharingOptions]]
    name = "Facebook"
    icon = "fa-facebook-official"
    url = "https://www.facebook.com/sharer/sharer.php?u=%s"

  [[params.sharingOptions]]
    name = "Twitter"
    icon = "fa-twitter"
    url = "https://twitter.com/intent/tweet?text=%s"

  [[params.sharingOptions]]
    name = "Google+"
    icon = "fa-google-plus"
    url = "https://plus.google.com/share?url=%s"

After (config.toml):

# ------------
# Sidebar menu
# ------------
[[menu.main]]
  weight = 1
  identifier = "home"
  name = "Home"
  pre = "<i class=\"sidebar-button-icon fas fa-lg fa-home\" aria-hidden=\"true\"></i>"
  url = "/"
[[menu.main]]
  weight = 2
  identifier = "categories"
  name = "Categories"
  pre = "<i class=\"sidebar-button-icon fas fa-lg fa-bookmark\" aria-hidden=\"true\"></i>"
  url = "/categories"
[[menu.main]]
  weight = 3
  identifier = "tags"
  name = "Tags"
  pre = "<i class=\"sidebar-button-icon fas fa-lg fa-tags\" aria-hidden=\"true\"></i>"
  url = "/tags"
[[menu.main]]
  weight = 4
  identifier = "archives"
  name = "Archives"
  pre = "<i class=\"sidebar-button-icon fas fa-lg fa-archive\" aria-hidden=\"true\"></i>"
  url = "/archives"
[[menu.main]]
  weight = 5
  identifier = "about"
  name = "About"
  pre = "<i class=\"sidebar-button-icon fas fa-lg fa-question\" aria-hidden=\"true\"></i>"
  url = "/#about"

[[menu.links]]
  weight = 1
  identifier = "github"
  name = "GitHub"
  pre = "<i class=\"sidebar-button-icon fab fa-lg fa-github\" aria-hidden=\"true\"></i>"
  url = "https://github.com/kakawait"
[[menu.links]]
  weight = 2
  identifier = "stackoverflow"
  name = "Stack Overflow"
  pre = "<i class=\"sidebar-button-icon fab fa-lg fa-stack-overflow\" aria-hidden=\"true\"></i>"
  url = "https://stackoverflow.com/users/636472/kakawait"

[[menu.misc]]
  weight = 1
  identifier = "rss"
  name = "RSS"
  pre = "<i class=\"sidebar-button-icon fas fa-lg fa-rss\" aria-hidden=\"true\"></i>"
  url = "/index.xml"

[params]
  # ---------------
  # Sharing options
  # ---------------
  # Comment and uncomment to enable or disable sharing options
  # If you wanna add a sharing option, read user documentation :
  # Tranquilpeak configuration > Theme configuration > sharing-options
  [[params.sharingOptions]]
    name = "Facebook"
    icon = "fab fa-facebook-square"
    url = "https://www.facebook.com/sharer/sharer.php?u=%s"

  [[params.sharingOptions]]
    name = "Twitter"
    icon = "fab fa-twitter"
    url = "https://twitter.com/intent/tweet?text=%s"

  # Removed Google+ because service was shutdown

Main section

Until now, Hugo Tranquilpeak was using hardcoded main section post. That force you to have the following content structure:

content/
  post/
    your-post.md
    other-post.md

Since 0.5.0-BETA Hugo tranquilpeak will now follow official recommendation https://gohugo.io/functions/where/#mainsections.

You can configure your main(s) section(s) from config.toml

[params]
  mainSections = ['posts']

but by default

If the user has not set this config parameter in their site config, it will default to the section with the most pages.