Skip to content

Commit

Permalink
Fix CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
pixincreate committed Oct 23, 2023
1 parent 57c360c commit b4d6104
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 21 deletions.
1 change: 1 addition & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ description = "pixincreate's website"
keywords = "blog, homepage, portfolio, resume"
images = [""]

customCSS = ["css/custom.css"]

[[languages.en.params.social]]
name = "github"
Expand Down
5 changes: 0 additions & 5 deletions layouts/404.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{{ define "main" }}

<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="/css/styles.css">
</head>

<div id="spotlight" class="error-404 animated fadeIn">
<p class="img-404">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
Expand Down
5 changes: 0 additions & 5 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{{ define "body" }}

<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="/css/styles.css">
</head>

<body class="{{ if .Site.Params.backgroundImage }} background-image"
style="background-image: url('{{ .Site.Params.backgroundImage }}');" {{ else }}"{{ end }}>
{{ end }}
Expand Down
87 changes: 87 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author"
content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ range .Site.Author }}{{ . }} {{ end }}{{ end }}">
<meta name="description"
content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ if .Params.Description }}{{ .Params.Description }}{{ else }}{{ .Summary | plainify }}{{ end }}{{ end }}" />
<meta name="keywords"
content="{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}" />
<meta name="robots" content="noodp" />
<meta name="theme-color" content="{{ .Site.Params.themeColor }}" />
<link rel="canonical" href="{{ .Permalink }}" />

{{ block "title" . }}
<title>
{{ if .IsHome }}
{{ $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }} {{ end }}
{{ else }}
{{ .Title }} :: {{ $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }}
{{ end }}
</title>
{{ end }}

<!-- CSS -->
{{ range .Site.Params.custom_css -}}
<link rel="stylesheet" href="{{ . | absURL }}">
{{- end }}
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true) }}
{{ $style := resources.Get "scss/main.scss" | resources.ToCSS $options | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}">

{{ range $val := $.Site.Params.customCSS }}
{{ if gt (len $val) 0 }}
<link rel="stylesheet" type="text/css" href="{{ $val }}">
{{ end }}
{{ end }}

<!-- Custom CSS handled here -->
{{ range .Site.Params.customCSS -}}
<link rel="stylesheet" href="{{ . | absURL }}">
{{- end }}

<!-- Icons -->
{{- partial "favicons.html" . }}

{{ template "_internal/schema.html" . }}
{{ template "_internal/twitter_cards.html" . }}

{{ if isset .Site.Taxonomies "series" }}
{{ template "_internal/opengraph.html" . }}
{{ end }}

{{ range .Params.categories }}
<meta property="article:section" content="{{ . }}" />
{{ end }}

{{ if isset .Params "date" }}
<meta property="article:published_time" content="{{ time .Date }}" />
{{ end }}

<!-- RSS -->
{{ with .OutputFormats.Get "rss" -}}
{{ printf `
<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}

<!-- JSON Feed -->
{{ if .OutputFormats.Get "json" }}
<link href="{{ if .OutputFormats.Get " json" }}{{ .Site.BaseURL }}feed.json{{ end }}" rel="alternate"
type="application/json" title="{{ .Site.Title }}" />
{{ end }}

<!-- Custom head tags -->
{{- if templates.Exists "partials/extra-head.html" -}}
{{ partial "extra-head.html" . }}
{{- end }}

<!-- Google Analytics internal template -->
{{- if .Site.GoogleAnalytics }}
{{ template "_internal/google_analytics.html" . }}
{{- end}}

<!-- Plausible.io -->
{{- if $.Site.Params.plausibleDataDomain }}
<script defer data-domain="{{ .Site.Params.plausibleDataDomain }}"
src="{{ .Site.Params.plausibleScriptSource }}"></script>
{{- end}}
4 changes: 0 additions & 4 deletions layouts/shortcodes/back-to-top.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<head>
<link rel="stylesheet" href="/css/styles.css">
</head>

<div class="progress-bar">
<a href="#top">
<button class="back-to-top-button hidden">
Expand Down
3 changes: 0 additions & 3 deletions layouts/shortcodes/contact.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<head>
<link rel="stylesheet" href="/css/styles.css">
</head>
<div id="contact-container">
<form>
<div class="form-group">
Expand Down
4 changes: 0 additions & 4 deletions layouts/shortcodes/youtube.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<head>
<link rel="stylesheet" href="/css/styles.css">
</head>

<div class="box">
<iframe width="100%" height="315" src="https://www.youtube.com/embed/videoseries?list=UUjmblV8NFrB5MpEl7CT130w"
frameborder="0" allowfullscreen id="iframe"></iframe>
Expand Down
File renamed without changes.

0 comments on commit b4d6104

Please sign in to comment.