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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6a5557d76311b57c8c7cd04c0a0e243b5129848f7727e396b710b1661c0783e
4
- data.tar.gz: 3248c33768c3eff3c04c60adceb183d66e33b71ebc0cafe7bfb5b30848effe72
3
+ metadata.gz: a87720528ac76b4683830be3811730fa5ae491baa0f6122114e17a7f46fd1bb6
4
+ data.tar.gz: a67ad41c504376ae7f34567dce2be1bb84185eceb7f176962bb0f7cc2cbebd76
5
5
  SHA512:
6
- metadata.gz: eb38d3411d33ab607d597f0baea62ffb0788e277d90638dd6c77c00e61fe12d424ed6562192ca5d576f47d7265464eec6906501e5ed2cb719219a974cef77f7f
7
- data.tar.gz: c6ea927200b0df30a1e4d1c654b2bd0687cdb3a11566f29ba5bd7bf15a16abbcbcc7779b076afedcd62de2a7c05a723a647ae68bd187ec1fef361bd09206b79a
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 you dark/light mode preferences.
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 because they have conflicting paths.
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
- configuring a cms will require more setup on your end.
63
- I use [netlifycms](https://www.netlifycms.org/) myself.
64
- The source code has an example configuration from a different project of mine under `admin/`.
65
- Jekyll has a list of [cms options](https://jekyllrb.com/resources/#content-management) on their website.
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
@@ -16,7 +16,7 @@ github_username: example
16
16
 
17
17
  theme: 'jekyll-web-novel'
18
18
 
19
-
19
+ use_netlify_cms: false
20
20
 
21
21
  novel:
22
22
  title: "The Upper Crust"
@@ -0,0 +1,11 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <div class="reader {{ page.title | slugify}}">
6
+ {{ content }}
7
+ </div>
8
+
9
+ {% if site.use_netlify_cms %}
10
+ <script src="{{ 'assets/js/forwardNetlifyIdentityToken.js' | relative_url }}"></script>
11
+ {% endif %}
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 'Remember to remove `index.markdown`, `404.html`, and `about.md`'
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
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: Web Novel Theme for Jekyll
3
3
  permalink: /
4
- layout: page
4
+ layout: home
5
5
  start_chapter: 1
6
6
  ---
7
7
 
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.5
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