// Copyright © 2013 Steve Francia . // // Licensed under the Simple Public License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://opensource.org/licenses/Simple-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package hugolib type Tmpl struct { Name string Data string } func (t *GoHtmlTemplate) EmbedShortcodes() { t.AddInternalShortcode("highlight.html", `{{ .Get 0 | highlight .Inner }}`) t.AddInternalShortcode("test.html", `This is a simple Test`) t.AddInternalShortcode("figure.html", `
{{ with .Get "link"}}{{ end }} {{ if .Get "link"}}{{ end }} {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
{{ if isset .Params "title" }}

{{ .Get "title" }}

{{ end }} {{ if or (.Get "caption") (.Get "attr")}}

{{ .Get "caption" }} {{ with .Get "attrlink"}} {{ end }} {{ .Get "attr" }} {{ if .Get "attrlink"}} {{ end }}

{{ end }}
{{ end }}
`) } func (t *GoHtmlTemplate) EmbedTemplates() { t.AddInternalTemplate("_default", "rss.xml", ` {{ .Title }} on {{ .Site.Title }} Hugo {{ .Permalink }} {{ with .Site.LanguageCode }}{{.}}{{end}} {{ with .Site.Author.name }}{{.}}{{end}} {{ with .Site.Copyright }}{{.}}{{end}} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 MST" }} {{ range first 15 .Data.Pages }} {{ .Title }} {{ .Permalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 MST" }} {{with .Site.Author.name}}{{.}}{{end}} {{ .Permalink }} {{ .Content | html }} {{ end }} `) t.AddInternalTemplate("_default", "sitemap.xml", ` {{ range .Data.Pages }} {{ .Permalink }} {{ safeHtml ( .Date.Format "2006-01-02T15:04:05-07:00" ) }}{{ with .Sitemap.ChangeFreq }} {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} {{ .Sitemap.Priority }}{{ end }} {{ end }} `) t.AddInternalTemplate("", "disqus.html", `{{ if .Site.DisqusShortname }}
comments powered by Disqus{{end}}`) }