gosling

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: MIT Imports: 6 Imported by: 0

README

Gosling

GoDoc build Go Report Card

gosling generates HTML redirects from redirects.json file provided.

Installing

On macOS

brew install leonidboykov/tap/gosling

On Windows

scoop bucket add gosling https://github.com/leonidboykov/scoop-bucket.git
scoop install gosling

Docker

docker push leonidboykov/gosling:tagname

Check out docs for additional information.

Development documentation is available on GoDoc.

License

gosling is free software licensed under the MIT license.

Documentation

Overview

Package gosling builds html files with redirects commands for static sites

Example:

package main

import (
	"fmt"
	"os"

	"github.com/leonidboykov/gosling"
)

func main() {
	if err := gosling.BuildRedirect("https://example.com", os.Stdout); err != nil {
		fmt.Println(err)
	}
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRedirect

func BuildRedirect(link string, wr io.Writer) error

BuildRedirect builds a redirect to a destination writer

func BuildRedirects

func BuildRedirects(redir Redirects, inpath string) error

BuildRedirects builds redirects to provided folder

Types

type Redirects

type Redirects map[string]string

Redirects holds redirects

func NewRedirects

func NewRedirects(inpath string) (Redirects, error)

NewRedirects parses redirects from a JSON files

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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