Count visits with GoatCounter, as the blog does
Both pages load the blog's GoatCounter site code. Paths are prefixed with the host so this site's pages stay separate from the blog's in the dashboard. The Green Man page gets the lines from build_web.py. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
94871348df
commit
833440f254
5 files changed
+11
-1
No files matched your search
@@ -17,6 +17,7 @@ Kestrel's Builds is a static site of craft build write-ups. Builds vary (foam an
|
|||||||
- Everything in `greenman/` is generated by `greenman-src/`: run `uv run build.py` there and it rewrites `greenman/index.html`, `img/`, `dl/` and `og-image.jpg`. Never hand-edit `greenman/`; change the source and rebuild. The back links, favicon line, description, canonical and Open Graph tags are all written by `greenman-src/build_web.py`.
|
- Everything in `greenman/` is generated by `greenman-src/`: run `uv run build.py` there and it rewrites `greenman/index.html`, `img/`, `dl/` and `og-image.jpg`. Never hand-edit `greenman/`; change the source and rebuild. The back links, favicon line, description, canonical and Open Graph tags are all written by `greenman-src/build_web.py`.
|
||||||
- `deploy` must never upload a generator. Any new source folder must be named `<build>-src/` so the existing exclude covers it; check with `./deploy -n`.
|
- `deploy` must never upload a generator. Any new source folder must be named `<build>-src/` so the existing exclude covers it; check with `./deploy -n`.
|
||||||
- Keep the apostrophe in the index's `<meta name="description">` written as `'`. It is deliberate: the opengraph.xyz preview checker cut the description off at a plain apostrophe.
|
- Keep the apostrophe in the index's `<meta name="description">` written as `'`. It is deliberate: the opengraph.xyz preview checker cut the description off at a plain apostrophe.
|
||||||
|
- Visits are counted by GoatCounter, the same site code as the blog (`kestrelsnest`). Every page carries the two-line snippet in its head; the first line prefixes the path with the host, so `/` here is recorded as `builds.kestrelsnest.social/` and does not merge with the blog's `/`. In `greenman/` it is written by `ANALYTICS` in `greenman-src/build_web.py`.
|
||||||
- Share previews: `og.png` at the root is a 1200x630 screenshot of the top of the index, so retake it when the index's first card changes. Each build has its own `og-image.jpg` (1200x630) in its folder and its own description and Open Graph tags.
|
- Share previews: `og.png` at the root is a 1200x630 screenshot of the top of the index, so retake it when the index's first card changes. Each build has its own `og-image.jpg` (1200x630) in its folder and its own description and Open Graph tags.
|
||||||
|
|
||||||
## Adding a build
|
## Adding a build
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ greenman-src/ - Generator for everything in greenman/ (not deployed); see it
|
|||||||
1. Make a folder for it, named in lowercase with no spaces (`greenman`, `atompunk`). Put its page at `<folder>/index.html`, with its images and downloads inside the folder so its links stay relative.
|
1. Make a folder for it, named in lowercase with no spaces (`greenman`, `atompunk`). Put its page at `<folder>/index.html`, with its images and downloads inside the folder so its links stay relative.
|
||||||
2. In the top-level `index.html`, copy an `<a class="build">` card to the top of the list and change the link, image, alt text, title and the three lines of text. The newest build carries the extra class `first`, which gives it the full-width card; take `first` off the one it replaces. Card images are cropped to fit, so set `object-position` for the new image as `.greenman` does.
|
2. In the top-level `index.html`, copy an `<a class="build">` card to the top of the list and change the link, image, alt text, title and the three lines of text. The newest build carries the extra class `first`, which gives it the full-width card; take `first` off the one it replaces. Card images are cropped to fit, so set `object-position` for the new image as `.greenman` does.
|
||||||
3. Give the new build's page a link back to the index, as `greenman/index.html` has at its top and bottom: `<a href="../">← Kestrel's Builds</a>`.
|
3. Give the new build's page a link back to the index, as `greenman/index.html` has at its top and bottom: `<a href="../">← Kestrel's Builds</a>`.
|
||||||
4. In the page's head, link the shared icon (`<link rel="icon" href="../favicon.svg">`) and add its own description, canonical and Open Graph tags. Its share image is a 1200 x 630 `og-image.jpg` in the build's folder.
|
4. In the page's head, link the shared icon (`<link rel="icon" href="../favicon.svg">`) and add its own description, canonical and Open Graph tags, and the two GoatCounter lines from the index's head. Its share image is a 1200 x 630 `og-image.jpg` in the build's folder.
|
||||||
5. Retake `og.png`, a 1200 x 630 screenshot of the top of the index, since the first card has changed.
|
5. Retake `og.png`, a 1200 x 630 screenshot of the top of the index, since the first card has changed.
|
||||||
6. Run `./deploy -n` to check what will be uploaded, then `./deploy`.
|
6. Run `./deploy -n` to check what will be uploaded, then `./deploy`.
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ DESCRIPTION = 'A half-mask of oak leaves, acorns and bark, built to be worn with
|
|||||||
OG_DESCRIPTION = 'A half-mask of oak leaves, acorns and bark, built to be worn with glasses. Everything you need to make your own.'
|
OG_DESCRIPTION = 'A half-mask of oak leaves, acorns and bark, built to be worn with glasses. Everything you need to make your own.'
|
||||||
OG_ALT = 'A Green Man half-mask worn with glasses: a crown of painted oak leaves above a bark brow ridge, with acorns at the temples and a leaf over the nose.'
|
OG_ALT = 'A Green Man half-mask worn with glasses: a crown of painted oak leaves above a bark brow ridge, with acorns at the temples and a leaf over the nose.'
|
||||||
|
|
||||||
|
# The same GoatCounter site as the blog. Paths are prefixed with the host so this site's pages do not merge with the blog's.
|
||||||
|
ANALYTICS = '''<script>window.goatcounter = {path: function(p) { return location.host + p }}</script>
|
||||||
|
<script data-goatcounter="https://kestrelsnest.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>'''
|
||||||
|
|
||||||
CSS = '''
|
CSS = '''
|
||||||
/* Same ink, bone and gold as the builds index and Kestrel's Hall, and the same serif. Drawings stay on light paper with sans labels.
|
/* Same ink, bone and gold as the builds index and Kestrel's Hall, and the same serif. Drawings stay on light paper with sans labels.
|
||||||
layout: one reading column of guide text; each step is a drawing beside its instructions, stacking on phones */
|
layout: one reading column of guide text; each step is a drawing beside its instructions, stacking on phones */
|
||||||
@@ -102,6 +106,7 @@ def build(out=str(OUT / 'index.html')):
|
|||||||
<meta property="og:image:alt" content="{OG_ALT}">
|
<meta property="og:image:alt" content="{OG_ALT}">
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
<meta name="theme-color" content="#14181a">
|
<meta name="theme-color" content="#14181a">
|
||||||
|
{ANALYTICS}
|
||||||
<style>{CSS}</style>
|
<style>{CSS}</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -18,6 +18,8 @@
|
|||||||
<meta property="og:image:alt" content="A Green Man half-mask worn with glasses: a crown of painted oak leaves above a bark brow ridge, with acorns at the temples and a leaf over the nose.">
|
<meta property="og:image:alt" content="A Green Man half-mask worn with glasses: a crown of painted oak leaves above a bark brow ridge, with acorns at the temples and a leaf over the nose.">
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
<meta name="theme-color" content="#14181a">
|
<meta name="theme-color" content="#14181a">
|
||||||
|
<script>window.goatcounter = {path: function(p) { return location.host + p }}</script>
|
||||||
|
<script data-goatcounter="https://kestrelsnest.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
|
||||||
<style>
|
<style>
|
||||||
/* Same ink, bone and gold as the builds index and Kestrel's Hall, and the same serif. Drawings stay on light paper with sans labels.
|
/* Same ink, bone and gold as the builds index and Kestrel's Hall, and the same serif. Drawings stay on light paper with sans labels.
|
||||||
layout: one reading column of guide text; each step is a drawing beside its instructions, stacking on phones */
|
layout: one reading column of guide text; each step is a drawing beside its instructions, stacking on phones */
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
<meta property="og:image:width" content="1200">
|
<meta property="og:image:width" content="1200">
|
||||||
<meta property="og:image:height" content="630">
|
<meta property="og:image:height" content="630">
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
|
<script>window.goatcounter = {path: function(p) { return location.host + p }}</script>
|
||||||
|
<script data-goatcounter="https://kestrelsnest.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
|
||||||
<style>
|
<style>
|
||||||
/* Sister page to Kestrel's Hall: same ink, bone and gold, same serif, one card per build. */
|
/* Sister page to Kestrel's Hall: same ink, bone and gold, same serif, one card per build. */
|
||||||
:root {
|
:root {
|
||||||
|
|||||||
Reference in new issue
Block a user