← GDG /

#272 gdtest_tag_location

#272 gdtest_tag_location OK CONFIG
Tag pills at top vs. bottom with per-page overrides
Six user-guide pages testing tag_location placement. The global default is set to 'bottom' so tags appear after page metadata. Three pages have frontmatter dates (date_created, last_update) with show_dates enabled to test bottom-placed tags appearing after the metadata block. Two pages override to 'top' via tag-location frontmatter, one page explicitly sets 'bottom', one page has no dates (tags under <hr>), and one page has no tags at all.
View Site → Build Log ๐Ÿงช Test Coverage

Build Mode

● Has great-docs.yml

This package ships a pre-supplied config. The great-docs init step is skipped and great-docs build uses the spec-defined configuration directly. Tests specific config options and their rendered output.

Dimensions

T3
T3Tag location top vs. bottom with per-page overridestags

Source Files

๐Ÿ“ gdtest_tag_location/
๐Ÿ“„ __init__.py
"""A test package for the tag location feature."""

__version__ = "0.1.0"
__all__ = ["Gadget", "make_gadget"]


class Gadget:
    """
    A simple gadget.

    Parameters
    ----------
    label
        Display label for the gadget.
    """

    def __init__(self, label: str):
        self.label = label

    def activate(self) -> str:
        """
        Activate the gadget.

        Returns
        -------
        str
            Activation message.
        """
        return f"Gadget {self.label} activated"


def make_gadget(label: str) -> Gadget:
    """
    Create a new gadget.

    Parameters
    ----------
    label
        Display label for the gadget.

    Returns
    -------
    Gadget
        A new gadget instance.
    """
    return Gadget(label)
๐Ÿ“ user_guide/
๐Ÿ“„ 01-intro.qmd
---
title: Introduction
tags: [Setup, Python]
date_created: "2025-06-01"
last_update:
  date: "2026-03-15"
  author: "Alice"
---

Welcome! This page inherits the global tag location (bottom)
and has page metadata (dates + author). Tags should appear
*after* the metadata block at the bottom.
๐Ÿ“„ 02-api-guide.qmd
---
title: API Guide
tags: [API, Python]
tag-location: top
date_created: "2025-07-10"
last_update:
  date: "2026-02-20"
---

This page overrides the global setting and places tags at the top,
right below the title. Page metadata still appears at the bottom.

## Using the API

Import and use gadgets in your code.
๐Ÿ“„ 03-advanced.qmd
---
title: Advanced Patterns
subtitle: Power-user techniques
tags: [Python, API]
date_created: "2025-08-22"
last_update:
  date: "2026-04-01"
  author: "Bob"
---

This page inherits the global tag location (bottom) and has
both a subtitle and page metadata. Tags should appear after
the metadata block.

## Multi-Gadget Workflows

Combine multiple gadgets for complex tasks.
๐Ÿ“„ 04-setup.qmd
---
title: Setup Guide
tags: [Setup]
tag-location: bottom
---

This page explicitly sets tag-location to bottom and has
no date metadata. Tags should appear under a horizontal
rule at the end of content.

## Installation

Install the package via pip.
๐Ÿ“„ 05-tips.qmd
---
title: Tips and Tricks
description: Handy shortcuts and lesser-known features.
tags: [Python, Setup]
tag-location: top
---

This page overrides to top and has a description field.

## Shortcuts

Use keyboard shortcuts for faster workflows.
๐Ÿ“„ 06-faq.qmd
---
title: FAQ
---

This page has no tags. No tag pills should appear anywhere.
๐Ÿ“„ README.md
# gdtest-tag-location

A test package demonstrating the tag_location feature.

Tags can appear at the top (below title) or bottom (after metadata)
of each page. The global default is set in great-docs.yml and
individual pages can override via tag-location frontmatter.
๐Ÿ“„ great-docs.yml
display_name: Tag Location Demo
site:
  show_dates: true
tags:
  enabled: true
  index_page: true
  show_on_pages: true
  hierarchical: true
  location: bottom
  icons:
    Setup: download
    Python: code
    API: plug