Documentation ¶
Overview ¶
Package sitemap generates an list of pages of the website. The generated XML file is stored on the site's root and can be parsed by search engine bots.
Index ¶
- Constants
- Variables
- func AbsPaths(base string) ([28]string, error)
- func AbsPathsH3(base string) ([]string, error)
- func Color404(i int) string
- func ColorCode(i int) string
- func Create() error
- func FileList(base string) ([]string, error)
- func FindTitle(b []byte) string
- func GetTitle(trimSuffix bool, url string) (string, int, error)
- func Outputs() []string
- func Platforms() ([]string, error)
- func Sections() ([]string, error)
- func Sorts() []string
- type IDs
- type Options
- type Root
- type Style
Constants ¶
const ( // Base URL of the website. Base = "https://defacto2.net" // Local base URL for the websote hosted on a Docker container. LocalBase = "http://localhost:8560" // limit the number of urls as permitted by Bing and Google search engines. Limit = 50000 )
const (
// TitleSuffix is the string normally appended to most browser tabs.
TitleSuffix = " | Defacto2"
)
Variables ¶
var ErrNoIDs = errors.New("no ids to randomise")
Functions ¶
func AbsPathsH3 ¶ added in v1.10.0
AbsPaths returns all the HTML3 static URLs used by the sitemap.
func Color404 ¶ added in v1.10.0
Color404 applies a success checkmark and color when i matches status code 404.
func ColorCode ¶ added in v1.10.0
ColorCode applies a success checkmark and color when i matches status code 200.
func FileList ¶ added in v1.10.0
FileList returns a complete list of URL query strings for the file lists.
func GetTitle ¶ added in v1.10.0
GetTitle returns the string value of the HTML <title> element and status code of a URL.
Types ¶
type IDs ¶ added in v1.10.0
type IDs []int
IDs are the primary keys of the file records.
func GetBlocked ¶ added in v1.10.0
GetBlocked returns all the primary keys of the records with blocked file downloads.
func GetKeys ¶ added in v1.10.0
GetKeys returns all the primary keys of the file records that are public.
func GetSoftDeleteKeys ¶ added in v1.10.0
GetSoftDeleteKeys returns all the primary keys of the file records that are not public and hidden.
func RandBlocked ¶ added in v1.10.0
RandBlocked returns a randomized count of primary keys for records with blocked file downloads.
func RandDeleted ¶ added in v1.10.0
RandDeleted returns a randomized count of primary keys for hidden file records.
func RandIDs ¶ added in v1.10.0
RandBlocked returns a randomized count of primary keys for public file records.
type Style ¶ added in v1.10.0
type Style int
Style the result of a link and its status code.
func (Style) RangeFiles ¶ added in v1.10.0
RangeFiles ranges over the file download URLs.