Remove staticman configuration

This commit is contained in:
James Skemp 2023-02-11 08:12:59 -06:00
parent 083ed36892
commit cc6eec51f9
6 changed files with 3 additions and 146 deletions

View File

@ -1,4 +1,4 @@
image: registry.gitlab.com/pages/hugo:latest
image: registry.gitlab.com/pages/hugo/hugo_extended:0.40.3
pages:
script:
@ -7,4 +7,4 @@ pages:
paths:
- public
only:
- master
- master

View File

@ -1,13 +1,7 @@
languageCode = "en-us"
title = "Waking Life Movie Transcript"
baseurl = "http://wakinglifemovie.net/"
baseurl = "https://wakinglifemovie.net/"
theme = "wakinglife"
[params]
description = "Transcript for the wonderful movie Waking Life."
[staticman]
endpoint = "https://api.staticman.net/v2/entry/"
username = "JamesSkemp"
repository = "wakinglifemovie.net"
branch = "master"

View File

@ -1,84 +0,0 @@
# Name of the property. You can have multiple properties with completely
# different config blocks for different sections of your site.
# For example, you can have one property to handle comment submission and
# another one to handle posts.
comments:
# (*) REQUIRED
#
# Names of the fields the form is allowed to submit. If a field that is
# not here is part of the request, an error will be thrown.
allowedFields: ["name", "email", "body"]
# (*) REQUIRED
#
# Name of the branch being used. Must match the one sent in the URL of the
# request.
branch: "master"
# Text to use as the commit message or pull request title. Accepts placeholders.
commitMessage: "Add Staticman data for {options.slug}"
# The format of the generated data files. Accepted values are "json", "yaml"
# or "frontmatter"
format: "json"
# List of fields to be populated automatically by Staticman and included in
# the data file. Keys are the name of the field. The value can be an object
# with a `type` property, which configures the generated field, or any value
# to be used directly (e.g. a string, number or array)
generatedFields:
date:
type: date
# Whether entries need to be appproved before they are published to the main
# branch. If set to `true`, a pull request will be created for your approval.
# Otherwise, entries will be published to the main branch automatically.
moderation: true
# Name of the site. Used in notification emails.
name: "wakinglifemovie.net"
# Notification settings. When enabled, users can choose to receive notifications
# via email when someone adds a reply or a new comment. This requires an account
# with Mailgun, which you can get for free at http://mailgun.com.
#notifications:
# Enable notifications
#enabled: true
# (!) ENCRYPTED
#
# Mailgun API key
#apiKey: "1q2w3e4r"
# (!) ENCRYPTED
#
# Mailgun domain (encrypted)
#domain: "4r3e2w1q"
# (*) REQUIRED
#
# Destination path (directory) for the data files. Accepts placeholders.
path: "data/comments/{options.entryId}"
# (*) REQUIRED
#
# Destination path (filename) for the data files. Accepts placeholders.
filename: "{@id}"
# Names of required fields. If any of these isn't in the request or is empty,
# an error will be thrown.
requiredFields: ["name", "email", "body"]
# List of transformations to apply to any of the fields supplied. Keys are
# the name of the field and values are possible transformation types.
transforms:
email: md5
posts:
branch: "master"
generatedFields:
slug:
type: slugify
options:
field: title
tags: ["user-generated"]

View File

@ -1,2 +0,0 @@
{{ partial "staticman/show-comments.html" . }}
{{ partial "staticman/form.html" . }}

View File

@ -1,17 +0,0 @@
<div id="comments-form" class="row">
<div class="large-9 large-centered columns">
<h2>Leave a Comment</h2>
<form method="POST" action="https://api.staticman.net/v2/entry/JamesSkemp/wakinglifemovie.net/master/comments">
<input name="options[redirect]" type="hidden" value="{{ .Permalink }}#comment-submitted" />
<input type="hidden" name="options[entryId]" value="{{ .UniqueID }}" />
<!-- e.g. "2016-01-02-this-is-a-post" -->
<input name="options[slug]" type="hidden" value="{{ if eq .File.BaseFileName "" }}page{{ end }}{{ .File.BaseFileName }}" />
<label>Name<input name="fields[name]" type="text" /></label>
<label>Email<input name="fields[email]" type="email" /></label>
<label>Message<textarea name="fields[body]" rows="10"></textarea></label>
<button type="submit" class="button">Post Comment</button>
</form>
<p>All comments go through a moderation process and may take up to 24 hours to display. See the <a href="https://github.com/JamesSkemp/wakinglifemovie.net/pulls">project repository</a> for all pending comments.</p>
</div>
</div>

View File

@ -1,34 +0,0 @@
<div id="comments" class="row">
<div class="large-9 large-centered columns">
<h2>Comments</h2>
{{ $comments := readDir "data/comments" }}
{{ $.Scratch.Add "hasComments" 0 }}
{{ $entryId := .UniqueID }}
{{ if eq .UniqueID "" }}
{{ $entryId := "page" }}
{{ end }}
{{ range $comments }}
{{ if eq .Name $entryId }}
{{ $.Scratch.Add "hasComments" 1 }}
{{ range $index, $comments := (index $.Site.Data.comments $entryId ) }}
<div class="row">
<div class="large-12 columns">
<img src="https://www.gravatar.com/avatar/{{ .email }}?s=100" alt="{{ .name }}" style="float:left;margin-right:1em;" />
<blockquote>
<p><cite><strong>{{ .name }}</strong> on {{ dateFormat "02/01/2006" .date }}</cite></p>
<p>{{ .body | markdownify }}</p>
</blockquote>
</div>
</div>
{{ end }}
{{ end }}
{{ end }}
{{ if eq ($.Scratch.Get "hasComments") 0 }}
<!--<p>Hey, be the first who comment this article.</p>-->
{{ end }}
</div>
</div>