jekyll-web-novel 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -7
- data/_config.yml +1 -1
- data/_layouts/home.html +11 -0
- data/admin/config.yml +57 -0
- data/admin/index.html +14 -0
- data/assets/js/forwardNetlifyIdentityToken.js +11 -0
- data/exe/jekyll-web-novel +7 -1
- data/pages/home.md +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a87720528ac76b4683830be3811730fa5ae491baa0f6122114e17a7f46fd1bb6
|
4
|
+
data.tar.gz: a67ad41c504376ae7f34567dce2be1bb84185eceb7f176962bb0f7cc2cbebd76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3091919f10841d008a3e6d1853b190cc60477ab29c0ff2530397494ba17b50d9a69fefafa9544b4f56cf1aa010b2e80096f5daffb241043c6a4c1e6587392446
|
7
|
+
data.tar.gz: 2052fb6881637cdc7580d20ba0b68bc359f992e2065baa184f1bbefab95cd8db1e553ff28b1c86b9567275b55116870b44ec52476d716e485ed67cef15dfa730
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ A [jekyll](https://jekyllrb.com/) website theme designed to host your work in pr
|
|
4
4
|
|
5
5
|
## Features
|
6
6
|
- supper easy to read text formatting that looks great.
|
7
|
-
- styles that respect
|
7
|
+
- styles that respect your dark/light mode preferences.
|
8
8
|
- hidden chapters called previews you can send to your proofreader.
|
9
9
|
- generate boilerplates for chapters and volumes with one command.
|
10
10
|
- Paragraph anchors for easy referencing.
|
@@ -12,6 +12,7 @@ A [jekyll](https://jekyllrb.com/) website theme designed to host your work in pr
|
|
12
12
|
- UI that gets out of the way.
|
13
13
|
- Mobile and desktop friendly interface
|
14
14
|
- configurable copyright footer.
|
15
|
+
- easy setup for netlifyCMS
|
15
16
|
|
16
17
|
### Todo (unimplemented)
|
17
18
|
- Nice book cover display on the home page.
|
@@ -24,6 +25,7 @@ A [jekyll](https://jekyllrb.com/) website theme designed to host your work in pr
|
|
24
25
|
- optional social/donation links
|
25
26
|
- configurable nav to allow for more pages
|
26
27
|
- about the author page
|
28
|
+
- payment features?
|
27
29
|
|
28
30
|
## Installation
|
29
31
|
|
@@ -33,6 +35,7 @@ Add this line to your Jekyll site's `Gemfile`:
|
|
33
35
|
```ruby
|
34
36
|
gem "jekyll-web-novel"
|
35
37
|
gem "jekyll-page-boilerplate" # for the awesome boilerplate's
|
38
|
+
gem "webrick" # because `cannot load such file -- webrick (LoadError)`
|
36
39
|
```
|
37
40
|
|
38
41
|
And add this line to your Jekyll site's `_config.yml`:
|
@@ -49,7 +52,8 @@ Initialize and copy over the necessary files.
|
|
49
52
|
|
50
53
|
$ jekyll-web-novel
|
51
54
|
|
52
|
-
Delete the `index.markdown`, `404.html`, `about.markdown` files
|
55
|
+
Delete the `index.markdown`, `404.html`, `about.markdown`, `_posts` files
|
56
|
+
because they have conflicting paths or are just unneeded.
|
53
57
|
|
54
58
|
Create your boilerplate pages with the `jekyll-page-boilerplate` gem.
|
55
59
|
|
@@ -59,10 +63,26 @@ Create your boilerplate pages with the `jekyll-page-boilerplate` gem.
|
|
59
63
|
|
60
64
|
## CMS Options
|
61
65
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
Jekyll has a list of
|
66
|
+
I use [netlifycms](https://www.netlifycms.org/) for my jekyll cms needs.
|
67
|
+
The source code has an example configuration for this project under `admin/`.
|
68
|
+
|
69
|
+
Jekyll has a [list of cms options](https://jekyllrb.com/resources/#content-management) on their website.
|
70
|
+
Using another cms will require more configurations on your part.
|
71
|
+
|
72
|
+
In the jekyll config enable `use_netlify_cms: true`.
|
73
|
+
This adds a script to the home layout that forwards netlify identity token to the cms.
|
74
|
+
|
75
|
+
On netlify web app your going to want to go into site settings and enable Identify for your site.
|
76
|
+
Set the `registration preferences` to invite only.
|
77
|
+
Then I like to add Github as and external login provider.
|
78
|
+
You will need to enable `Git Gateway` as well.
|
79
|
+
|
80
|
+
Find the identify tab at the top of their site,
|
81
|
+
and invite yourself and a user.
|
82
|
+
I also invited my proofreader/editor.
|
83
|
+
|
84
|
+
Going to `you.site/admin` should ask you to login with netlify.
|
85
|
+
Once done you should find a side bar with collections `pages, chapters, previews`.
|
66
86
|
|
67
87
|
|
68
88
|
## Contributing
|
@@ -73,4 +93,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
|
|
73
93
|
## License
|
74
94
|
|
75
95
|
[MIT License](https://opensource.org/licenses/MIT) for the time being but I have not really decided on a License yet.
|
76
|
-
|
data/_config.yml
CHANGED
data/_layouts/home.html
ADDED
data/admin/config.yml
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# config.yml
|
2
|
+
# Optional config for netlifyCMS
|
3
|
+
|
4
|
+
backend:
|
5
|
+
name: git-gateway
|
6
|
+
branch: netlify
|
7
|
+
# ^ push changes to the netlify branch instead of master
|
8
|
+
# so I can review and merge the changes in before they go live.
|
9
|
+
media_folder: 'assets/uploads'
|
10
|
+
public_folder: "/assets/uploads"
|
11
|
+
# publish_mode: editorial_workflow
|
12
|
+
# ^ Creates new a pull request for every new change 'published'
|
13
|
+
site_url: https://example.com
|
14
|
+
|
15
|
+
collections:
|
16
|
+
- name: pages
|
17
|
+
label: 'Pages'
|
18
|
+
folder: 'pages/'
|
19
|
+
create: false
|
20
|
+
slug: "{{slug}}"
|
21
|
+
summery: "{{title}}"
|
22
|
+
editor:
|
23
|
+
preview: false
|
24
|
+
fields:
|
25
|
+
- { label: 'Title', name: "title", widget: 'string' }
|
26
|
+
- { label: 'Permalink', name: "permalink", widget: 'string', default: '/:basename/', required: false }
|
27
|
+
- { label: 'Body', name: 'body', widget: 'markdown' }
|
28
|
+
|
29
|
+
- name: chapters
|
30
|
+
label: 'Chapters'
|
31
|
+
folder: '_chapters/'
|
32
|
+
create: false
|
33
|
+
slug: "{{slug}}"
|
34
|
+
summery: "{{field.volume}}.{{field.chapter}} {{title}}"
|
35
|
+
editor:
|
36
|
+
preview: false
|
37
|
+
fields:
|
38
|
+
- { label: 'Title', name: "title", widget: 'string' }
|
39
|
+
- { label: 'Chapter', name: "chapter", widget: 'number', default: 01, value_type: 'int' }
|
40
|
+
- { label: 'Volume', name: "volume", widget: 'number', default: 01, value_type: 'int' }
|
41
|
+
- { label: 'Permalink', name: "permalink", widget: 'string', default: '/:basename/', required: false }
|
42
|
+
- { label: 'Body', name: 'body', widget: 'markdown' }
|
43
|
+
|
44
|
+
- name: previews
|
45
|
+
label: 'Previews'
|
46
|
+
folder: '_previews/'
|
47
|
+
create: false
|
48
|
+
slug: "{{slug}}"
|
49
|
+
summery: "{{field.volume}}.{{field.chapter}} {{title}} - preview"
|
50
|
+
editor:
|
51
|
+
preview: false
|
52
|
+
fields:
|
53
|
+
- { label: 'Title', name: "title", widget: 'string' }
|
54
|
+
- { label: 'Chapter', name: "chapter", widget: 'number', default: 01, value_type: 'int' }
|
55
|
+
- { label: 'Volume', name: "volume", widget: 'number', default: 01, value_type: 'int' }
|
56
|
+
- { label: 'Permalink', name: "permalink", widget: 'string', default: '/:basename/', required: false }
|
57
|
+
- { label: 'Body', name: 'body', widget: 'markdown' }
|
data/admin/index.html
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
<!-- admin/index.html -->
|
2
|
+
<!DOCTYPE html>
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7
|
+
<title>Content Manager</title>
|
8
|
+
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<!-- Include the script that builds the page and powers Netlify CMS -->
|
12
|
+
<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
// forward netlify identity tokens to /admin
|
2
|
+
// this is needed for invite links and password resets to work.
|
3
|
+
if (window.netlifyIdentity) {
|
4
|
+
window.netlifyIdentity.on("init", user => {
|
5
|
+
if (!user) {
|
6
|
+
window.netlifyIdentity.on("login", () => {
|
7
|
+
document.location.href = "/admin/";
|
8
|
+
});
|
9
|
+
}
|
10
|
+
});
|
11
|
+
}
|
data/exe/jekyll-web-novel
CHANGED
@@ -16,14 +16,20 @@ class WebNovelInit
|
|
16
16
|
FileUtils.mkpath('_chapters')
|
17
17
|
FileUtils.mkpath('_previews')
|
18
18
|
FileUtils.mkpath('_volumes')
|
19
|
+
FileUtils.mkpath('admin')
|
19
20
|
cp_file('_includes/copyright.md')
|
21
|
+
cp_file('admin/config.yml')
|
20
22
|
cp_file('_config.yml')
|
21
|
-
puts '
|
23
|
+
puts ''
|
24
|
+
puts 'Remember to remove `index.markdown`, `404.html`, `_posts`, and `about.md`'
|
25
|
+
puts ''
|
22
26
|
puts 'You can use the _boilerplates provided with the `jekyll-page-boilerplate` gem.'
|
23
27
|
puts '`$ bplate volume vol=01 -T "Water"`'
|
24
28
|
puts '`$ bplate chapter vol=01 cht=01 -T "My First Chapter"`'
|
25
29
|
puts '`$ bplate preview vol=01 cht=02 -T "Secret Chapter for Proofreading"`'
|
30
|
+
puts ''
|
26
31
|
puts 'Web Novel jekyll template files created.'
|
32
|
+
puts ''
|
27
33
|
end
|
28
34
|
|
29
35
|
def cp_folder(folder)
|
data/pages/home.md
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-web-novel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- opsaaaaa
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- _includes/toc.html
|
119
119
|
- _layouts/chapter.html
|
120
120
|
- _layouts/default.html
|
121
|
+
- _layouts/home.html
|
121
122
|
- _layouts/page.html
|
122
123
|
- _layouts/preview.html
|
123
124
|
- _layouts/root.html
|
@@ -129,9 +130,12 @@ files:
|
|
129
130
|
- _sass/web-novel/header.sass
|
130
131
|
- _sass/web-novel/reader.sass
|
131
132
|
- _sass/web-novel/scrollNav.sass
|
133
|
+
- admin/config.yml
|
134
|
+
- admin/index.html
|
132
135
|
- assets/404.html
|
133
136
|
- assets/css/style.sass
|
134
137
|
- assets/js/bookReader.js
|
138
|
+
- assets/js/forwardNetlifyIdentityToken.js
|
135
139
|
- assets/js/scrollNav.js
|
136
140
|
- exe/jekyll-web-novel
|
137
141
|
- pages/chapters.md
|