Compare commits

...
This repository has been archived on 2021-05-20. You can view files and clone it, but cannot push or open issues or pull requests.

1 Commits

Author SHA1 Message Date
2422df5db7
Add (not currently working) settings to generate a SQL db 2021-03-27 00:02:19 -05:00
3 changed files with 41 additions and 0 deletions

View File

@ -4,6 +4,17 @@ theme = "terminal"
paginate = 5
enableGitInfo = true
[mediaTypes]
[mediaTypes."text/sql"]
suffixes = ["sql"]
[outputFormats]
[outputFormats.SQL]
mediaType = "text/sql"
[outputs]
home = ["sql", "html"]
# [permalinks]
# posts = "/:year/:month/:title/"

View File

@ -0,0 +1,17 @@
DROP TABLE IF EXISTS db.blog;
CREATE TABLE db.blog (
id INT NOT NULL AUTO_INCREMENT,
published DATE NOT NULL,
title TEXT NOT NULL,
body TEXT NOT NULL,
url varchar(2048) NOT NULL,
CONSTRAINT id_PK PRIMARY KEY (id)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_general_ci;
CREATE FULLTEXT INDEX blog_body_IDX ON db.blog (body);
{{ block "main" .}}
{{ end }}

View File

@ -0,0 +1,13 @@
{{ define "main" }}
{{ range (where .Pages "Section" "ne" "gist") }}
{{ range .Pages }}
INSERT INTO db.blog (published, title, body, url)
VALUES(
'{{ .Date.Format "2006-01-02" }}',
'{{ plainify .Title }}',
'{{ (plainify .Content) }}',
'{{ .Permalink }}'
);
{{ end }}
{{ end }}
{{ end }}