func NewPage(title string, targetDir string) *Page {
	date := time.Now()
	page := &Page{
		Date: date.Format(time.RFC3339),
		FilePath: fmt.Sprintf(
			"%s/%s-%s.%s",
			targetDir,
			date.Format(ghFriendlyDateFormat),
			strings.ReplaceAll(strings.ToLower(title), " ", "-"),
			FileExtension,
		),
		Title: title,
	}
	page.Save()
	return page
}
NewPage creates and returns an instance of page
package pages
import (
	"fmt"
	"io/ioutil"
	"os/exec"
	"path/filepath"
	"strings"
	"time"
	"github.com/ericaro/frontmatter"
	"github.com/senorprogrammer/til/src"
)
const (
	ghFriendlyDateFormat = "2006-01-02T15-04-05"
	FileExtension = "md"
)
type Page struct {
	Content  string `fm:"content" yaml:"-"`
	Date     string `yaml:"date"`
	FilePath string `yaml:"filepath"`
	TagsStr  string `yaml:"tags"`
	Title    string `yaml:"title"`
}