Merge branch 'master' of github.com:ndarilek/hugo-sandstorm
This commit is contained in:
commit
775705a7d2
@ -6,3 +6,11 @@ body {
|
|||||||
a {
|
a {
|
||||||
color: #00B7FF;
|
color: #00B7FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
padding 0 10 0 10;
|
||||||
|
}
|
||||||
|
@ -5,9 +5,7 @@ var exec = require("child_process").exec,
|
|||||||
gitBackend = require("git-http-backend"),
|
gitBackend = require("git-http-backend"),
|
||||||
spawn = require("child_process").spawn
|
spawn = require("child_process").spawn
|
||||||
|
|
||||||
router.get('/', (req, res) => res.render("index"));
|
router.get('/', (req, res) => {
|
||||||
|
|
||||||
router.get("/publicId", (req, res) => {
|
|
||||||
const sessionId = req.headers["x-sandstorm-session-id"]
|
const sessionId = req.headers["x-sandstorm-session-id"]
|
||||||
exec(`getPublicId ${sessionId}`, (err, rv) => {
|
exec(`getPublicId ${sessionId}`, (err, rv) => {
|
||||||
if(err)
|
if(err)
|
||||||
@ -18,7 +16,7 @@ router.get("/publicId", (req, res) => {
|
|||||||
const domain = publicId+"."+hostname
|
const domain = publicId+"."+hostname
|
||||||
const url = lines[2]
|
const url = lines[2]
|
||||||
const isDemo = lines[3] == "true"
|
const isDemo = lines[3] == "true"
|
||||||
res.render("publicId", {domain, isDemo, publicId, url})
|
res.render("index", {domain, isDemo, publicId, url})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -2,14 +2,48 @@ extends layout
|
|||||||
|
|
||||||
block content
|
block content
|
||||||
h1 Hugo
|
h1 Hugo
|
||||||
iframe(src = "/publicId" style = "width: 100%; margin: 0; border: 0;")
|
p
|
||||||
|
| Your public site is available at:
|
||||||
|
a(href = url target = "_blank")= url
|
||||||
|
| .
|
||||||
|
- if(!isDemo)
|
||||||
|
p To set up your domain to point at your public site, add the following DNS records to your domain. Replace <code>blog.example.com</code> with your site's hostname.
|
||||||
|
table
|
||||||
|
thead
|
||||||
|
th Name
|
||||||
|
th Type
|
||||||
|
th Value
|
||||||
|
tbody
|
||||||
|
tr
|
||||||
|
td blog.example.com
|
||||||
|
td CNAME
|
||||||
|
td= domain
|
||||||
|
tr
|
||||||
|
td sandstorm-www.blog.example.com
|
||||||
|
td TXT
|
||||||
|
td= publicId
|
||||||
|
h2 Editing your site
|
||||||
p To check out the Git repository containing your site, first add an authorization key to Git:
|
p To check out the Git repository containing your site, first add an authorization key to Git:
|
||||||
iframe#gitAuthorize(style = "width: 100%; height: 55px; margin: 0; border: 0;")
|
iframe#gitAuthorize(style = "width: 100%; height: 25px; margin: 0; border: 0;")
|
||||||
p Then run the following to start with a fresh site:
|
p Then run the following to clone the site:
|
||||||
iframe#gitClone(style = "width: 100%; height: 55px; margin: 0; border: 0;")
|
iframe#gitClone(style = "width: 100%; height: 25px; margin: 0; border: 0;")
|
||||||
|
p Here are a few pointers to help you get started:
|
||||||
|
li
|
||||||
|
| Choose a theme to make your site look nice. Hugo’s
|
||||||
|
a(href = "https://themes.gohugo.io/") theme showcase
|
||||||
|
| is a good place to start.
|
||||||
|
li Add the theme to your Git repository as a subtree at <code>themes/themename</code>.
|
||||||
|
li Add <code>theme = "themename"</code> to <code>Config.toml</code>.
|
||||||
|
li Push the repository, and your new site will be immediately published.
|
||||||
|
h2 Pushing existing site
|
||||||
p If you have an existing Hugo site, run the following to publish in this grain:
|
p If you have an existing Hugo site, run the following to publish in this grain:
|
||||||
iframe#gitPush(style = "width: 100%; height: 55px; margin: 0; border: 0;")
|
iframe#gitPush(style = "width: 100%; height: 50px; margin: 0; border: 0;")
|
||||||
a(href = "/admin/") Administer
|
h2 Admin interface
|
||||||
|
p
|
||||||
|
| You can do simple changes to your site directly in the
|
||||||
|
a(href = "/admin/") admin interface
|
||||||
|
| .
|
||||||
|
|
||||||
script.
|
script.
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
window.parent.postMessage({renderTemplate: {
|
window.parent.postMessage({renderTemplate: {
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
extends layout
|
|
||||||
|
|
||||||
block content
|
|
||||||
p
|
|
||||||
| This site is available at
|
|
||||||
a(href = url target = "_blank")= url
|
|
||||||
| .
|
|
||||||
- if(!isDemo)
|
|
||||||
p Alternatively, you can publish it at your own custom domain by creating the following DNS records:
|
|
||||||
table
|
|
||||||
thead
|
|
||||||
th Name
|
|
||||||
th Type
|
|
||||||
th Value
|
|
||||||
tbody
|
|
||||||
tr
|
|
||||||
td example.com
|
|
||||||
td CNAME
|
|
||||||
td= domain
|
|
||||||
tr
|
|
||||||
td sandstorm-www.example.com
|
|
||||||
td TXT
|
|
||||||
td= publicId
|
|
Loading…
Reference in New Issue
Block a user