mirror of
https://github.com/studiokaiji/nostr-webhost.git
synced 2025-12-18 23:34:21 +01:00
filePathからbasePathを取り除く処理を記述
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/nbd-wtf/go-nostr"
|
"github.com/nbd-wtf/go-nostr"
|
||||||
"github.com/studiokaiji/nostr-webhost/hostr/cmd/tools"
|
"github.com/studiokaiji/nostr-webhost/hostr/cmd/tools"
|
||||||
@@ -59,7 +60,11 @@ func generateEventsAndAddQueueAllValidStaticTextFiles(priKey, pubKey, indexHtmlI
|
|||||||
tags := nostr.Tags{}
|
tags := nostr.Tags{}
|
||||||
// 置き換え可能なイベントの場合
|
// 置き換え可能なイベントの場合
|
||||||
if replaceable {
|
if replaceable {
|
||||||
fileIdentifier := getReplaceableIdentifier(indexHtmlIdentifier, filePath)
|
// filePathからbasePathを取り除く
|
||||||
|
pathForIdentifier := strings.Replace(filePath, basePath, "", 1)
|
||||||
|
// 識別子を取得
|
||||||
|
fileIdentifier := getReplaceableIdentifier(indexHtmlIdentifier, pathForIdentifier)
|
||||||
|
|
||||||
tags = tags.AppendUnique(nostr.Tag{"d", fileIdentifier})
|
tags = tags.AppendUnique(nostr.Tag{"d", fileIdentifier})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user