发布于 2015-11-26 00:21:44 | 158 次阅读 | 评论: 0 | 来源: 网友投递
hugo 注释驱动的方法
hugo 是注释驱动的方法,用来在调试的时候调用日志记录。它用于打印函数信息及执行时间的工具,仅在debug模式生效。
Hugo v0.15 发布, 更新如下:
new hugo import jekyll
command. 1469
The new Param
convenience method on Page
and Node
can be used to get the most specific parameter value for a given key. 1462
Several new information elements have been added to Page
and Node
:
RuneCount
: The number of runes in the content, excluding any whitespace. This may be a good alternative to .WordCount
for Japanese and other CJK languages where a word-split by spaces makes no sense. 1266
RawContent
: Raw Markdown as a string. One use case may be of embedding remarkjs.com slides.
IsHome
: tells the truth about whether you're on the home page or not.
hugo server
now builds ~30%+ faster by rendering to memory instead of disk. To get the old behavior, start the server with --renderToDisk=true
.
Hugo now supports dynamic reloading of the config file when watching.
We now use a custom-built LazyFileReader
for reading file contents, which means we don't read media files in /content
into memory anymore -- and file reading is now performed in parallel on multicore PCs. 1181
Hugo is now built with Go 1.5
which, among many other improvements, have fixed the last known data race in Hugo. 917
Paginator now also supports page groups. 1274
Markdown improvements:
Option to disable Blackfriday's Smartypants
.
Option for Blackfriday to open links in a new window/tab. 1220
Option to disable Blackfriday's LaTeX style dashes 1231
Definition lists extension support.
Hugo now supports GitHub-flavoured markdown code fences for highlighting for md
-files (Blackfriday rendered markdown) and mmark
files (MMark rendered markdown). 3621258
Several new Blackfriday options are added:
Scratch
now has built-in map
support.
We now fall back to link title
for the default page sort. 1299
Some notable new configuration options:
hugo gen
can now generate man files, bash auto complete and markdown documentation
Hugo will now make suggestions when a command is mistyped
Shortcodes now have a boolean .IsNamedParams
property. 1597
All template engines:
The new dict
function that could be used to pass maps into a template.1463
The new pluralize
and singularize
template funcs.
The new base64Decode
and base64Encode
template funcs.
The sort
template func now accepts field/key chaining arguments and pointer values. 1330
Several fixes for slicestr
and substr
, most importantly, they now have full utf-8
-support. 1190 1333 1347
The new last
template function allows the user to select the last N
items of a slice. 1148
The new after
func allows the user to select the items after the Nth
item. 1200
Add time.Time
type support to the where
, ge
, gt
, le
, and lt
template functions.
It is now possible to use constructs like where Values ".Param.key" nil
to filter pages that doesn't have a particular parameter. 1232
getJSON
/getCSV
: Add retry on invalid content. 1166
The new readDir
func lists local files. 1204
The new safeJS
function allows the embedding of content into JavaScript contexts in Go templates.
Get the main site RSS link from any page by accessing the .Site.RSSLink
property. 1566
Ace templates:
Full support for Amber templates including all template functions.
A built-in template for Google Analytics. 1505
Hugo is now shipped with new built-in shortcodes: 1576
youtube
for YouTube videos
vimeo
for Vimeo videos
gist
for GitHub gists
tweet
for Twitter Tweets
speakerdeck
for Speakerdeck slides
Fix data races in page sorting and page reversal. These operations are now also cached. 1293
page.HasMenuCurrent()
and node.HasMenuCurrent()
now work correctly in multi-level nested menus.
Support Fish and Chips
style section titles. Previously, this would end up as Fish And Chips
. Now, the first character is made toupper, but the rest are preserved as-is. 1176
Hugo now removes superfluous p-tags around shortcodes. 1148
hugo server
will watch by default now.
Some fields and methods were deprecated in 0.14
. These are now removed, so the error message isn't as friendly if you still use the old values. So please change:
getJson
to getJSON
, getCsv
to getCSV
, safeHtml
tosafeHTML
, safeCss
to safeCSS
, safeUrl
to safeURL
, Url
to URL
,UrlPath
to URLPath
, BaseUrl
to BaseURL
, Recent
to Pages
.
下载页面:v0.15
hugo 是注释驱动的方法,用来在调试的时候调用日志记录。它用于打印函数信息及执行时间的工具,仅在debug模式生效。