Custom Head, Analytics & Navigation
🕒 Reading time: 1 min📝 Words: 19👀 Views: Loading...
head.yml — Analytics & Custom Head
File: stalux/config/head.yml
id: head# googleAnalyticsId: "G-XXXXXXXXXX" # Google Analytics 4 tracking ID# bingClarityId: "" # Microsoft Bing Clarity project ID# umami:# id: "" # Umami website ID# url: "" # Umami script URLanyhead: "" # Custom HTML injected into <head>Analytics Tools
| Tool | Config Field | Notes |
|---|---|---|
| Google Analytics | googleAnalyticsId |
Format G-XXXXXXXXXX, theme auto-loads GA4 |
| Bing Clarity | bingClarityId |
Theme auto-loads Clarity tracking |
| Umami | umami.id + umami.url |
Both id and url required |
| Custom snippets | anyhead |
Arbitrary HTML (e.g., verification meta tags, custom fonts) |
navs.yml — Navigation Bar
File: stalux/config/navs.yml
id: navsitems: - title: Home icon: home link: / - title: Posts icon: archive link: /archives # ... more items| Field | Description |
|---|---|
link |
Internal path or full external URL |
icon |
Lucide Icons PascalCase name |
| Search button | Built-in, does not need a nav item |
Common Operations
| Operation | How |
|---|---|
| Add analytics | Set the tracking ID in head.yml, no script needed |
| Custom head HTML | Use anyhead to inject <meta>, <style>, etc. |
| Add a nav item | Append to items in navs.yml; external links need https:// prefix |
| Change favicon | Set site.yml → favicon path |
Custom Head, Analytics & Navigation
Author: xingwangzhe
Article link: https://stalux.needhelp.icu/posts/0035a0ee/
This article is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.