flushing out the W.D. so I can start anew

master
Lijero 2018-01-22 15:59:35 -08:00
parent 20efd8efe7
commit e20191c01b
5 changed files with 0 additions and 85 deletions

View File

@ -1,17 +0,0 @@
module Main where
type Seconds = Int
type DomainName = String
type Url = (DomainName, String)
type UserAgent = String
data RobotsTxt = RobotsTxt
{ crawlDelay :: Seconds
, canonicalDomain :: DomainName
, sitemapLocation :: Url
, globalDisallows :: [Url]
, botDisallows :: [(UserAgent, [Url])]
}
main :: IO ()
main = putStrLn ""

View File

@ -1,27 +0,0 @@
module SitemapXml where
type Sitemap = [UrlData]
data ChangeFreq = CFNever
| CFYearly
| CFMonthly
| CFWeekly
| CFDaily
| CFHourly
| CFAlways
instance Show ChangeFreq where
show CFNever = "never"
show CFYearly = "yearly"
show CFMonthly = "monthly"
show CFWeekly = "weekly"
show CFDaily = "daily"
show CFHourly = "hourly"
show CFAlways = "always"
data UrlData = UrlData
{ url :: String
, lastMod :: Maybe String
, changeFreq :: ChangeFreq
, priority :: Priority
}

View File

@ -1,18 +0,0 @@
#lang racket
(define (robots-field name (body '()))
(define robots-field-base (string-append name ":"))
(if (nil? body) robots-field-base
(string-append robots-field-base " " body)))
(define (robots-ua (name "*"))
(string-append "User-agent: " name))
(define (robots-disallow list)
(if (empty? list)
"Disallow:"
(define (robots-config (#:crawl-delay 10))
(string-append
(robots-ua)
(

View File

@ -1,15 +0,0 @@
#lang racket
(require "sitemap.rkt")
(require "robots.rkt")
(define base-url "https://lijero.co")
(define (site-page url body #:priority priority #:lastmod lastmod #:changefreq changefreq)
(cons (sitemap-url (string-append base-url url) #:priority priority #:lastmod lastmod #:changefreq changefreq)
(cons url (xexprs body))))
(define (gen-site pages)
(define sitemap-urls (append* (map (match-lambda ([cons sitemap _] sitemap)) pages)))
(define page-bodies (append* (map (match-lambda ([cons _ page] page)) pages)))
(cons (sitemap sitemap-urls)
(page-bodies)

View File

@ -1,8 +0,0 @@
#lang racket
(require "xexprs/xexprs.rkt")
(define (sitemap urls)
(string-append
"<?xml version="1.0" encoding="UTF-8"?>"
(xexprs
`(urlset #:xmlns "http://www.sitemaps.org/schemas/sitemap/0.9" ,@urls))))