Skip to content

Commit

Permalink
Merge pull request #31 from clburlison/fix-css-site-baseurl
Browse files Browse the repository at this point in the history
Fix broken css when using a sub directory
  • Loading branch information
enten committed Jan 23, 2017
2 parents d4cb174 + a1bcbea commit 8a7fcc7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions layouts/partials/base/imports.html
@@ -1,9 +1,10 @@
{{ $baseurl := .Site.BaseURL }}
{{ "<!--[if lt IE 9]>" | safeHTML }}
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
{{ "<![endif]-->" | safeHTML }}

<link href='https://fonts.googleapis.com/css?family=Merriweather:300%7CRaleway%7COpen+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="{{ "/css/font-awesome.min.css" | absURL }}">
<link rel="stylesheet" href="{{ "/css/style.css" | absURL }}">
{{ if isset .Site.Params "highlight" }}<link rel="stylesheet" href="{{ "/css/highlight/" | absURL }}{{ .Site.Params.highlight }}.css">{{ end }}
<link rel="stylesheet" href="{{ $baseurl }}css/font-awesome.min.css">
<link rel="stylesheet" href="{{ $baseurl }}css/style.css">
{{ if isset .Site.Params "highlight" }}<link rel="stylesheet" href="{{ $baseurl }}css/highlight/{{ .Site.Params.highlight }}.css">{{ end }}

1 comment on commit 8a7fcc7

@shantanugoel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this the right fix. This will cause problems if baseurl doesn't have trailing slash like I fixed in #32 for another instance. Better fix is to replace absURL with relURL in original code.

Please sign in to comment.