style: start using SASS and assets

* NEW Adds assets/scss directories.
* Copies static/styles.css to assets/scss/main.scss
* Improves head layouts to compile assets depending if on server or
  build.

Co-Authored-by: Igor Milhit <igor@milhit.ch>
pull/31/head
iGor milhit 2019-12-15 15:45:47 +01:00
parent cabdffa8ac
commit a7a017b68a
Signed by: igor
GPG Key ID: 692D97C3D0228A99
2 changed files with 10 additions and 1 deletions

View File

@ -3,7 +3,16 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ .Title }} | {{ .Site.Title }}</title>
<link rel="canonical" href="{{ .Permalink }}">
<link rel="stylesheet" type="text/css" href="{{ .Site.BaseURL }}style.css">
{{ if .Site.IsServer }}
{{ $options := (dict "targetPath" "styles.css" "enableSourceMap" true) }}
{{ $styles := resources.Get "scss/main.scss" | toCSS $options }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" media="screen">
{{ else }}
{{ $options := (dict "targetPath" "styles.css") }}
{{ $styles := resources.Get "scss/main.scss" | toCSS $options | minify }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" media="screen">
{{ end }}
<!-- <link rel="stylesheet" type="text/css" href="{{ .Site.BaseURL }}style.css"> -->
{{ with .OutputFormats.Get "RSS" }}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end }}