Skip to content

Commit

Permalink
update files
Browse files Browse the repository at this point in the history
  • Loading branch information
tib committed May 10, 2024
1 parent 196e8de commit 3f775f2
Show file tree
Hide file tree
Showing 27 changed files with 61 additions and 251 deletions.
File renamed without changes.
14 changes: 0 additions & 14 deletions Sources/Toucan/Formatters/DateFormatter.swift

This file was deleted.

31 changes: 31 additions & 0 deletions Sources/Toucan/Formatters/DateFormatters.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// File.swift
//
//
// Created by Tibor Bodecs on 07/05/2024.
//

import Foundation

struct DateFormatters {

var standard: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy/MM/dd"
return formatter
}()

let rss: DateFormatter = {
let formatter = DateFormatter()
formatter.locale = .init(identifier: "en_US_POSIX")
formatter.timeZone = .init(secondsFromGMT: 0)
formatter.dateFormat = "EEE, dd MMM yyyy HH:mm:ss Z"
return formatter
}()

let sitemap: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd"
return formatter
}()
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 0 additions & 37 deletions Sources/Toucan/Templates/FigureBlockTemplate.swift

This file was deleted.

33 changes: 0 additions & 33 deletions Sources/Toucan/Templates/PostBlockTemplate.swift

This file was deleted.

50 changes: 0 additions & 50 deletions Sources/Toucan/Templates/PostTemplate.swift

This file was deleted.

66 changes: 0 additions & 66 deletions Sources/Toucan/Templates/RSSTemplate.swift

This file was deleted.

40 changes: 0 additions & 40 deletions Sources/Toucan/Templates/SitemapTemplate.swift

This file was deleted.

10 changes: 0 additions & 10 deletions Sources/Toucan/Templates/Template.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import XCTest
@testable import Toucan

final class MetadataParserTests: XCTestCase {
final class FrontMatterParserTests: XCTestCase {

func testBasics() throws {

Expand Down
21 changes: 21 additions & 0 deletions Tests/src/templates/rss.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>\(config.title)</title>
<description>\(config.description)</description>
<link>\(config.baseUrl)</link>
<language>\(config.language)</language>
<lastBuildDate>\(now)</lastBuildDate>
<pubDate>\(formatter.string(from: pubDate))</pubDate>
<ttl>250</ttl>
<atom:link href="\(config.baseUrl)rss.xml" rel="self" type="application/rss+xml"/>

<item>
<guid isPermaLink="true">\(item.permalink)</guid>
<title><![CDATA[ \(item.title) ]]></title>
<description><![CDATA[ \(item.description) ]]></description>
<link>\(item.permalink)</link>
<pubDate>\(formatter.string(from: item.date))</pubDate>
</item>

</channel>
</rss>
8 changes: 8 additions & 0 deletions Tests/src/templates/sitemap.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

<url>
<loc>\(item.permalink)</loc>
<lastmod>\(formatter.string(from: item.date))</lastmod>
</url>

</urlset>

0 comments on commit 3f775f2

Please sign in to comment.