initial commit
This commit is contained in:
18
layouts/shortcodes/links.html
Normal file
18
layouts/shortcodes/links.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{{- $type := .Get "type" -}} <!-- e.g. "media" -->
|
||||
{{- $data := .Site.Data.links -}}
|
||||
{{- if $type -}}
|
||||
{{- $data = where $data "type" $type -}}
|
||||
{{ end }}
|
||||
{{- range sort $data "date" "desc" }}
|
||||
<ul>
|
||||
<li>{{.desc}} –
|
||||
{{- $len := (len .links) -}} <!-- amount of elements under .links -->
|
||||
{{- range $index, $element := .links -}} <!-- range over links, but keep index -->
|
||||
<a href="{{.href}}">{{.text}}</a>
|
||||
{{- if ne (add $index 1) $len -}}, {{- end -}} <!-- only append comma if not last element (index starts with 0) -->
|
||||
{{- end -}}
|
||||
{{- with .date }} ({{.}}){{ end }}
|
||||
{{ range .tags }}<span class="label label-success">{{ . }}</span> {{ end }}
|
||||
</li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
23
layouts/sitemap.xml
Normal file
23
layouts/sitemap.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
{{ range .Data.Pages }}
|
||||
{{ if ne .Params.sitemap_hide true }}
|
||||
<url>
|
||||
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
|
||||
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
|
||||
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
|
||||
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>{{ end }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>{{ end }}
|
||||
</url>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</urlset>
|
||||
Reference in New Issue
Block a user