Skip to content

Commit

Permalink
Allow extending head tag on page basis
Browse files Browse the repository at this point in the history
  • Loading branch information
undergroundwires committed Dec 25, 2021
1 parent 848b687 commit 26a635d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
48 changes: 33 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,24 @@ This theme was highly inspired by the [hello-friend](https://github.com/panr/hug

## Table of Contents

- [Features](#features)
- [How to start](#how-to-start)
- [How to configure](#how-to-configure)
- [More](#more-things)
- [Built in shortcodes](#built-in-shortcodes)
- [image](#image)
- [Code highlighting](#code-highlighting)
- [Favicon](#favicon)
- [Audio Support](#audio-support)
- [Social Icons](#social-icons)
- [Known issues](#known-issues)
- [How to edit the theme](#how-to-edit-the-theme)
- [Changelog](CHANGELOG.md)
- [Sponsoring](#sponsoring)
- [Licence](#licence)
- [Hello Friend NG](#hello-friend-ng)
- [General informations](#general-informations)
- [Table of Contents](#table-of-contents)
- [Features](#features)
- [How to start](#how-to-start)
- [How to configure](#how-to-configure)
- [More things](#more-things)
- [Built-in shortcodes](#built-in-shortcodes)
- [image](#image)
- [Code highlighting](#code-highlighting)
- [Favicon](#favicon)
- [Audio Support](#audio-support)
- [Extending head](#extending-head)
- [Social Icons:](#social-icons)
- [Known issues](#known-issues)
- [How to edit the theme](#how-to-edit-the-theme)
- [Sponsoring](#sponsoring)
- [Licence](#licence)

---

Expand Down Expand Up @@ -163,6 +166,21 @@ In your article add to your front matters part:
audio: path/to/file.mp3
```
### Extending head
You can globally add HTML inside `<head>` tag by creating `layouts/partials/extra-head.html`.

You can also inject into `<head>` tag on individual pages for their different needs using `extend-head` blocks:

```html
{{ define "extend-head" }}
...
<!-- Custom meta tags, CSS imports etc. -->
{{ end }}
```

## Social Icons:

A large variety of social icons are available and can be configured like this:
Expand Down
1 change: 1 addition & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html lang="{{ .Site.Language }}">
<head>
{{ partial "head.html" . }}
{{ block "extend-head" . }}{{ end }}
</head>

{{ block "body" . }}
Expand Down

0 comments on commit 26a635d

Please sign in to comment.