Add support for Custom HTML

This commit is contained in:
Yash Mehrotra
2021-07-07 07:27:30 +05:30
parent 21286caa7c
commit 42476980b4
4 changed files with 13 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ A minimal opinionated theme for Hugo
- Syntax highlighting - Syntax highlighting
- Math typesetting - Math typesetting
- SEO Ready - SEO Ready
- Support for adding custom HTML, which can be used to add snippets or script tags
## Inspiration ## Inspiration
@@ -33,8 +34,9 @@ git submodule add https://github.com/526avijitgupta/gokarna.git themes/gokarna
- Navbar - Navbar
- Footer - Footer
- Inject html - Inject html (Give example)
- Syntax highlighting (Choose one of emacs, trac, perldoc) - Syntax highlighting (Choose one of emacs, trac, perldoc)
- Avatar sizes
## LICENSE ## LICENSE

View File

@@ -13,6 +13,7 @@ pygmentsStyle = "emacs"
footer = "The Marauders" footer = "The Marauders"
description = "You miss 100% of the shots you don't take" description = "You miss 100% of the shots you don't take"
avatarURL = "https://upload.wikimedia.org/wikipedia/commons/7/7a/1859-Martinique.web.jpg" avatarURL = "https://upload.wikimedia.org/wikipedia/commons/7/7a/1859-Martinique.web.jpg"
customHTML = ""
[menu] [menu]
[[menu.main]] [[menu.main]]

View File

@@ -1,15 +1,24 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="preconnect" href="https://fonts.gstatic.com"> <link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Ubuntu|Quicksand-Medium" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Ubuntu|Quicksand-Medium" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"
integrity="sha512-NhSC1YmyruXifcj/KFRWoC561YpHpc5Jtzgvbuzx5VozKpWvQ+4nXhPdFgmx8xqexRcpAglTj9sIBWINXa8x5w==" integrity="sha512-NhSC1YmyruXifcj/KFRWoC561YpHpc5Jtzgvbuzx5VozKpWvQ+4nXhPdFgmx8xqexRcpAglTj9sIBWINXa8x5w=="
crossorigin="anonymous" referrerpolicy="no-referrer" /> crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" type="text/css" href="/css/main.css"> <link rel="stylesheet" type="text/css" href="/css/main.css">
<link disabled id="dark-theme" rel="stylesheet" href="/css/dark.css"> <link disabled id="dark-theme" rel="stylesheet" href="/css/dark.css">
<script src="https://unpkg.com/feather-icons"></script> <script src="https://unpkg.com/feather-icons"></script>
<script src="/js/main.js"></script> <script src="/js/main.js"></script>
<!-- Option for user to inject custom html -->
{{ if .Site.Params.CustomHTML }}
{{ .Site.Params.CustomHTML | safeHTML }}
{{ end }}
{{ $title := print .Site.Title " | " .Title }} {{ $title := print .Site.Title " | " .Title }}
{{ if .IsHome }}{{ $title = .Site.Title }}{{ end }} {{ if .IsHome }}{{ $title = .Site.Title }}{{ end }}
<title>{{ $title }}</title> <title>{{ $title }}</title>

File diff suppressed because one or more lines are too long