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

add titleFormat

Open dojineko opened this issue 7 years ago • 4 comments

supply the title suffix feature.

e.g. Happy new year! - My Blog

dojineko avatar Jan 03 '18 07:01 dojineko

@dojineko It's a good idea but I find the current implementation to hardcoded since you decide

<page title> - <site title>

But why not

<site title> - <page title>

I will think about something more customizable like using string format template or something.

kakawait avatar Jan 03 '18 14:01 kakawait

@kakawait umm... at first, in order to make the order changeable, i was going to implement with string format template. but i couldn't find such a feature in golang pkg: text/template. so, i implement like this... 😇 the current order, i followed some general sites.

  • <application name> - Google Play Store
    • e.g. https://play.google.com/store/apps/details?id=com.android.chrome
  • <content name> - Wikipedia
    • e.g. https://en.wikipedia.org/wiki/Blogger_(service)
  • <pr name> - <repository> (Github)
    • e.g. https://github.com/kakawait/hugo-tranquilpeak-theme/pull/251

is it better to have parameter like preferSiteTitle, maybe?

dojineko avatar Jan 03 '18 14:01 dojineko

ah! it will solve simply by replace function~ https://gohugo.io/functions/replace/

dojineko avatar Jan 03 '18 15:01 dojineko

@kakawait how about this one?

dojineko avatar Jan 03 '18 15:01 dojineko