Skip to content

Commit

Permalink
Merge pull request #7 from brokenhandsio/vapor2
Browse files Browse the repository at this point in the history
Vapor 2
  • Loading branch information
0xTim committed May 24, 2017
2 parents 04f1c23 + c5139e6 commit 884e4b4
Show file tree
Hide file tree
Showing 17 changed files with 271 additions and 173 deletions.
10 changes: 6 additions & 4 deletions Config/crypto.json
@@ -1,11 +1,13 @@
{
"hash": {
"method": "sha256",
"key": "password"
"encoding": "hex",
"key": "fdea1cef4c46ebO2"
},

"cipher": {
"method": "chacha20",
"key": "passwordpasswordpasswordpassword",
"iv": "password"
"method": "aes256",
"encoding": "base64",
"key": "9vGTTv7CiDC3FiRxGrh1nKmz13lt1AN0myV+Aziw5HQ="
}
}
24 changes: 12 additions & 12 deletions Config/droplet.json
Expand Up @@ -5,16 +5,16 @@
"log": "console",
"hash": "crypto",
"cipher": "crypto",
"middleware": {
"server": [
"file",
"validation",
"type-safe",
"date",
"sessions"
],
"client": [
]
}
"view": "leaf",
"middleware": [
"security-headers",
"blog-error",
"date",
"file",
"steampress-sessions",
"blog-persist"
],
"commands": [
"prepare"
]
}
25 changes: 25 additions & 0 deletions Config/fluent.json
@@ -0,0 +1,25 @@
{
"driver": "memory",

"//": "Naming convention to use for creating foreign id keys,",
"//": "e.g., `user_id`",
"//": "`camelCase` option is also available.",
"keyNamingConvention": "snake_case",

"//": "Name of the table Fluent uses to track migrations",
"migrationEntityName": "fluent",

"//": "Character used to join pivot tables, e.g., `user_pet`",
"pivotNameConnector": "_",

"//": "If true, foreign keys will automatically be added",
"//": "to any `builder.foreignId(...)` calls.",
"autoForeignKeys": true,

"//": "Key to specify page number for paginated responses",
"//": "e.g., `?page=2` ",
"defaultPageKey": "page",

"//": "Default page size if not otherwise specified on models",
"defaultPageSize": 10
}
3 changes: 3 additions & 0 deletions Config/production/csp.json
@@ -0,0 +1,3 @@
{
"report-uri": "$CSP_REPORT_URI"
}
3 changes: 3 additions & 0 deletions Config/production/disqus.json
@@ -0,0 +1,3 @@
{
"disqusName": "$DISQUS_NAME"
}
3 changes: 3 additions & 0 deletions Config/twitter.json
@@ -0,0 +1,3 @@
{
"siteHandle": "brokenhandsio"
}
126 changes: 78 additions & 48 deletions Package.pins
Expand Up @@ -2,154 +2,184 @@
"autoPin": true,
"pins": [
{
"package": "CLibreSSL",
"package": "Auth",
"reason": null,
"repositoryURL": "https://github.com/vapor/clibressl.git",
"repositoryURL": "https://github.com/vapor/auth.git",
"version": "1.0.0"
},
{
"package": "AuthProvider",
"reason": null,
"repositoryURL": "https://github.com/vapor/auth-provider.git",
"version": "1.0.2"
},
{
"package": "BCrypt",
"reason": null,
"repositoryURL": "https://github.com/vapor/bcrypt.git",
"version": "1.0.0"
},
{
"package": "Bits",
"reason": null,
"repositoryURL": "https://github.com/vapor/bits.git",
"version": "1.0.0"
},
{
"package": "CTLS",
"reason": null,
"repositoryURL": "https://github.com/vapor/ctls.git",
"version": "1.0.0"
},
{
"package": "Console",
"reason": null,
"repositoryURL": "https://github.com/vapor/console.git",
"version": "1.0.2"
"version": "2.0.0"
},
{
"package": "Core",
"reason": null,
"repositoryURL": "https://github.com/vapor/core.git",
"version": "1.1.1"
"version": "2.0.1"
},
{
"package": "Crypto",
"reason": null,
"repositoryURL": "https://github.com/vapor/crypto.git",
"version": "1.1.0"
"version": "2.0.0"
},
{
"package": "Debugging",
"reason": null,
"repositoryURL": "https://github.com/vapor/debugging.git",
"version": "1.0.0"
},
{
"package": "Engine",
"reason": null,
"repositoryURL": "https://github.com/vapor/engine.git",
"version": "1.3.12"
"version": "2.0.0"
},
{
"package": "Fluent",
"reason": null,
"repositoryURL": "https://github.com/vapor/fluent.git",
"version": "1.4.3"
"version": "2.0.1"
},
{
"package": "JSON",
"package": "FluentProvider",
"reason": null,
"repositoryURL": "https://github.com/vapor/json.git",
"version": "1.0.6"
"repositoryURL": "https://github.com/vapor/fluent-provider.git",
"version": "1.0.0"
},
{
"package": "Jay",
"package": "JSON",
"reason": null,
"repositoryURL": "https://github.com/DanToml/Jay.git",
"version": "1.0.1"
"repositoryURL": "https://github.com/vapor/json.git",
"version": "2.0.1"
},
{
"package": "Leaf",
"reason": null,
"repositoryURL": "https://github.com/vapor/leaf.git",
"version": "1.0.7"
"version": "2.0.0"
},
{
"package": "LeafMarkdown",
"package": "LeafProvider",
"reason": null,
"repositoryURL": "https://github.com/brokenhandsio/LeafMarkdown.git",
"version": "0.2.1"
"repositoryURL": "https://github.com/vapor/leaf-provider.git",
"version": "1.0.0"
},
{
"package": "MarkdownProvider",
"reason": null,
"repositoryURL": "https://github.com/vapor-community/markdown-provider.git",
"version": "1.0.0"
},
{
"package": "Multipart",
"reason": null,
"repositoryURL": "https://github.com/vapor/multipart.git",
"version": "1.0.3"
"version": "2.0.0"
},
{
"package": "Node",
"reason": null,
"repositoryURL": "https://github.com/vapor/node.git",
"version": "1.0.1"
"version": "2.0.1"
},
{
"package": "Paginator",
"package": "Random",
"reason": null,
"repositoryURL": "https://github.com/nodes-vapor/paginator",
"version": "0.4.4"
},
{
"package": "PathIndexable",
"reason": null,
"repositoryURL": "https://github.com/vapor/path-indexable.git",
"repositoryURL": "https://github.com/vapor/random.git",
"version": "1.0.0"
},
{
"package": "Polymorphic",
"package": "Routing",
"reason": null,
"repositoryURL": "https://github.com/vapor/polymorphic.git",
"version": "1.0.1"
"repositoryURL": "https://github.com/vapor/routing.git",
"version": "2.0.0"
},
{
"package": "Routing",
"package": "SQLite",
"reason": null,
"repositoryURL": "https://github.com/vapor/routing.git",
"version": "1.1.0"
"repositoryURL": "https://github.com/vapor/sqlite.git",
"version": "2.0.0"
},
{
"package": "Socks",
"package": "Sockets",
"reason": null,
"repositoryURL": "https://github.com/vapor/socks.git",
"version": "1.2.7"
"repositoryURL": "https://github.com/vapor/sockets.git",
"version": "2.0.1"
},
{
"package": "SteamPress",
"reason": null,
"repositoryURL": "https://github.com/brokenhandsio/SteamPress.git",
"version": "0.10.0"
"version": "0.11.0"
},
{
"package": "SwiftMarkdown",
"reason": null,
"repositoryURL": "https://github.com/brokenhandsio/SwiftMarkdown.git",
"version": "0.1.4"
"repositoryURL": "https://github.com/vapor-community/markdown.git",
"version": "0.3.0"
},
{
"package": "SwiftSoup",
"reason": null,
"repositoryURL": "https://github.com/scinfu/SwiftSoup.git",
"version": "1.3.0"
"version": "1.3.2"
},
{
"package": "TLS",
"reason": null,
"repositoryURL": "https://github.com/vapor/tls.git",
"version": "1.1.2"
"version": "2.0.0"
},
{
"package": "Turnstile",
"package": "Validation",
"reason": null,
"repositoryURL": "https://github.com/stormpath/Turnstile.git",
"version": "1.0.6"
"repositoryURL": "https://github.com/vapor/validation.git",
"version": "0.2.0"
},
{
"package": "Vapor",
"reason": null,
"repositoryURL": "https://github.com/vapor/vapor.git",
"version": "1.5.14"
"version": "2.0.2"
},
{
"package": "VaporSecurityHeaders",
"reason": null,
"repositoryURL": "https://github.com/brokenhandsio/VaporSecurityHeaders.git",
"version": "0.3.0"
"version": "1.0.0"
},
{
"package": "cmark",
"reason": null,
"repositoryURL": "https://github.com/brokenhandsio/cmark.git",
"version": "0.26.2"
"repositoryURL": "https://github.com/brokenhandsio/cmark-gfm.git",
"version": "1.0.0"
}
],
"version": 1
Expand Down
5 changes: 3 additions & 2 deletions Package.swift
Expand Up @@ -3,9 +3,10 @@ import PackageDescription
let package = Package(
name: "SteamPressExample",
dependencies: [
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 1),
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2),
.Package(url: "https://github.com/brokenhandsio/SteamPress.git", majorVersion: 0),
.Package(url: "https://github.com/brokenhandsio/VaporSecurityHeaders.git", majorVersion: 0),
.Package(url: "https://github.com/brokenhandsio/VaporSecurityHeaders.git", majorVersion: 1),
.Package(url: "https://github.com/vapor/leaf-provider.git", majorVersion: 1)
],
exclude: [
"Config",
Expand Down
13 changes: 13 additions & 0 deletions Public/static/css/style.css
Expand Up @@ -42,6 +42,19 @@ h1.lead-title-blog {
margin-left: auto;
margin-right: auto;
display: block;
max-width: 100%;
}

.post-contents {
overflow-wrap: break-word;
word-wrap: break-word;
}

.post-contents blockquote {
background: #f7f7f7;
padding: .5rem 1rem;
padding-top: 1rem;
margin-bottom: 1rem;
}

.form-signin {
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
# SteamPress Example

This is an example site for using [SteamPress](https://github.com/brokenhandsio/SteamPress) with your Vapor website. You can also just use it as your blog! This example site uses Bootstrap 4 for styling so should be fairly easy to make it look how you want. It also uses Markdown to render the blog posts, and has Syntax highlighting for code (obviously!). This site can be viewed at https://steampress-example.herokuapp.com/.
This is an example site for using [SteamPress](https://github.com/brokenhandsio/SteamPress) with your Vapor website. You can also just use it as your blog! This example site uses Bootstrap 4 for styling so should be fairly easy to make it look how you want. It also uses Markdown to render the blog posts, and has Syntax highlighting for code (obviously!). This site can be viewed at https://www.steampress.io/.

This site also provides a good example for all the Leaf files you will need, and the parameters they are given, as well as what you need to send to SteamPress to be create users and posts etc.

Expand Down
1 change: 0 additions & 1 deletion Resources/Views/blog/blog.leaf
Expand Up @@ -58,7 +58,6 @@
</div>
</div>
}

#paginator(posts)

}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Views/blog/blogpost.leaf
Expand Up @@ -16,7 +16,7 @@
<meta property="article:published_time" content="#(post.created_date_iso8601)">
<meta property="og:site_name" content="SteamPress">
#if(post.last_edited_date_iso8601) { <meta property="article:modified_time" content="#(post.last_edited_date_iso8601)"> }
<meta property="article:author" content="#(site_uri)/blog/authors/#(author.username)/">
<meta property="article:author" content="#(site_uri)blog/authors/#(author.username)/">
#loop(post.tags, "tag") {
<meta property="article:tag" content="#(tag.name)">
}
Expand Down
1 change: 0 additions & 1 deletion Resources/Views/blog/profile.leaf
Expand Up @@ -106,7 +106,6 @@
</div>
</div>
}

#paginator(posts)
}
##else() {
Expand Down
1 change: 0 additions & 1 deletion Resources/Views/blog/tag.leaf
Expand Up @@ -64,7 +64,6 @@
</div>
</div>
}

#paginator(posts)
}
##else() {
Expand Down

0 comments on commit 884e4b4

Please sign in to comment.