Skip to content

Commit 04a3a8d

Browse files
author
Agil Mammadov
committed
docs: document custom_js, GoatCounter analytics, and recursive menu
1 parent 4f5364d commit 04a3a8d

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ theme_config:
6969
footer: true # Show/hide site footer (default: true)
7070
```
7171

72+
### Analytics
73+
74+
Monoholic has built-in support for [GoatCounter](https://www.goatcounter.com/), a privacy-friendly analytics platform. Add your GoatCounter subdomain to `_config.yml`:
75+
76+
```yaml
77+
goatcounter: your-subdomain
78+
```
79+
80+
This injects the GoatCounter tracking script on every page. Remove the key entirely to disable analytics.
81+
7282
### Menu Configuration
7383

7484
Monoholic uses a data-driven approach to its menu. Create or edit `_data/menu.yml` to define your site's navigation structure.
@@ -90,6 +100,23 @@ entries:
90100
- `content_file`: Path to an external markdown file (e.g., `about.md`) to load content from your root directory.
91101
- `post_list`: Set to `true` to auto-generate a list of your Jekyll posts under this section.
92102

103+
#### Nested Menu Sections
104+
105+
Menu entries can contain nested `entries` to create recursive sub-sections:
106+
107+
```yaml
108+
entries:
109+
- title: projects
110+
entries:
111+
- title: web
112+
content: |
113+
<p>Web projects here.</p>
114+
- title: archive
115+
post_list: true
116+
```
117+
118+
Nesting can go as deep as needed — `menu.html` includes itself recursively for each `entries` array it encounters.
119+
93120
#### Using External Content Files
94121

95122
You can reference external markdown files instead of inline content:
@@ -102,6 +129,21 @@ entries:
102129

103130
This will load and render the content from `about.md` in your site's root directory.
104131

132+
### Per-Page JavaScript
133+
134+
To load custom JavaScript files on a specific page, add a `custom_js` list to the page's front matter:
135+
136+
```yaml
137+
---
138+
layout: post
139+
custom_js:
140+
- my-script
141+
- chart
142+
---
143+
```
144+
145+
Each entry is a filename (without `.js`) relative to `assets/js/`. The example above loads `assets/js/my-script.js` and `assets/js/chart.js` at the bottom of the page body.
146+
105147
## Contributing
106148

107149
Bug reports and pull requests are welcome on GitHub at [https://github.com/stiermid/monoholic](https://github.com/stiermid/monoholic). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](https://www.contributor-covenant.org/) code of conduct.

0 commit comments

Comments
 (0)