commands

package
v0.0.0-...-fdec423 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DIR_RWE_MODE = 0777
View Source
const FILE_RW_MODE = 0666

Variables

View Source
var DEFAULT_FRONTMATTER string = `---
title: %s
date: %s
layout: post
lang: %s
tags: []
draft: true
---
`
View Source
var DEFAULT_ORG_DIRECTIVES string = `#+OPTIONS: toc:nil num:nil
#+LANGUAGE: %s
`
View Source
var INIT_CONFIG string = `name: "%s"
author: "%s"
url: "%s"
`
View Source
var INIT_README string = `
# %s

A jorge blog by %s.
`

Functions

func Prompt

func Prompt(label string) string

Prompt the user for a string value

Types

type Build

type Build struct {
	ProjectDir string `arg:"" name:"path" optional:"" default:"." help:"Path to the website project to build."`
	NoMinify   bool   `help:"Disable file minifying."`
}

func (*Build) Run

func (cmd *Build) Run(ctx *kong.Context) error

Read the files in src/ render them and copy the result to target/

type EventBroker

type EventBroker struct {
	// contains filtered or unexported fields
}

The event broker mediates between the file watcher that publishes site rebuild events and the clients listening for them to refresh the browser

type HTMLFileSystem

type HTMLFileSystem struct {
	// contains filtered or unexported fields
}

Tweaks the http file system to construct a server that hides the .html suffix from requests. Based on https://stackoverflow.com/a/57281956/993769

func (HTMLFileSystem) Open

func (htmlFS HTMLFileSystem) Open(name string) (http.File, error)

type Init

type Init struct {
	ProjectDir string `arg:"" name:"path" help:"Directory where to initialize the website project."`
}

func (*Init) Run

func (cmd *Init) Run(ctx *kong.Context) error

Initialize a new jorge project in the given directory, prompting for basic site config and creating default files.

type Post

type Post struct {
	Title string `arg:"" optional:"" help:"Title of the post"`
}

func (*Post) Run

func (cmd *Post) Run(ctx *kong.Context) error

Create a new post template in the given site, with the given title, with pre-filled front matter.

type Serve

type Serve struct {
	ProjectDir string `arg:"" name:"path" optional:"" default:"." help:"Path to the website project to serve."`
	Host       string `short:"H" default:"localhost" help:"Host to run the server on."`
	Port       int    `short:"p" default:"4001" help:"Port to run the server on."`
	NoReload   bool   `help:"Disable live reloading."`
}

func (*Serve) Run

func (cmd *Serve) Run(ctx *kong.Context) error

type Subscription

type Subscription struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL