jekyll-theme-morph 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +189 -0
  4. data/_includes/bread-bar.html +9 -0
  5. data/_includes/catalogue.html +26 -0
  6. data/_includes/footer.html +7 -0
  7. data/_includes/head.html +37 -0
  8. data/_includes/header.html +45 -0
  9. data/_includes/paginator.html +27 -0
  10. data/_includes/post-info.html +31 -0
  11. data/_includes/simple-post-info.html +14 -0
  12. data/_includes/trending-article-item.html +25 -0
  13. data/_layouts/classify.html +55 -0
  14. data/_layouts/default.html +16 -0
  15. data/_layouts/home.html +82 -0
  16. data/_layouts/page.html +8 -0
  17. data/_layouts/post.html +84 -0
  18. data/_layouts/search.html +36 -0
  19. data/_sass/classify.scss +58 -0
  20. data/_sass/home.scss +67 -0
  21. data/_sass/morph.scss +7 -0
  22. data/_sass/morph/_base.scss +62 -0
  23. data/_sass/morph/_colors.scss +42 -0
  24. data/_sass/morph/_functions.scss +57 -0
  25. data/_sass/morph/_utilities.scss +196 -0
  26. data/_sass/morph/_variables.scss +50 -0
  27. data/_sass/morph/components/_catalogue.scss +68 -0
  28. data/_sass/morph/components/_footer.sass +9 -0
  29. data/_sass/morph/components/_header.scss +80 -0
  30. data/_sass/morph/components/_highlight.scss +66 -0
  31. data/_sass/morph/components/_nano-compo.scss +23 -0
  32. data/_sass/morph/components/_paginator.scss +19 -0
  33. data/_sass/morph/components/_post-info.scss +30 -0
  34. data/_sass/morph/themes/obsidian.scss +86 -0
  35. data/_sass/morph/themes/silver.scss +79 -0
  36. data/_sass/post.scss +194 -0
  37. data/_sass/search.scss +68 -0
  38. data/assets/javascript/post.js +52 -0
  39. data/assets/javascript/search.js +51 -0
  40. data/assets/style/classify.scss +4 -0
  41. data/assets/style/home.scss +4 -0
  42. data/assets/style/main.scss +4 -0
  43. data/assets/style/post.scss +5 -0
  44. data/assets/style/search.scss +4 -0
  45. metadata +156 -0
