chore: remove debug logging
This commit is contained in:
parent
6fb27781f9
commit
aa9232fd07
2 changed files with 2 additions and 6 deletions
|
|
@ -1,9 +1,8 @@
|
||||||
package filehandling
|
package filehandling
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"log/slog"
|
|
||||||
|
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
|
@ -21,7 +20,6 @@ func ParseTags(file []byte) ([]string, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
slog.Debug("parsed front matter", "fm", fm)
|
|
||||||
return fm.Tags, nil
|
return fm.Tags, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,7 +34,6 @@ func parseFrontMatter(file []byte) (*FrontMatter, error) {
|
||||||
if idx := bytes.Index(content, []byte("---")); idx != -1 {
|
if idx := bytes.Index(content, []byte("---")); idx != -1 {
|
||||||
content = bytes.TrimSpace(content[:idx])
|
content = bytes.TrimSpace(content[:idx])
|
||||||
}
|
}
|
||||||
slog.Debug("yaml content to parse", "content", string(content))
|
|
||||||
|
|
||||||
var fm FrontMatter
|
var fm FrontMatter
|
||||||
if err := yaml.Unmarshal(content, &fm); err != nil {
|
if err := yaml.Unmarshal(content, &fm); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import (
|
||||||
|
|
||||||
filehandling "github.com/KristianJBorgwarth/dendrite.daemon/core/file_handling"
|
filehandling "github.com/KristianJBorgwarth/dendrite.daemon/core/file_handling"
|
||||||
"github.com/KristianJBorgwarth/dendrite.daemon/core/models"
|
"github.com/KristianJBorgwarth/dendrite.daemon/core/models"
|
||||||
"github.com/KristianJBorgwarth/dendrite.daemon/core/template"
|
|
||||||
"github.com/KristianJBorgwarth/dendrite.daemon/core/utils"
|
"github.com/KristianJBorgwarth/dendrite.daemon/core/utils"
|
||||||
"github.com/KristianJBorgwarth/dendrite.daemon/persistence/repositories"
|
"github.com/KristianJBorgwarth/dendrite.daemon/persistence/repositories"
|
||||||
"github.com/KristianJBorgwarth/dendrite.daemon/persistence/store"
|
"github.com/KristianJBorgwarth/dendrite.daemon/persistence/store"
|
||||||
|
|
@ -43,7 +42,7 @@ func (h *CreateNoteHandler) Handle(ctx context.Context, raw json.RawMessage) (an
|
||||||
|
|
||||||
notePath := filepath.Join(store.GetVaultStore().Config.VaultPath(), cmd.Directory, slug+".md")
|
notePath := filepath.Join(store.GetVaultStore().Config.VaultPath(), cmd.Directory, slug+".md")
|
||||||
|
|
||||||
data, err := template.RenderTemplate(templatePath, cmd.Title, slug)
|
data, err := filehandling.RenderTemplate(templatePath, cmd.Title, slug)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue