mirror of https://github.com/luizdepra/hugo-coder.git

Luiz de Prá
15.05.2018 a094f8fe7bfefbf150f20f068243d210de14d6c7
Fix assets permalinks
4 files modified
17 ■■■■ changed files
Makefile 5 ●●●●● patch | view | raw | blame | history
layouts/_default/baseof.html 8 ●●●● patch | view | raw | blame | history
layouts/partials/header.html 2 ●●● patch | view | raw | blame | history
layouts/partials/home.html 2 ●●● patch | view | raw | blame | history
Makefile
@@ -10,9 +10,8 @@
    mkdir -p demo/themes/hugo-coder
    rsync -av exampleSite/ demo
    rsync -av --exclude='demo' --exclude='exampleSite' --exclude='.git' . demo/themes/hugo-coder
    cd demo && ./hugow
    cd .. && rm -rf resources
    cp -r demo/resources resources
    cd ./demo && ./hugow
    rm -rf ./resources && cp -r ./demo/resources ./resources
clean:
    rm -rf demo
layouts/_default/baseof.html
@@ -21,22 +21,22 @@
    {{ if .Site.IsServer }}
      {{ $cssOpts := (dict "targetPath" "css/coder.css" "enableSourceMap" true ) }}
      {{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts }}
      <link rel="stylesheet" href="{{ $styles.Permalink }}" media="screen">
      <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
    {{ else }}
      {{ $cssOpts := (dict "targetPath" "css/coder.css" ) }}
      {{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts | minify | fingerprint }}
      <link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen">
      <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen">
    {{ end }}
    {{ if .Site.Params.rtl }}
      {{ if .Site.IsServer }}
        {{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" "enableSourceMap" true ) }}
        {{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts }}
        <link rel="stylesheet" href="{{ $styles.Permalink }}" media="screen">
        <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
      {{ else }}
        {{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" ) }}
        {{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts | minify | fingerprint }}
        <link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen">
        <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen">
      {{ end }}
    {{ end }}
layouts/partials/header.html
@@ -9,7 +9,7 @@
      {{ with .Site.Menus.main}}
        {{ range sort . }}
          <li class="navigation-item">
            <a class="navigation-link" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
            <a class="navigation-link" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
          </li>
        {{ end }}
      {{ end }}
layouts/partials/home.html
@@ -1,7 +1,7 @@
<section class="container centered">
  <div class="about">
    {{ with .Site.Params.avatarurl }}
      <div class="avatar"><img src="{{.}}" alt="avatar"></div>
      <div class="avatar"><img src="{{ . }}" alt="avatar"></div>
    {{ end }}
    <h1>{{ .Site.Params.author }}</h1>
    <h2>{{ .Site.Params.info }}</h2>