Documentation ¶
Index ¶
- Constants
- func AddContentFile(p string, r int) error
- func AddNotContentFile(p string, r int) error
- func CanSetVersionInfo() bool
- func CopyContentFile(infn, outfn string) (bool, error)
- func CopyNotContentFile(infn, outfn string) (bool, error)
- func CountDraftFile(dir string) (PathJSON, CountDraft, error)
- func GetCurrentString() string
- func GetLogFileName() string
- func GetSemver() string
- func GetVermsg() string
- func GetVersionInfo() error
- func IncMajor() error
- func IncMinor() error
- func IncPatch() error
- func InitLogJSON(dt, sd, dd string)
- func InitVersionInfo()
- func IsDir(filename string) bool
- func IsDraftFile(infn string) (bool, string, error)
- func IsEmpty(filename string) bool
- func IsExist(filename string) bool
- func IsRegularFile(filename string) bool
- func LoadVersionInfo() error
- func ReadContentFile(infn string) (pageparser.ContentFrontMatter, error)
- func SafeMkdir(path string) error
- func SaveConfigFile(outfn string) error
- func SaveCountJSONFile(outfn string, pj PathJSON, cd CountDraft) error
- func SaveLogJSON(outfn string) error
- func SaveVersionInfo() error
- func SetMetabuild(m string) error
- func SetPrerelease(m string) error
- func SetSemver(str string) error
- func SetVermsg(str string)
- func WalkDir(dir string) ([]string, error)
- func WalkDir2(dir string, walkDirFunc func(path string, d fs.DirEntry) error) ([]string, error)
- func WalkDir3(srcdir, dstdir string, ...) error
- type CopyFile
- type CountDraft
- type DraftJSON
- type FileJSON
- type LogJSON
- type PathJSON
- type PathPair
- type Semver
- func (sv *Semver) ForceValue(str string) error
- func (sv *Semver) IncMajor()
- func (sv *Semver) IncMinor()
- func (sv *Semver) IncPatch()
- func (sv *Semver) SetMetabuild(m string)
- func (sv *Semver) SetPrerelease(m string)
- func (sv *Semver) SetValue(ma, mi, pa int, pr, mb string)
- func (sv *Semver) String() string
- type SummaryJSON
- type VersionInfo
Constants ¶
const ( NotExist = iota Copied Overwrited NotUpdated Failed )
Result code of copy content
const DevVersion = "Dev version"
const ExampleConfig = `` /* 275-byte string literal not displayed */
ExampleConfig is the config used within hugo-docs-i18n init.
const ReleaseVersion = "Release version"
const VersionFile = "version.json"
Variables ¶
This section is empty.
Functions ¶
func AddContentFile ¶ added in v0.3.0
Add CopyFile to LogJSON
func AddNotContentFile ¶ added in v0.3.0
func CopyContentFile ¶
copy not-draft file from <infn> to <outfn>, with setting which draft = true for translation.
func CopyNotContentFile ¶
Copy not-content file, including CSS, jpeg, etc.
func CountDraftFile ¶
func CountDraftFile(dir string) (PathJSON, CountDraft, error)
Walk directory, while checking if the file is draft or not?
func IsDraftFile ¶
return if the file is draft or not.
func ReadContentFile ¶
func ReadContentFile(infn string) (pageparser.ContentFrontMatter, error)
Read content file, return FrontMatter and Content
func SaveCountJSONFile ¶
func SaveCountJSONFile(outfn string, pj PathJSON, cd CountDraft) error
Save JSON data to file
func SetMetabuild ¶ added in v0.3.1
func SetPrerelease ¶ added in v0.3.1
Types ¶
type CountDraft ¶
type CountDraft struct { Draft int `json:"draft"` NotDraft int `json:"notdraft"` Total int `json:"total"` Ratio float32 `json:"ratio"` }
Count Not-Draft(translated)/Draft(not-translated) file
func (*CountDraft) Add ¶
func (cd *CountDraft) Add(b bool)
func (*CountDraft) Sum ¶
func (cd *CountDraft) Sum() int
type DraftJSON ¶
type DraftJSON struct { Count CountDraft `json:"count"` Paths PathJSON `json:"paths"` }
DraftJSON
type LogJSON ¶ added in v0.3.0
type LogJSON struct { Header SummaryJSON `json:"header"` Paths FileJSON `json:"paths"` }
LogJSON
func GetLogJSON ¶ added in v0.3.0
func GetLogJSON() *LogJSON
func NewLogJSON ¶ added in v0.3.0
Constructor of LogJSON
func (*LogJSON) AddContentFile ¶ added in v0.3.0
Add CopyFile to LogJSON
func (*LogJSON) AddNotContentFile ¶ added in v0.3.0
func (*LogJSON) SaveLogJSON ¶ added in v0.3.0
Save JSON data to file
type PathJSON ¶
type PathJSON struct {
Files []PathPair `json:"files"`
}
func CopyContentDir ¶
Walk directory, while copying the draft file to
type PathPair ¶
type PathPair struct { Path string `json:"path"` Title string `json:"title"` Draft bool `json:"draft"` }
Hugo file (path/value pair) data
type Semver ¶ added in v0.2.0
Data Semser
func (*Semver) ForceValue ¶ added in v0.2.0
Force to set the value to struct Semver with SemVer format
func (*Semver) SetMetabuild ¶ added in v0.2.0
Set string to Semver.Metabuild
func (*Semver) SetPrerelease ¶ added in v0.2.0
Set string to Semver.Prerelease
type SummaryJSON ¶ added in v0.3.0
type SummaryJSON struct { Date string `json:"date"` SrcDir string `json:"srcdir"` DstDir string `json:"dstdir"` }
Summary
type VersionInfo ¶ added in v0.3.1
VersionInfo data
var GlobalVersionInfo VersionInfo
Global variables