Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve readability of embedded templates #10900

Open
ZhangChengLin opened this issue Apr 17, 2023 · 2 comments
Open

Improve readability of embedded templates #10900

ZhangChengLin opened this issue Apr 17, 2023 · 2 comments

Comments

@ZhangChengLin
Copy link

<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Summary | html }}</description>
</item>

Whether the code can increase the readability, this will not affect the later compression, it should be updated and maintained.

The official documentation feels outdated, so you can only look at the source code. Sometimes the source code is not readable, but Hugo is really easy to use. When can you consider some basic issues.

It's just a personal feeling, if something is wrong, please forgive me, I hope Hugo will get better and better.

@jmooring jmooring changed the title Code readability is not strong, high barriers to entry for newcomers Improve readability of embedded templates Apr 17, 2023
@jmooring
Copy link
Member

jmooring commented Apr 17, 2023

Many (all?) of the embedded templates were created before the release of Go 1.6, which introduced syntax to remove white space ({{- -}}). Tracking progress on this issue...

Templates

  • tpl/tplimpl/embedded/templates/disqus.html
  • tpl/tplimpl/embedded/templates/twitter_cards.html
  • tpl/tplimpl/embedded/templates/alias.html
  • tpl/tplimpl/embedded/templates/google_analytics.html
  • tpl/tplimpl/embedded/templates/opengraph.html
  • tpl/tplimpl/embedded/templates/pagination.html
  • tpl/tplimpl/embedded/templates/schema.html

Shortcodes

  • tpl/tplimpl/embedded/templates/shortcodes/figure.html
  • tpl/tplimpl/embedded/templates/shortcodes/gist.html
  • tpl/tplimpl/embedded/templates/shortcodes/highlight.html
  • tpl/tplimpl/embedded/templates/shortcodes/instagram.html
  • tpl/tplimpl/embedded/templates/shortcodes/instagram_simple.html
  • tpl/tplimpl/embedded/templates/shortcodes/param.html
  • tpl/tplimpl/embedded/templates/shortcodes/ref.html
  • tpl/tplimpl/embedded/templates/shortcodes/relref.html
  • tpl/tplimpl/embedded/templates/shortcodes/twitter.html
  • tpl/tplimpl/embedded/templates/shortcodes/twitter_simple.html
  • tpl/tplimpl/embedded/templates/shortcodes/vimeo.html
  • tpl/tplimpl/embedded/templates/shortcodes/vimeo_simple.html
  • tpl/tplimpl/embedded/templates/shortcodes/youtube.html

Render hooks

  • tpl/tplimpl/embedded/templates/_default/_markup/render-codeblock-goat.html
  • tpl/tplimpl/embedded/templates/_default/_markup/render-image.html
  • tpl/tplimpl/embedded/templates/_default/_markup/render-link.html

Partials

  • tpl/tplimpl/embedded/templates/partials/_funcs/get-page-images.html

Other

  • tpl/tplimpl/embedded/templates/_default/rss.xml
  • tpl/tplimpl/embedded/templates/_default/sitemap.xml
  • tpl/tplimpl/embedded/templates/_default/sitemapindex.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@jmooring @ZhangChengLin and others