jekyll-web-novel 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +76 -0
- data/_boilerplates/chapter.md +26 -0
- data/_boilerplates/page.md +11 -0
- data/_boilerplates/preview.md +28 -0
- data/_boilerplates/volume.md +17 -0
- data/_config.yml +100 -0
- data/_includes/chapter_header.html +11 -0
- data/_includes/chapter_list.html +15 -0
- data/_includes/chapter_nav.html +18 -0
- data/_includes/copyright.md +14 -0
- data/_includes/footer.html +4 -0
- data/_includes/head.html +18 -0
- data/_includes/header.html +16 -0
- data/_includes/reader.html +8 -0
- data/_includes/toc.html +12 -0
- data/_layouts/chapter.html +12 -0
- data/_layouts/default.html +6 -0
- data/_layouts/page.html +7 -0
- data/_layouts/preview.html +6 -0
- data/_layouts/root.html +15 -0
- data/_layouts/volume.html +3 -0
- data/_sass/jekyll-web-novel.sass +67 -0
- data/_sass/web-novel/chapter.sass +8 -0
- data/_sass/web-novel/colors.sass +6 -0
- data/_sass/web-novel/footer.sass +13 -0
- data/_sass/web-novel/header.sass +10 -0
- data/_sass/web-novel/reader.sass +77 -0
- data/_sass/web-novel/scrollNav.sass +8 -0
- data/assets/404.html +8 -0
- data/assets/css/style.sass +5 -0
- data/assets/js/bookReader.js +60 -0
- data/assets/js/scrollNav.js +25 -0
- data/exe/jekyll-web-novel +38 -0
- data/pages/chapters.md +9 -0
- data/pages/home.md +16 -0
- metadata +162 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f6a5557d76311b57c8c7cd04c0a0e243b5129848f7727e396b710b1661c0783e
|
4
|
+
data.tar.gz: 3248c33768c3eff3c04c60adceb183d66e33b71ebc0cafe7bfb5b30848effe72
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: eb38d3411d33ab607d597f0baea62ffb0788e277d90638dd6c77c00e61fe12d424ed6562192ca5d576f47d7265464eec6906501e5ed2cb719219a974cef77f7f
|
7
|
+
data.tar.gz: c6ea927200b0df30a1e4d1c654b2bd0687cdb3a11566f29ba5bd7bf15a16abbcbcc7779b076afedcd62de2a7c05a723a647ae68bd187ec1fef361bd09206b79a
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2022 opsaaaaa
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# jekyll-web-novel
|
2
|
+
|
3
|
+
A [jekyll](https://jekyllrb.com/) website theme designed to host your work in progress novel.
|
4
|
+
|
5
|
+
## Features
|
6
|
+
- supper easy to read text formatting that looks great.
|
7
|
+
- styles that respect you dark/light mode preferences.
|
8
|
+
- hidden chapters called previews you can send to your proofreader.
|
9
|
+
- generate boilerplates for chapters and volumes with one command.
|
10
|
+
- Paragraph anchors for easy referencing.
|
11
|
+
- Easy build script to get started quickly
|
12
|
+
- UI that gets out of the way.
|
13
|
+
- Mobile and desktop friendly interface
|
14
|
+
- configurable copyright footer.
|
15
|
+
|
16
|
+
### Todo (unimplemented)
|
17
|
+
- Nice book cover display on the home page.
|
18
|
+
- use said cover image in social cards.
|
19
|
+
- pandoc scripts to generate ebook formats
|
20
|
+
- nice comment implementation
|
21
|
+
- optional config for online content management
|
22
|
+
- Demo site
|
23
|
+
- optional copyright disclaimer popup
|
24
|
+
- optional social/donation links
|
25
|
+
- configurable nav to allow for more pages
|
26
|
+
- about the author page
|
27
|
+
|
28
|
+
## Installation
|
29
|
+
|
30
|
+
After creating a new jekyll project.
|
31
|
+
Add this line to your Jekyll site's `Gemfile`:
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
gem "jekyll-web-novel"
|
35
|
+
gem "jekyll-page-boilerplate" # for the awesome boilerplate's
|
36
|
+
```
|
37
|
+
|
38
|
+
And add this line to your Jekyll site's `_config.yml`:
|
39
|
+
|
40
|
+
```yaml
|
41
|
+
theme: jekyll-web-novel
|
42
|
+
```
|
43
|
+
|
44
|
+
And then execute:
|
45
|
+
|
46
|
+
$ bundle
|
47
|
+
|
48
|
+
Initialize and copy over the necessary files.
|
49
|
+
|
50
|
+
$ jekyll-web-novel
|
51
|
+
|
52
|
+
Delete the `index.markdown`, `404.html`, `about.markdown` files because they have conflicting paths.
|
53
|
+
|
54
|
+
Create your boilerplate pages with the `jekyll-page-boilerplate` gem.
|
55
|
+
|
56
|
+
$ bplate volume vol=01 -T "Water"
|
57
|
+
$ bplate chapter vol=01 cht=01 -T "My First Chapter"
|
58
|
+
$ bplate preview vol=01 cht=02 -T "Secret Chapter for Proofreading"
|
59
|
+
|
60
|
+
## CMS Options
|
61
|
+
|
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
|
+
|
67
|
+
|
68
|
+
## Contributing
|
69
|
+
|
70
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/hello.
|
71
|
+
|
72
|
+
|
73
|
+
## License
|
74
|
+
|
75
|
+
[MIT License](https://opensource.org/licenses/MIT) for the time being but I have not really decided on a License yet.
|
76
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
_boilerplate:
|
3
|
+
path: '_chapters'
|
4
|
+
timestamp: false
|
5
|
+
title: title
|
6
|
+
slug: "{{ vol }}-{{ cht }}-{{ title }}.md"
|
7
|
+
vol: '01'
|
8
|
+
|
9
|
+
title: {{ boilerplate.title }}
|
10
|
+
created: {{ boilerplate.time }}
|
11
|
+
# permalink: /chapters/{{ boilerplate.random_url }}
|
12
|
+
permalink: /chapters/{{ boilerplate.slug }}
|
13
|
+
layout: chapter
|
14
|
+
chapter: {{ boilerplate.cht }}
|
15
|
+
volume: {{ boilerplate.vol }}
|
16
|
+
---
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
### Chapter {{ boilerplate.cht }}
|
21
|
+
|
22
|
+
# {{ boilerplate.title }}
|
23
|
+
|
24
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
25
|
+
|
26
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
_boilerplate:
|
3
|
+
path: pages
|
4
|
+
|
5
|
+
title: {{ boilerplate.title }}
|
6
|
+
created: {{ boilerplate.time }}
|
7
|
+
permalink: {{ boilerplate.slug }}
|
8
|
+
layout: default
|
9
|
+
---
|
10
|
+
|
11
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
_boilerplate:
|
3
|
+
path: '_previews'
|
4
|
+
timestamp: false
|
5
|
+
title: title
|
6
|
+
slug: "{{ vol }}-{{ cht }}-{{ title }}.md"
|
7
|
+
vol: '01'
|
8
|
+
localhost:
|
9
|
+
baseurl:
|
10
|
+
|
11
|
+
# http://localhost:4000/chapters/{{ boilerplate.random_url }}#reader
|
12
|
+
# https://example.com/chapters/{{ boilerplate.random_url }}#reader
|
13
|
+
title: {{ boilerplate.title }}
|
14
|
+
created: {{ boilerplate.time }}
|
15
|
+
permalink: /chapters/{{ boilerplate.random_url }}
|
16
|
+
# permalink: /chapters/{{ boilerplate.slug }}
|
17
|
+
layout: chapter
|
18
|
+
chapter: {{ boilerplate.cht }}
|
19
|
+
volume: {{ boilerplate.vol }}
|
20
|
+
---
|
21
|
+
|
22
|
+
### Chapter {{ boilerplate.cht }}
|
23
|
+
|
24
|
+
# {{ boilerplate.title }}
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
# boilerplate volume vol=00 -T 'Title'
|
3
|
+
_boilerplate:
|
4
|
+
path: '_volumes'
|
5
|
+
timestamp: false
|
6
|
+
title: title
|
7
|
+
slug: "{{ vol }}-{{ title }}.md"
|
8
|
+
|
9
|
+
title: {{ boilerplate.title }}
|
10
|
+
created: {{ boilerplate.time }}
|
11
|
+
volume: {{ boilerplate.vol }}
|
12
|
+
---
|
13
|
+
|
14
|
+
|
15
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
16
|
+
|
17
|
+
|
data/_config.yml
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
title: Web Novel Theme!
|
2
|
+
email: your-email@example.com
|
3
|
+
description: >-
|
4
|
+
a place to display your web novel
|
5
|
+
tagline: >-
|
6
|
+
The home of your web novel
|
7
|
+
baseurl: "/"
|
8
|
+
url: "example.com"
|
9
|
+
|
10
|
+
twitter:
|
11
|
+
username: example
|
12
|
+
card: summary
|
13
|
+
|
14
|
+
twitter_username: example
|
15
|
+
github_username: example
|
16
|
+
|
17
|
+
theme: 'jekyll-web-novel'
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
novel:
|
22
|
+
title: "The Upper Crust"
|
23
|
+
author: "John Doe"
|
24
|
+
lang: en
|
25
|
+
copyright:
|
26
|
+
short: >-
|
27
|
+
**The Upper Crust, Vol 1**
|
28
|
+
|
29
|
+
by **John Doe**
|
30
|
+
|
31
|
+
Copyright © 2022 Example, JJI
|
32
|
+
|
33
|
+
warning: >-
|
34
|
+
PIRATING CONTENT IS ILLEGAL
|
35
|
+
|
36
|
+
long: 'COPYRIGHT.md'
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
collections:
|
41
|
+
chapters:
|
42
|
+
sort_by: chapter
|
43
|
+
output: true
|
44
|
+
previews:
|
45
|
+
sort_by: chapter
|
46
|
+
output: true
|
47
|
+
layout: chapter
|
48
|
+
volumes:
|
49
|
+
sort_by: volume
|
50
|
+
output: false
|
51
|
+
|
52
|
+
|
53
|
+
defaults:
|
54
|
+
- scope:
|
55
|
+
path: "_chapters/*"
|
56
|
+
values:
|
57
|
+
layout: "chapter"
|
58
|
+
type: 'chapters'
|
59
|
+
- scope:
|
60
|
+
path: "_previews/*"
|
61
|
+
values:
|
62
|
+
layout: "preview"
|
63
|
+
type: 'previews'
|
64
|
+
- scope:
|
65
|
+
path: "pages/*"
|
66
|
+
values:
|
67
|
+
layout: "page"
|
68
|
+
|
69
|
+
plugins:
|
70
|
+
- jekyll-feed
|
71
|
+
- jekyll-seo-tag
|
72
|
+
|
73
|
+
|
74
|
+
sass:
|
75
|
+
load_paths:
|
76
|
+
- _sass
|
77
|
+
- node_modules
|
78
|
+
style: compressed
|
79
|
+
|
80
|
+
feed:
|
81
|
+
collections:
|
82
|
+
- chapters
|
83
|
+
|
84
|
+
exclude:
|
85
|
+
- .gitignore
|
86
|
+
- .sass-cache/
|
87
|
+
- .jekyll-cache/
|
88
|
+
- gemfiles/
|
89
|
+
- Gemfile
|
90
|
+
- Gemfile.lock
|
91
|
+
- node_modules/
|
92
|
+
- vendor/bundle/
|
93
|
+
- vendor/cache/
|
94
|
+
- vendor/gems/
|
95
|
+
- vendor/ruby/
|
96
|
+
- package-lock.json
|
97
|
+
- package.json
|
98
|
+
- jekyll-web-novel.gemspec
|
99
|
+
- lib
|
100
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<ol class="list-none">
|
2
|
+
{% for cht in include.chapters %}
|
3
|
+
|
4
|
+
<li>
|
5
|
+
<p>
|
6
|
+
{% unless cht.hide_num %}
|
7
|
+
<span>{{ cht.chapter }}.</span>
|
8
|
+
{% endunless %}
|
9
|
+
<a href="{{ cht.url }}#reader">
|
10
|
+
{{ cht.title }}
|
11
|
+
</a>
|
12
|
+
</p>
|
13
|
+
</li>
|
14
|
+
{% endfor %}
|
15
|
+
</ol>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
<div class="hbox chapter__nav nav">
|
3
|
+
<a
|
4
|
+
class="previous"
|
5
|
+
href={{ "chapters" | relative_url }}>index</a>
|
6
|
+
{% if page.previous %}
|
7
|
+
{% assign hash = page.previous.title | slugify %}
|
8
|
+
<a
|
9
|
+
class="previous"
|
10
|
+
href="{{ page.previous.url }}#reader">Last</a>
|
11
|
+
{% endif %}
|
12
|
+
{% if page.next %}
|
13
|
+
{% assign hash = page.next.title | slugify %}
|
14
|
+
<a
|
15
|
+
class="next big-link"
|
16
|
+
href="{{ page.next.url }}#reader">Next</a>
|
17
|
+
{% endif %}
|
18
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
|
2
|
+
{% assign copyright = site.novel.copyright.short %}
|
3
|
+
{% assign warning = site.novel.copyright.warning %}
|
4
|
+
|
5
|
+
<small class="copyright" id="copyright">
|
6
|
+
{{ copyright | markdownify }}
|
7
|
+
</small>
|
8
|
+
|
9
|
+
{% if warning %}
|
10
|
+
<small class="legal-warning" id="legal-warning">
|
11
|
+
{{ warning | markdownify }}
|
12
|
+
</small>
|
13
|
+
{% endif %}
|
14
|
+
|
data/_includes/head.html
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
<meta charset="UTF-8">
|
4
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>{{ page.title }} | {{site.title }}</title>
|
7
|
+
|
8
|
+
{% seo %}
|
9
|
+
|
10
|
+
<link
|
11
|
+
rel="stylesheet"
|
12
|
+
href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"
|
13
|
+
/>
|
14
|
+
|
15
|
+
<link
|
16
|
+
rel="stylesheet"
|
17
|
+
href={{ "/assets/css/style.css" | relative_url }}
|
18
|
+
/>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
<header scroll-nav class="hbox nav hbox:long">
|
3
|
+
<h1>
|
4
|
+
<a href={{site.baseurl}}>
|
5
|
+
{{ site.title }}
|
6
|
+
</a>
|
7
|
+
</h1>
|
8
|
+
|
9
|
+
<div class="hbox nav">
|
10
|
+
<a href="{{'chapters' | relative_url }}">Index</a>
|
11
|
+
{% if page.start_chapter %}
|
12
|
+
{% assign cht1 = site.chapters | find: 'chapter', page.start_chapter %}
|
13
|
+
<a class="big-link" href="{{ cht1.url }}#reader">Read</a>
|
14
|
+
{% endif %}
|
15
|
+
</div>
|
16
|
+
</header>
|
data/_includes/toc.html
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
<h1 id="#{{page.title | slugify }}">{{ page.title }}</h1>
|
3
|
+
|
4
|
+
{% assign volumes = site.chapters | group_by: 'volume' %}
|
5
|
+
{% for vol in volumes %}
|
6
|
+
|
7
|
+
{% assign volume = site.volumes | find: 'volume', vol.name %}
|
8
|
+
<h2>{{ volume.title }}, Volume {{ volume.volume }}</h2>
|
9
|
+
|
10
|
+
{% include chapter_list.html chapters=vol.items %}
|
11
|
+
|
12
|
+
{% endfor %}
|
data/_layouts/page.html
ADDED
data/_layouts/root.html
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
|
2
|
+
@import 'web-novel/colors'
|
3
|
+
@import 'web-novel/reader'
|
4
|
+
@import 'web-novel/chapter'
|
5
|
+
@import 'web-novel/footer'
|
6
|
+
@import 'web-novel/header'
|
7
|
+
@import 'web-novel/scrollNav'
|
8
|
+
|
9
|
+
\:root
|
10
|
+
font-size: 16px
|
11
|
+
|
12
|
+
html
|
13
|
+
scroll-behavior: smooth
|
14
|
+
|
15
|
+
|
16
|
+
.hbox
|
17
|
+
display: grid
|
18
|
+
grid-auto-flow: column
|
19
|
+
justify-content: space-between
|
20
|
+
align-items: baseline
|
21
|
+
column-gap: 1em
|
22
|
+
|
23
|
+
.vbox > * + *
|
24
|
+
margin-top: 2em
|
25
|
+
|
26
|
+
h1 a
|
27
|
+
color: var(--text-main)
|
28
|
+
text-decoration: none
|
29
|
+
|
30
|
+
.list-none
|
31
|
+
list-style-type: none
|
32
|
+
|
33
|
+
.big-link
|
34
|
+
font-size: 2.8rem
|
35
|
+
|
36
|
+
.big-text
|
37
|
+
font-size: 2.2rem
|
38
|
+
text-indent: 0!important
|
39
|
+
line-height: 1.6em
|
40
|
+
display: block
|
41
|
+
text-align: center
|
42
|
+
|
43
|
+
margin: 1em 0
|
44
|
+
|
45
|
+
.max-width-1
|
46
|
+
max-width: 35em
|
47
|
+
margin: 0 auto
|
48
|
+
|
49
|
+
.mega-link
|
50
|
+
text-indent: 0!important
|
51
|
+
font-size: 8rem
|
52
|
+
display: block
|
53
|
+
text-align: center
|
54
|
+
line-height: 1em
|
55
|
+
margin: 1em 0
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
@media only screen and (max-width: 40rem)
|
60
|
+
.hbox.hbox\:long
|
61
|
+
grid-auto-flow: row
|
62
|
+
justify-content: normal
|
63
|
+
width: 100%
|
64
|
+
.big-text
|
65
|
+
font-size: 1.7rem
|
66
|
+
.mega-link
|
67
|
+
font-size: 4rem
|
@@ -0,0 +1,77 @@
|
|
1
|
+
body
|
2
|
+
// font-size: 1.4rem
|
3
|
+
font-size: 1.4rem
|
4
|
+
max-width: 45em
|
5
|
+
h1, h2, h3, h4, h5, h6
|
6
|
+
line-height: 1.1em
|
7
|
+
p
|
8
|
+
$paragraph-gap: .8rem
|
9
|
+
margin-top: $paragraph-gap
|
10
|
+
margin-bottom: $paragraph-gap
|
11
|
+
|
12
|
+
.anchor
|
13
|
+
color: var(--text-muted)
|
14
|
+
padding-left: 1rem
|
15
|
+
font-size: 1.8rem
|
16
|
+
offset-anchor: 10vh
|
17
|
+
|
18
|
+
.reader
|
19
|
+
max-width: 35em
|
20
|
+
margin: 0 auto
|
21
|
+
padding-top: 2em
|
22
|
+
text-align: justify
|
23
|
+
word-break: break-word
|
24
|
+
-webkit-hyphens: auto
|
25
|
+
-moz-hyphens: auto
|
26
|
+
-ms-hyphens: auto
|
27
|
+
hyphens: auto
|
28
|
+
line-height: 1.4em!important
|
29
|
+
p
|
30
|
+
border-radius: 2em .2em
|
31
|
+
text-indent: 2em
|
32
|
+
$paragraph-gap: .8rem
|
33
|
+
margin-top: $paragraph-gap
|
34
|
+
margin-bottom: $paragraph-gap
|
35
|
+
|
36
|
+
p[current]
|
37
|
+
background-color: var(--background)
|
38
|
+
|
39
|
+
.scene-change
|
40
|
+
margin-top: 1.2em
|
41
|
+
margin-bottom: 1.2em
|
42
|
+
font-size: 3rem
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
h1
|
47
|
+
font-weight: normal
|
48
|
+
margin-top: 1.5em
|
49
|
+
|
50
|
+
li p, ul p
|
51
|
+
text-indent: 0
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
h1:first-child, h2:first-child, h3:first-child,
|
57
|
+
h2:first-child + h1, h3:first-child + h1
|
58
|
+
text-align: center
|
59
|
+
margin-left: auto
|
60
|
+
margin-right: auto
|
61
|
+
max-width: 34rem
|
62
|
+
margin-bottom: 2em
|
63
|
+
margin-top: 2em
|
64
|
+
|
65
|
+
h3:first-child
|
66
|
+
margin-bottom: 1em
|
67
|
+
margin-top: 2em
|
68
|
+
|
69
|
+
h2:first-child + h1, h3:first-child + h1
|
70
|
+
margin-top: 0
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
@media only screen and (min-width: 40rem)
|
75
|
+
body, .reader
|
76
|
+
font-size: 1.6rem
|
77
|
+
line-height: 1.6em!important
|
data/assets/404.html
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
class BookReader {
|
2
|
+
constructor (selector = '#reader', getCurrent = true) {
|
3
|
+
this.pNodes = document.querySelectorAll(`${selector} p`);
|
4
|
+
this.reader = document.querySelector(selector);
|
5
|
+
this.pSelected = null;
|
6
|
+
this.anchorParagraphs();
|
7
|
+
this.scrollToAnchor();
|
8
|
+
if(getCurrent){
|
9
|
+
this.tackSelectedParagraph();
|
10
|
+
};
|
11
|
+
}
|
12
|
+
|
13
|
+
tackSelectedParagraph() {
|
14
|
+
this.pNodes.forEach((p, i) => {
|
15
|
+
p.addEventListener('click',(e) => this.setCurrent(p));
|
16
|
+
p.addEventListener('select',(e) => this.setCurrent(p));
|
17
|
+
});
|
18
|
+
}
|
19
|
+
|
20
|
+
setCurrent(p) {
|
21
|
+
this.clearCurrent();
|
22
|
+
this.reader.setAttribute('current',
|
23
|
+
p.getAttribute('id')
|
24
|
+
);
|
25
|
+
p.setAttribute('current', '');
|
26
|
+
}
|
27
|
+
|
28
|
+
clearCurrent() {
|
29
|
+
this.pNodes.forEach((p) => {
|
30
|
+
p.removeAttribute('current')
|
31
|
+
})
|
32
|
+
}
|
33
|
+
|
34
|
+
anchorParagraphs() {
|
35
|
+
var c = 0;
|
36
|
+
this.pNodes.forEach(function(p){
|
37
|
+
if(p.innerHTML.match('...')) {
|
38
|
+
c = c+1;
|
39
|
+
var a = document.createElement('a')
|
40
|
+
a.setAttribute('href', `#p${c}`)
|
41
|
+
a.setAttribute('class', `anchor`)
|
42
|
+
p.setAttribute('id', `p${c}`)
|
43
|
+
a.innerHTML = String(c)
|
44
|
+
p.appendChild(a)
|
45
|
+
} else {
|
46
|
+
p.setAttribute('class', 'scene-change')
|
47
|
+
};
|
48
|
+
});
|
49
|
+
}
|
50
|
+
|
51
|
+
scrollToAnchor() {
|
52
|
+
var hash = window.location.hash;
|
53
|
+
if(hash != '') {
|
54
|
+
document.querySelector(hash).scrollIntoView()
|
55
|
+
};
|
56
|
+
}
|
57
|
+
}
|
58
|
+
window.addEventListener('load', (e) => {
|
59
|
+
new BookReader('#reader', true);
|
60
|
+
});
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
class ScrollNav {
|
3
|
+
constructor (target='[scroll-nav]'){
|
4
|
+
this.detectScroll(
|
5
|
+
document.querySelector(target)
|
6
|
+
);
|
7
|
+
}
|
8
|
+
detectScroll(nav) {
|
9
|
+
window.addEventListener('scroll', function(e) {
|
10
|
+
var scrollY = window.pageYOffset || document.documentElement.scrollTop;
|
11
|
+
|
12
|
+
if(scrollY <= this.lastScroll) {
|
13
|
+
nav.setAttribute('scroll-nav', 'up');
|
14
|
+
} else {
|
15
|
+
nav.setAttribute('scroll-nav', 'down');
|
16
|
+
};
|
17
|
+
|
18
|
+
this.lastScroll = scrollY ;
|
19
|
+
});
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
window.addEventListener('load', (e) => {
|
24
|
+
new ScrollNav();
|
25
|
+
});
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
STDOUT.sync = true
|
4
|
+
|
5
|
+
gem_dir = File.expand_path("..",File.dirname(__FILE__))
|
6
|
+
$LOAD_PATH.unshift gem_dir # Look in gem directory for resources first.
|
7
|
+
|
8
|
+
require 'fileutils'
|
9
|
+
|
10
|
+
class WebNovelInit
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
cp_folder('_boilerplates')
|
14
|
+
cp_folder('pages')
|
15
|
+
FileUtils.mkpath('_includes')
|
16
|
+
FileUtils.mkpath('_chapters')
|
17
|
+
FileUtils.mkpath('_previews')
|
18
|
+
FileUtils.mkpath('_volumes')
|
19
|
+
cp_file('_includes/copyright.md')
|
20
|
+
cp_file('_config.yml')
|
21
|
+
puts 'Remember to remove `index.markdown`, `404.html`, and `about.md`'
|
22
|
+
puts 'You can use the _boilerplates provided with the `jekyll-page-boilerplate` gem.'
|
23
|
+
puts '`$ bplate volume vol=01 -T "Water"`'
|
24
|
+
puts '`$ bplate chapter vol=01 cht=01 -T "My First Chapter"`'
|
25
|
+
puts '`$ bplate preview vol=01 cht=02 -T "Secret Chapter for Proofreading"`'
|
26
|
+
puts 'Web Novel jekyll template files created.'
|
27
|
+
end
|
28
|
+
|
29
|
+
def cp_folder(folder)
|
30
|
+
FileUtils.cp_r(File.join(__dir__,'../', folder), folder)
|
31
|
+
end
|
32
|
+
|
33
|
+
def cp_file(file)
|
34
|
+
FileUtils.cp(File.join(__dir__,'../', file), file)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
WebNovelInit.new
|
data/pages/chapters.md
ADDED
data/pages/home.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
title: Web Novel Theme for Jekyll
|
3
|
+
permalink: /
|
4
|
+
layout: page
|
5
|
+
start_chapter: 1
|
6
|
+
---
|
7
|
+
|
8
|
+
# {{ site.novel.title }}
|
9
|
+
|
10
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Orci porta non pulvinar neque laoreet suspendisse interdum. Ut porttitor leo a diam sollicitudin tempor id eu nisl.
|
11
|
+
{: .big-text}
|
12
|
+
|
13
|
+
|
14
|
+
{% assign cht1 = site.chapters | find: 'chapter', page.start_chapter %}
|
15
|
+
[Read Now]({{ cht1.url | relative_url}}#reader){: .mega-link}
|
16
|
+
|
metadata
ADDED
@@ -0,0 +1,162 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-web-novel
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.5
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- opsaaaaa
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-05-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: webrick
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.6.1
|
23
|
+
type: :development
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.6'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.6.1
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: jekyll-page-boilerplate
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '4.2'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 4.2.1
|
43
|
+
type: :development
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '4.2'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 4.2.1
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: jekyll
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '4.2'
|
60
|
+
type: :runtime
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - "~>"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '4.2'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: jekyll-seo-tag
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '2.8'
|
74
|
+
type: :runtime
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - "~>"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '2.8'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: jekyll-feed
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - "~>"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0.16'
|
88
|
+
type: :runtime
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - "~>"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0.16'
|
95
|
+
description:
|
96
|
+
email:
|
97
|
+
- sean@ferney.org
|
98
|
+
executables:
|
99
|
+
- jekyll-web-novel
|
100
|
+
extensions: []
|
101
|
+
extra_rdoc_files: []
|
102
|
+
files:
|
103
|
+
- LICENSE.txt
|
104
|
+
- README.md
|
105
|
+
- _boilerplates/chapter.md
|
106
|
+
- _boilerplates/page.md
|
107
|
+
- _boilerplates/preview.md
|
108
|
+
- _boilerplates/volume.md
|
109
|
+
- _config.yml
|
110
|
+
- _includes/chapter_header.html
|
111
|
+
- _includes/chapter_list.html
|
112
|
+
- _includes/chapter_nav.html
|
113
|
+
- _includes/copyright.md
|
114
|
+
- _includes/footer.html
|
115
|
+
- _includes/head.html
|
116
|
+
- _includes/header.html
|
117
|
+
- _includes/reader.html
|
118
|
+
- _includes/toc.html
|
119
|
+
- _layouts/chapter.html
|
120
|
+
- _layouts/default.html
|
121
|
+
- _layouts/page.html
|
122
|
+
- _layouts/preview.html
|
123
|
+
- _layouts/root.html
|
124
|
+
- _layouts/volume.html
|
125
|
+
- _sass/jekyll-web-novel.sass
|
126
|
+
- _sass/web-novel/chapter.sass
|
127
|
+
- _sass/web-novel/colors.sass
|
128
|
+
- _sass/web-novel/footer.sass
|
129
|
+
- _sass/web-novel/header.sass
|
130
|
+
- _sass/web-novel/reader.sass
|
131
|
+
- _sass/web-novel/scrollNav.sass
|
132
|
+
- assets/404.html
|
133
|
+
- assets/css/style.sass
|
134
|
+
- assets/js/bookReader.js
|
135
|
+
- assets/js/scrollNav.js
|
136
|
+
- exe/jekyll-web-novel
|
137
|
+
- pages/chapters.md
|
138
|
+
- pages/home.md
|
139
|
+
homepage: https://github.com/opsaaaaa/web_novel_theme
|
140
|
+
licenses:
|
141
|
+
- MIT
|
142
|
+
metadata: {}
|
143
|
+
post_install_message:
|
144
|
+
rdoc_options: []
|
145
|
+
require_paths:
|
146
|
+
- lib
|
147
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
157
|
+
requirements: []
|
158
|
+
rubygems_version: 3.2.3
|
159
|
+
signing_key:
|
160
|
+
specification_version: 4
|
161
|
+
summary: A nice place to display your web novel
|
162
|
+
test_files: []
|