Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unique identifier to docs archetype #806

Closed
h-enk opened this issue Jun 29, 2022 · 2 comments
Closed

Add unique identifier to docs archetype #806

h-enk opened this issue Jun 29, 2022 · 2 comments
Milestone

Comments

@h-enk
Copy link
Member

h-enk commented Jun 29, 2022

@h-enk In your tutorial here, you need to mention that docs/overview/_index.md also has to be created. Otherwise, the new page does not appear in the docs menu.

Moreover, when I follow this step from the tutorial, the running dev server gives me a warning:

WARN 2022/06/28 23:07:40 "/Users/<...>/Sites/doks/content/en/docs/prologue/introduction.md:1:1": duplicate menu entry with identifier "Introduction" in menu "docs"

Originally posted by @ameotoko in #715 (comment)

@h-enk h-enk added this to the v0.5.0 milestone Jul 5, 2022
@h-enk h-enk changed the title Add unique identifier to docs archetype Add ~~unique~~ identifier to docs archetype Jul 7, 2022
@h-enk h-enk changed the title Add ~~unique~~ identifier to docs archetype Add identifier to docs archetype Jul 7, 2022
@h-enk
Copy link
Member Author

h-enk commented Jul 7, 2022

876ad1c

Note that (to be documented), identifier needs to be unique. However (unfortunately), can't use .Parent for this.

Example ./archetypes/docs.md

---
title: "{{ replace .Name "-" " " | title }}"
description: ""
lead: ""
date: {{ .Date }}
lastmod: {{ .Date }}
draft: true
images: []
menu:
  docs:
    parent: ""
    identifier: "{{ .Name }}"
weight: 999
toc: true
---

See also:

@h-enk
Copy link
Member Author

h-enk commented Jul 7, 2022

b468211

For now, made it unique using {{ delimit (shuffle (split (md5 .Name) "" )) "" }},

Resources:

@h-enk h-enk changed the title Add identifier to docs archetype Add unique identifier to docs archetype Jul 7, 2022
@h-enk h-enk closed this as completed Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant