Skip to content

Commit

Permalink
feat: minify js and css
Browse files Browse the repository at this point in the history
  • Loading branch information
danielorihuela committed Jun 4, 2024
1 parent 7c0a078 commit cdf0ae7
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ body {
position: absolute;
z-index: -1;
cursor: default;
text-align: center;
/* text-align: center; */
min-width: 70%;
max-width: 90%;
left: 50%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ body {
padding: 1rem;
margin: 0 auto;
max-width: 100ch;

/* background-color: #18002f;
color: white; */
}

.title {
Expand All @@ -23,10 +26,4 @@ body {
.centered-image {
display: flex;
justify-content: center;
}

p > code {
background-color: #c2c5cb;
border-radius: 4px;
padding: 2px;
}
27 changes: 18 additions & 9 deletions themes/do-cyberpunk-theme/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,43 @@
<meta name="viewport" content="width=device-width, height=device-height">


<link rel="stylesheet" href="/css/everywhere.css" />
{{ $everywhere := resources.Get "css/everywhere.css" | resources.Minify }}
<link rel="stylesheet" href="{{ $everywhere.RelPermalink }}">

<title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>

{{ if .IsHome }}
<link rel="stylesheet" href="/css/desktop.css" />
<link rel="stylesheet" href="/css/icon.css" />
<link rel="stylesheet" href="/css/frame.css" />
{{ $desktop := resources.Get "css/desktop.css" | resources.Minify }}
<link rel="stylesheet" href="{{ $desktop.RelPermalink }}">
{{ $icon := resources.Get "css/icon.css" | resources.Minify }}
<link rel="stylesheet" href="{{ $icon.RelPermalink }}">
{{ $frame := resources.Get "css/frame.css" | resources.Minify }}
<link rel="stylesheet" href="{{ $frame.RelPermalink }}">
{{ else if (eq .Kind "section") }}
<link rel="stylesheet" href="/css/section.css" />
{{ $section := resources.Get "css/section.css" | resources.Minify }}
<link rel="stylesheet" href="{{ $section.RelPermalink }}">
{{ else if (eq .Kind "page") }}
<link rel="stylesheet" href="/css/page.css" />
{{ $page := resources.Get "css/page.css" | resources.Minify }}
<link rel="stylesheet" href="{{ $page.RelPermalink }}">

<!-- Code syntax highlighting -->
<link rel="stylesheet" href="/css/code.css">
{{ $code := resources.Get "css/code.css" | resources.Minify }}
<link rel="stylesheet" href="{{ $code.RelPermalink }}">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
{{ end }}

{{ if (eq .Type "about") }}
<link rel="stylesheet" href="/css/about.css" />
{{ $about := resources.Get "css/about.css" | resources.Minify }}
<link rel="stylesheet" href="{{ $about.RelPermalink }}">
{{ end }}

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

<script type="module" src="/js/frame/index.js"></script>
{{ $index := resources.Get "js/frame/index.js" | resources.Minify }}
<script type="module" src="{{ $index.RelPermalink }}"></script>
</head>

<body>

0 comments on commit cdf0ae7

Please sign in to comment.