Documentation ¶
Overview ¶
Package sitemap generates a complete list of pages available on the website. The generated list is formatted as an XML document and can be saved to a file stored in webroot of the site for search engine bot parsing.
Index ¶
- Constants
- Variables
- func AbsPaths(base string) ([28]string, error)
- func AbsPathsH3(db *sql.DB, base string) ([]string, error)
- func Color404(i int) string
- func ColorCode(i int) string
- func Create(db *sql.DB, w io.Writer, dir string) 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(db *sql.DB) ([]string, error)
- func Sections(db *sql.DB) ([]string, error)
- func Sorts() []string
- type IDs
- type Options
- type Root
- type Style
Constants ¶
const ( // Location is the URL of the website. Location = "https://defacto2.net" // DockerLoc is the URL for the developer hosted on a Docker container. DockerLoc = "http://localhost:8560" // Namespace is the XML name space. Namespace = "http://www.sitemaps.org/schemas/sitemap/0.9" // 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")
var ErrPointer = errors.New("pointer value cannot be nil")
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.