added xsl style to feed
This commit is contained in:
parent
a570911957
commit
7f1e272646
5 changed files with 97 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="{{ if .IsHome }}home{{ end }}" lang="{{ .Site.LanguageCode }}">
|
||||
{{- partial "head.html" . -}}
|
||||
{{- partial "build_assets.html" . -}}
|
||||
<body>
|
||||
<div id="baseContainer">
|
||||
{{- partial "header.html" . -}}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
{{- $pages = $pages | first $limit -}}
|
||||
{{- end -}}
|
||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||
{{- printf "<?xml-stylesheet href=\"/feed_style.xsl\" type=\"text/xsl\"?>" | safeHTML -}}
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="https://www.rssboard.org/media-rss">
|
||||
<channel>
|
||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
|
|
|
|||
10
layouts/partials/build_assets.html
Normal file
10
layouts/partials/build_assets.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{{/*
|
||||
This partial builds non-standard assets (like xsl files) with the template
|
||||
engine. It is necessary to do it this way to reduce user friction and
|
||||
ensure that the file is there.
|
||||
*/}}
|
||||
{{ if .IsHome }}
|
||||
{{ $feed_style_xsl_template := resources.Get "feed_style.xsl" }}
|
||||
{{ $feed_style_xsl := $feed_style_xsl_template | resources.ExecuteAsTemplate "feed_style.xsl" . }}
|
||||
{{ $noop := $feed_style_xsl.Permalink }}
|
||||
{{ end }}
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
<link rel="stylesheet" href="https://latest.cactus.chat/style.css" type="text/css">
|
||||
{{ end }}
|
||||
{{ $style := resources.Get "/scss/style.scss" | resources.ExecuteAsTemplate "/scss/style.scss" . | resources.ToCSS (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") | resources.Fingerprint "sha512" }}
|
||||
<link type=text/css rel=stylesheet href={{ $style.Permalink }} integrity="{{ $style.Data.Integrity }}" />
|
||||
<link type="text/css" rel="stylesheet" href={{ $style.Permalink }} integrity="{{ $style.Data.Integrity }}" />
|
||||
{{- partial "inject/head.html" . -}}
|
||||
{{- partial "head_meta_seo.html" . -}}
|
||||
{{- partial "head_meta_opengraph.html" . -}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue