mirror of
https://github.com/facundoolano/jorge.git
synced 2024-12-27 21:58:50 +01:00
42 lines
764 B
Go
42 lines
764 B
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/facundoolano/jorge/config"
|
|
"github.com/facundoolano/jorge/site"
|
|
)
|
|
|
|
func Init() error {
|
|
// get working directory
|
|
// default to .
|
|
// if not exist, create directory
|
|
// copy over default files
|
|
fmt.Println("not implemented yet")
|
|
return nil
|
|
}
|
|
|
|
func New() error {
|
|
// prompt for title
|
|
// slugify
|
|
// fail if file already exist
|
|
// create a new .org file with the slug
|
|
// add front matter and org options
|
|
fmt.Println("not implemented yet")
|
|
return nil
|
|
}
|
|
|
|
// Read the files in src/ render them and copy the result to target/
|
|
func Build(root string) error {
|
|
config, err := config.Load(root)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
site, err := site.Load(*config)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return site.Build()
|
|
}
|