data/_sass/search.scss ADDED
@@ -0,0 +1,68 @@
1
+ @import "morph/variables";
2
+ @import "morph/functions";
3
+
4
+ .page-search {
5
+ header.header {
6
+ padding: 2rem 0;
7
+
8
+ .search-wrap {
9
+ min-width: 40%;
10
+ }
11
+ }
12
+
13
+ $search-box-radius: 3px;
14
+ $search-box-border-color: $color-primary-dark;
15
+ input.search-input {
16
+ font-size: 14px;
17
+ padding: 12px 10px;
18
+ -webkit-appearance: none;
19
+ outline: none;
20
+ border: 1px solid $search-box-border-color;
21
+ border-right: 0;
22
+ border-top-left-radius: $search-box-radius;
23
+ border-bottom-left-radius: $search-box-radius;
24
+ }
25
+ button.search-button {
26
+ border: 1px solid $search-box-border-color;
27
+ border-left: 0;
28
+ border-top-right-radius: $search-box-radius;
29
+ border-bottom-right-radius: $search-box-radius;
30
+ padding: 6px 15px;
31
+ margin-left: -5px;
32
+ }
33
+
34
+ p.search-template-content {
35
+ width: 100%;
36
+ overflow: hidden;
37
+ text-overflow: ellipsis;
38
+ display: -webkit-box;
39
+ -webkit-box-orient: vertical;
40
+ -webkit-line-clamp: 3;
41
+ @include media-sm() {
42
+ -webkit-line-clamp: 5;
43
+ }
44
+ }
45
+ p.tags {
46
+ padding: .5rem 0;
47
+ }
48
+
49
+ ul.search-results-container {
50
+ list-style-type: none;
51
+ text-align: center;
52
+ li {
53
+ text-align: left;
54
+ padding: 1rem 0;
55
+ .title {
56
+ font-size: 1.5rem;
57
+ padding-bottom: .5rem;
58
+ }
59
+ p {
60
+ font-size: 1.2rem;
61
+ line-height: 1.7rem;
62
+ }
63
+ &:not(:last-child) {
64
+ border-bottom: 1px dashed $color-primary-dark;
65
+ }
66
+ }
67
+ }
68
+ }
@@ -0,0 +1,52 @@
1
+ (function() {
2
+ "use struct"
3
+
4
+ function createStructureItem(element) {
5
+ var a = document.createElement('a')
6
+ var li = document.createElement('li')
7
+ a.href = '#' + element.id
8
+ a.innerText = element.innerText
9
+ li.className = element.nodeName.toLowerCase()
10
+ li.appendChild(a)
11
+
12
+ a.onclick = function (event) {
13
+ event.preventDefault()
14
+ element.scrollIntoView({behavior: "smooth"})
15
+ }
16
+
17
+ return li
18
+ }
19
+
20
+ function post(title) {
21
+ this.title = title
22
+ }
23
+
24
+ post.prototype.getHeaders = function () {
25
+ var articleArea = document.querySelector('article.text')
26
+ return articleArea.querySelectorAll('h1, h2, h3, h4, h5, h6')
27
+ }
28
+
29
+ post.prototype.initStructure = function (structure) {
30
+ var headers = this.getHeaders()
31
+ if (headers.length > 0) {
32
+ structure.innerText = ''
33
+ }
34
+ headers.forEach(function (value) {
35
+ structure.appendChild(createStructureItem(value))
36
+ })
37
+ }
38
+
39
+ post.prototype.addAnchorToHeaders = function () {
40
+ var headers = this.getHeaders()
41
+ headers.forEach(function (value) {
42
+ var a = document.createElement('a')
43
+ var i = document.createElement('i')
44
+ i.className = 'fas fa-link header-anchor color-link-light'
45
+ a.href = '#' + value.id
46
+ a.appendChild(i)
47
+ value.appendChild(a)
48
+ })
49
+ }
50
+
51
+ window.PostPage = post;
52
+ })()
@@ -0,0 +1,51 @@
1
+ (function() {
2
+ "use struct"
3
+
4
+ function getQueryVariable(variable) {
5
+ var query = window.location.search.substring(1)
6
+ var vars = query.split("&")
7
+ for (var i=0; i < vars.length; i++) {
8
+ var pair = vars[i].split("=")
9
+ if (pair[0] == variable){
10
+ return pair[1]
11
+ }
12
+ }
13
+ return null;
14
+ }
15
+
16
+ document.addEventListener('DOMContentLoaded', function () {
17
+ var pageSearch = document.getElementById('page-search')
18
+
19
+ var searchInput = pageSearch.querySelector('#search-input')
20
+ var searchButton = pageSearch.querySelector('#search-button')
21
+ var searchContainer = pageSearch.querySelector('#search-results-container')
22
+ var sjs = SimpleJekyllSearch({
23
+ searchInput: pageSearch.querySelector('#search-input'),
24
+ resultsContainer: searchContainer,
25
+ json: '/search.json',
26
+ searchResultTemplate: '<li>\
27
+ <h2 class="title fw-normal"><a href="{url}">{title}</a></h2>\
28
+ <p class="search-template-content">{content}</p>\
29
+ <p class="tags color-secondary-light"><i class="fas fa-tags color-rang1" style="font-size:.8rem"></i> {tags}</p>\
30
+ </li>',
31
+ success: function (rv) {
32
+ var words = getQueryVariable('words')
33
+ if (words) {
34
+ searchContainer.innerText = 'Searching'
35
+ words = decodeURIComponent(words)
36
+ searchInput.value = words
37
+ setTimeout((function () {
38
+ this.search(words)
39
+ }).bind(this), 800)
40
+ }
41
+ }
42
+ })
43
+
44
+ searchButton.onclick = function (event) {
45
+ event.preventDefault()
46
+ if (searchInput.value && searchInput.value.length > 0) {
47
+ sjs.search(searchInput.value)
48
+ }
49
+ }
50
+ })
51
+ })()
@@ -0,0 +1,4 @@
1
+ ---
2
+ ---
3
+ @import "morph/themes/{{ site.morph.skin | default: 'silver' }}";
4
+ @import "classify";
@@ -0,0 +1,4 @@
1
+ ---
2
+ ---
3
+ @import "morph/themes/{{ site.morph.skin | default: 'silver' }}";
4
+ @import "home";
@@ -0,0 +1,4 @@
1
+ ---
2
+ ---
3
+ @import "morph/themes/{{ site.morph.skin | default: 'silver' }}";
4
+ @import "morph";
@@ -0,0 +1,5 @@
1
+ ---
2
+ ---
3
+ @import "morph/themes/{{ site.morph.skin | default: 'silver' }}";
4
+ @import "post";
5
+ //@import "railscasts.css";
@@ -0,0 +1,4 @@
1
+ ---
2
+ ---
3
+ @import "morph/themes/{{ site.morph.skin | default: 'silver' }}";
4
+ @import "search";
metadata ADDED
@@ -0,0 +1,156 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-theme-morph
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Alex
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-06-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: jekyll-paginate
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: jekyll-feed
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.15'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.15'
55
+ - !ruby/object:Gem::Dependency
56
+ name: jekyll-seo-tag
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.7'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.7'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.0'
83
+ description:
84
+ email:
85
+ - omytty@126.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - LICENSE
91
+ - README.md
92
+ - _includes/bread-bar.html
93
+ - _includes/catalogue.html
94
+ - _includes/footer.html
95
+ - _includes/head.html
96
+ - _includes/header.html
97
+ - _includes/paginator.html
98
+ - _includes/post-info.html
99
+ - _includes/simple-post-info.html
100
+ - _includes/trending-article-item.html
101
+ - _layouts/classify.html
102
+ - _layouts/default.html
103
+ - _layouts/home.html
104
+ - _layouts/page.html
105
+ - _layouts/post.html
106
+ - _layouts/search.html
107
+ - _sass/classify.scss
108
+ - _sass/home.scss
109
+ - _sass/morph.scss
110
+ - _sass/morph/_base.scss
111
+ - _sass/morph/_colors.scss
112
+ - _sass/morph/_functions.scss
113
+ - _sass/morph/_utilities.scss
114
+ - _sass/morph/_variables.scss
115
+ - _sass/morph/components/_catalogue.scss
116
+ - _sass/morph/components/_footer.sass
117
+ - _sass/morph/components/_header.scss
118
+ - _sass/morph/components/_highlight.scss
119
+ - _sass/morph/components/_nano-compo.scss
120
+ - _sass/morph/components/_paginator.scss
121
+ - _sass/morph/components/_post-info.scss
122
+ - _sass/morph/themes/obsidian.scss
123
+ - _sass/morph/themes/silver.scss
124
+ - _sass/post.scss
125
+ - _sass/search.scss
126
+ - assets/javascript/post.js
127
+ - assets/javascript/search.js
128
+ - assets/style/classify.scss
129
+ - assets/style/home.scss
130
+ - assets/style/main.scss
131
+ - assets/style/post.scss
132
+ - assets/style/search.scss
133
+ homepage: https://github.com/alex-1900/jekyll-theme-morph
134
+ licenses:
135
+ - MIT
136
+ metadata: {}
137
+ post_install_message:
138
+ rdoc_options: []
139
+ require_paths:
140
+ - lib
141
+ required_ruby_version: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ required_rubygems_version: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: '0'
151
+ requirements: []
152
+ rubygems_version: 3.2.15
153
+ signing_key:
154
+ specification_version: 4
155
+ summary: Morph is a minimal Jekyll theme.
156
+ test_files: []