model

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Note

type Note struct {
	Title        string          `json:"title"` // May contains spaces and slashes, like "articles/Hello World"
	Slug         string          `json:"slug"`  // Slugified title, like "my-articles/hello-world"
	Path         string          `json:"path"`  // Full path relative to the base directory, like "My articles/Hello World.md"
	Content      string          `json:"content"`
	ReferencedBy []NoteReference `json:"referenced_by"` // Notes that have wikilinks to this note
	IsPublic     bool            `json:"isPublic"`      // Whether this note is public or private
	Metadata     map[string]any  `json:"metadata"`      // YAML frontmatter metadata
}

func (*Note) BuildSlug

func (n *Note) BuildSlug()

BuildSlug creates a URL-friendly slug from the note's title or existing slug This uses the unified slugification approach for notes (matches engine.SlugifyNoteWithCaseLogic)

func (*Note) DetermineIsPublic

func (n *Note) DetermineIsPublic(folderMetadata map[string]map[string]any)

DetermineIsPublic sets the IsPublic field based on the hierarchy rules: 1. Check the note's own "publish" metadata 2. Check parent folder metadata (if any) 3. Fall back to private by default

type NoteReference

type NoteReference struct {
	Slug  string `json:"slug"`
	Title string `json:"title"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址