Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: allow early script embedding #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!DOCTYPE html>
<html>
<head>
{{ partial "custom_head_start.html" . }}

{{ if not .Site.BuildDrafts }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
Expand Down Expand Up @@ -43,7 +45,8 @@
<link rel="stylesheet" href="{{ `assets/syntax.css` | relURL }}">
<link rel="stylesheet" href="{{ `assets/primer-build.css` | relURL }}">
<link rel="stylesheet" href="{{ `assets/style.css` | relURL }}">
<link rel="stylesheet" href="{{ `assets/custom_style.css` | relURL }}">

{{ partial "custom_head_end.html" . }}
</head>


Expand Down
7 changes: 7 additions & 0 deletions layouts/partials/custom_head_end.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{/* Custom HTML head tag contents go here if it needs to be the very last thing within the head.
This is useful for including stylesheets that need to override existing styles.

If you are upgrading from a previous version, just add the following line
to `layouts/partials/custom_head_end.html`:
<link rel="stylesheet" href="{{ `assets/custom_style.css` | relURL }}">
*/}}
5 changes: 5 additions & 0 deletions layouts/partials/custom_head_start.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{/* Custom HTML head tag contents go here if it needs to be the very first thing within the head.
This is useful for scripts such as the cookie consent script from Osano which needs to block other
scripts from setting cookies before the user viewer has given consent to do so. Another example might
be when you are trying to profile the page load you want the script to start recording as early as
possible. */}}
1 change: 0 additions & 1 deletion static/assets/custom_style.css

This file was deleted.