spuit 0.1.2 → 0.2.1

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.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.npmignore +1 -2
  3. data/Makefile +12 -0
  4. data/README.md +2 -1
  5. data/lib/spuit/version.rb +1 -1
  6. data/package.json +2 -25
  7. data/scss/components/_button.scss +28 -27
  8. data/scss/components/_group.scss +50 -0
  9. data/scss/components/_switch.scss +40 -24
  10. data/scss/components/_triangle.scss +4 -4
  11. data/scss/elements/{_custom-checkbox.scss → _custom-radio.scss} +31 -22
  12. data/scss/elements/_fieldset.scss +21 -49
  13. data/scss/elements/_input.scss +26 -11
  14. data/scss/elements/_radio.scss +39 -0
  15. data/scss/elements/_select.scss +7 -3
  16. data/scss/elements/_table.scss +4 -11
  17. data/scss/includes/_spacers.scss +1 -1
  18. data/scss/modules/_reset.scss +32 -0
  19. data/scss/spuit.scss +5 -1
  20. data/scss/variables/_defaults.scss +1 -0
  21. data/scss/variables/_fonts.scss +45 -0
  22. data/scss/variables/_media-queries.scss +2 -2
  23. data/site/.gitignore +117 -0
  24. data/site/README.md +12 -0
  25. data/site/archetypes/default.md +6 -0
  26. data/site/config.toml +24 -0
  27. data/site/content/posts/components.html +445 -0
  28. data/site/content/posts/example.md +66 -0
  29. data/site/content/posts/layouts.md +11 -0
  30. data/site/content/posts/layouts/2col.html +27 -0
  31. data/site/content/posts/layouts/holygrail.html +40 -0
  32. data/site/content/posts/layouts/stickyfooter.html +23 -0
  33. data/site/content/search.adoc +5 -0
  34. data/site/themes/spuit/.gitignore +68 -0
  35. data/site/themes/spuit/LICENSE.md +20 -0
  36. data/site/themes/spuit/README.md +66 -0
  37. data/site/themes/spuit/archetypes/default.md +7 -0
  38. data/{assets/javascripts/spuit → site/themes/spuit/assets/javascripts/_}/Common.js +0 -0
  39. data/{assets/javascripts/spuit → site/themes/spuit/assets/javascripts/_}/extend.js +0 -0
  40. data/site/themes/spuit/assets/javascripts/classes/HugoSearch.js +115 -0
  41. data/site/themes/spuit/assets/javascripts/classes/onof.js +107 -0
  42. data/site/themes/spuit/assets/javascripts/scripts.js +26 -0
  43. data/site/themes/spuit/assets/stylesheets/styles.scss +790 -0
  44. data/site/themes/spuit/assets/stylesheets/styles/components/_card.scss +160 -0
  45. data/site/themes/spuit/assets/stylesheets/styles/components/_syntax.scss +59 -0
  46. data/site/themes/spuit/assets/stylesheets/styles/config/_mixins.scss +8 -0
  47. data/site/themes/spuit/assets/stylesheets/styles/config/_variables.scss +6 -0
  48. data/site/themes/spuit/design/badge.sketch +0 -0
  49. data/site/themes/spuit/layouts/404.html +9 -0
  50. data/site/themes/spuit/layouts/_default/baseof.html +27 -0
  51. data/site/themes/spuit/layouts/_default/list.html +22 -0
  52. data/site/themes/spuit/layouts/_default/rss.xml +26 -0
  53. data/site/themes/spuit/layouts/_default/single.html +14 -0
  54. data/site/themes/spuit/layouts/_default/temp.html +5 -0
  55. data/site/themes/spuit/layouts/index.html +2 -0
  56. data/site/themes/spuit/layouts/json/single.html +28 -0
  57. data/site/themes/spuit/layouts/partials/foot.html +26 -0
  58. data/site/themes/spuit/layouts/partials/footer.html +5 -0
  59. data/site/themes/spuit/layouts/partials/head.html +52 -0
  60. data/site/themes/spuit/layouts/partials/header.html +4 -0
  61. data/site/themes/spuit/layouts/partials/parts/breadcrumbs.html +36 -0
  62. data/site/themes/spuit/layouts/partials/parts/info.html +19 -0
  63. data/site/themes/spuit/layouts/partials/parts/nextback.html +9 -0
  64. data/site/themes/spuit/layouts/partials/parts/pagenator.html +31 -0
  65. data/site/themes/spuit/layouts/partials/parts/pager.html +23 -0
  66. data/site/themes/spuit/layouts/partials/sidebar.html +52 -0
  67. data/site/themes/spuit/layouts/partials/widgets/archive.html +14 -0
  68. data/site/themes/spuit/layouts/partials/widgets/categories.html +12 -0
  69. data/site/themes/spuit/layouts/partials/widgets/recents.html +14 -0
  70. data/site/themes/spuit/layouts/partials/widgets/related.html +13 -0
  71. data/site/themes/spuit/layouts/partials/widgets/search-modal.html +19 -0
  72. data/site/themes/spuit/layouts/partials/widgets/search.html +10 -0
  73. data/site/themes/spuit/layouts/partials/widgets/tags.html +12 -0
  74. data/site/themes/spuit/layouts/shortcodes/blockquote.html +70 -0
  75. data/site/themes/spuit/layouts/shortcodes/card-amazon.html +28 -0
  76. data/site/themes/spuit/layouts/shortcodes/card-site.html +22 -0
  77. data/site/themes/spuit/layouts/shortcodes/card-store.html +28 -0
  78. data/site/themes/spuit/layouts/shortcodes/card-youtube.html +27 -0
  79. data/site/themes/spuit/layouts/shortcodes/previews.html +18 -0
  80. data/site/themes/spuit/package-lock.json +7959 -0
  81. data/site/themes/spuit/package.json +46 -0
  82. data/{dist → site/themes/spuit/static}/favicon.ico +0 -0
  83. data/site/themes/spuit/static/fonts/FontAwesome.otf +0 -0
  84. data/site/themes/spuit/static/fonts/fontawesome-webfont.eot +0 -0
  85. data/site/themes/spuit/static/fonts/fontawesome-webfont.svg +2671 -0
  86. data/site/themes/spuit/static/fonts/fontawesome-webfont.ttf +0 -0
  87. data/site/themes/spuit/static/fonts/fontawesome-webfont.woff +0 -0
  88. data/site/themes/spuit/static/fonts/fontawesome-webfont.woff2 +0 -0
  89. data/site/themes/spuit/static/images/appstore-badge.png +0 -0
  90. data/site/themes/spuit/static/images/appstore-badge_en.png +0 -0
  91. data/{dist → site/themes/spuit/static/images}/favicon.png +0 -0
  92. data/site/themes/spuit/static/images/google-play-badge.png +0 -0
  93. data/site/themes/spuit/static/images/google-play-badge_en.png +0 -0
  94. data/site/themes/spuit/static/javascripts/scripts.js +120 -0
  95. data/site/themes/spuit/static/stylesheets/styles.css +9763 -0
  96. data/site/themes/spuit/theme.toml +9 -0
  97. data/site/themes/spuit/webpack.config.js +10 -0
  98. data/site/themes/spuit/webpack/css.webpack.config.js +42 -0
  99. data/site/themes/spuit/webpack/js.webpack.config.js +21 -0
  100. data/site/themes/spuit/yarn.lock +6815 -0
  101. data/yarn.lock +337 -4942
  102. metadata +84 -16
  103. data/assets/html/index.ejs +0 -331
  104. data/assets/javascripts/scripts.js +0 -4
  105. data/assets/stylesheets/styles.scss +0 -191
  106. data/assets/stylesheets/styles/config/_mixins.scss +0 -26
  107. data/assets/stylesheets/styles/config/_variables.scss +0 -4
  108. data/dist/index.html +0 -1
  109. data/dist/javascripts/scripts.js +0 -1
  110. data/dist/stylesheets/styles.css +0 -3
  111. data/scss/_/_form.sass +0 -44
@@ -0,0 +1,66 @@
1
+ ---
2
+ title: Example
3
+ draft: true
4
+ date: 2018-01-01
5
+ tags:
6
+ - tagname
7
+ categories:
8
+ - categoryname
9
+ ---
10
+
11
+ Example Template
12
+
13
+ <!--more-->
14
+
15
+ ```cs
16
+ using System.Collections;
17
+ using System.Collections.Generic;
18
+ using UnityEngine;
19
+
20
+ public class Cube : MonoBehaviour {
21
+
22
+ // Use this for initialization
23
+ void Start () {
24
+
25
+ }
26
+
27
+ // Update is called once per frame
28
+ void Update () {
29
+
30
+ }
31
+ }
32
+ ```
33
+
34
+ ## Text styles
35
+
36
+ # heading 1
37
+
38
+ ## heading2
39
+
40
+ ### heading3
41
+
42
+ #### heading4
43
+
44
+ ##### heading5
45
+
46
+ ###### heading6
47
+
48
+ paragraph
49
+
50
+ text **bold**
51
+
52
+ text [link](xxx)
53
+
54
+ ## shortcodes
55
+
56
+ {{< blockquote author="@allanbranch" link="https://twitter.com/allanbranch/status/90766146063712256" >}}
57
+ Over the past 24 hours I've been reflecting on my life & I've realized only one thing. I need a medieval battle axe.
58
+ {{< /blockquote >}}
59
+
60
+ {{< card-amazon id="4873118255" title="仕事ではじめる機械学習" src="/images/amazon/sample.jpg" >}}
61
+
62
+ {{< card-site href="https://xxx.com/" title="title" description="description" src="/images/2017/xxxxxx/ogp.png" >}}
63
+
64
+ {{< card-store url="xxx" title="xxx" >}}
65
+
66
+ {{< card-youtube id="xxx" >}}
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: Layouts
3
+ draft: true
4
+ date: 2020-02-11
5
+ tags:
6
+ - tagname
7
+ ---
8
+
9
+ - [Holy grail](/posts/layouts/holygrail)
10
+ - [2 column](/posts/layouts/2col)
11
+ - [Sticky footer](/posts/layouts/stickyfooter)
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: 2col
3
+ draft: true
4
+ date: 2020-01-01
5
+ layout: temp
6
+ ---
7
+
8
+ <header class="layout-preview">
9
+ header
10
+ </header>
11
+
12
+ <div style="display: flex;">
13
+ <aside class="layout-preview c2" style="width: 30%;">
14
+ aside
15
+ </aside>
16
+
17
+ <main class="layout-preview c3" style="
18
+ flex: 1;
19
+ overflow: auto;
20
+ ">
21
+ main
22
+ </main>
23
+ </div>
24
+
25
+ <footer class="layout-preview">
26
+ footer
27
+ </footer>
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: Holy grail
3
+ draft: true
4
+ date: 2020-01-01
5
+ layout: temp
6
+ ---
7
+
8
+ <div class="l-holygrail" style="
9
+ display: flex;
10
+ flex-direction: column;
11
+ ">
12
+ <header class="layout-preview">
13
+ header
14
+ </header>
15
+
16
+ <main style="
17
+ flex-grow: 1;
18
+ display: flex;
19
+ flex-direction: row;
20
+ ">
21
+
22
+ <aside class="layout-preview c2" style="
23
+ width: 25%;
24
+ ">aside</aside>
25
+
26
+ <article class="layout-preview c3" style="
27
+ flex-grow: 1;
28
+ ">
29
+ article
30
+ </article>
31
+
32
+ <nav class="layout-preview c2" style="
33
+ width: 20%;
34
+ ">nav</nav>
35
+ </main>
36
+
37
+ <footer class="layout-preview">
38
+ footer
39
+ </footer>
40
+ </div>
@@ -0,0 +1,23 @@
1
+ ---
2
+ title: Sticky footer
3
+ draft: true
4
+ date: 2020-01-01
5
+ layout: temp
6
+ ---
7
+
8
+ <div style="
9
+ display: flex;
10
+ flex-direction: column;
11
+ height: 100%;
12
+ /*min-height: 100vh;*/
13
+ ">
14
+ <header class="layout-preview c1" style="flex-shrink: 0;">
15
+ header
16
+ </header>
17
+ <main class="layout-preview c2" style="flex-grow: 1;">
18
+ main
19
+ </main>
20
+ <footer class="layout-preview c3" style="flex-shrink: 0;">
21
+ footer
22
+ </footer>
23
+ </div>
@@ -0,0 +1,5 @@
1
+ ---
2
+ date: "2018-01-01"
3
+ type: "json"
4
+ url: "search.json"
5
+ ---
@@ -0,0 +1,68 @@
1
+
2
+ # Created by https://www.gitignore.io/api/node
3
+
4
+ ### Node ###
5
+ # Logs
6
+ logs
7
+ *.log
8
+ npm-debug.log*
9
+ yarn-debug.log*
10
+ yarn-error.log*
11
+
12
+ # Runtime data
13
+ pids
14
+ *.pid
15
+ *.seed
16
+ *.pid.lock
17
+
18
+ # Directory for instrumented libs generated by jscoverage/JSCover
19
+ lib-cov
20
+
21
+ # Coverage directory used by tools like istanbul
22
+ coverage
23
+
24
+ # nyc test coverage
25
+ .nyc_output
26
+
27
+ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
28
+ .grunt
29
+
30
+ # Bower dependency directory (https://bower.io/)
31
+ bower_components
32
+
33
+ # node-waf configuration
34
+ .lock-wscript
35
+
36
+ # Compiled binary addons (http://nodejs.org/api/addons.html)
37
+ build/Release
38
+
39
+ # Dependency directories
40
+ node_modules/
41
+ jspm_packages/
42
+
43
+ # Typescript v1 declaration files
44
+ typings/
45
+
46
+ # Optional npm cache directory
47
+ .npm
48
+
49
+ # Optional eslint cache
50
+ .eslintcache
51
+
52
+ # Optional REPL history
53
+ .node_repl_history
54
+
55
+ # Output of 'npm pack'
56
+ *.tgz
57
+
58
+ # Yarn Integrity file
59
+ .yarn-integrity
60
+
61
+ # dotenv environment variables file
62
+ .env
63
+
64
+
65
+ # End of https://www.gitignore.io/api/node
66
+
67
+ .DS_Store
68
+ node_modules
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 YOUR_NAME_HERE
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ 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, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,66 @@
1
+ ## How to Use
2
+
3
+ インストール:
4
+
5
+ ```
6
+ $ hugo new site xxx && cd xxx
7
+ $ git submodule add git@github.com:is8r/hugo-bootstrap.git themes/hugo-bootstrap
8
+ ```
9
+
10
+ config.tomlの例:
11
+
12
+ ```
13
+ baseURL = "http://example.org/"
14
+ languageCode = "ja"
15
+ title = "Test"
16
+ theme = "hugo-bootstrap"
17
+ copyright = "copyright"
18
+
19
+ [params]
20
+ description = "description"
21
+ keywords = "keywords"
22
+ googleAnalyticsId = ""
23
+ fbAppId = ""
24
+
25
+ [permalinks]
26
+ post = "/:year/:month/:title/"
27
+
28
+ [taxonomies]
29
+ tag = "tags"
30
+ category = "categories"
31
+ ```
32
+
33
+ あと、packege.jsonに追加しておくと便利:
34
+
35
+ ```
36
+ {
37
+ "scripts": {
38
+ "hugo": "open http://localhost:1313/ && hugo server -D --watch",
39
+ "dev": "cd ./themes/hugo-bootstrap && npm install && npm run dev"
40
+ }
41
+ }
42
+ ```
43
+
44
+ サイト内検索 `HugoSearch.js` を使用するには `.json` ファイルが必要なので、json書き出し用に `/content/search.adoc` として下記の内容が記載されたファイルを追加する必要があります:
45
+
46
+ ```
47
+ ---
48
+ date: "2018-01-01"
49
+ type: "json"
50
+ url: "search.json"
51
+ ---
52
+ ```
53
+
54
+ # webpack4
55
+
56
+ watch:
57
+
58
+ ```
59
+ $ npm run dev
60
+ ```
61
+
62
+ build:
63
+
64
+ ```
65
+ $ npm run build
66
+ ```
@@ -0,0 +1,7 @@
1
+ +++
2
+ title = "{{ replace .TranslationBaseName "-" " " | title }}"
3
+ date = {{ .Date }}
4
+ tags = []
5
+ featured_image = ""
6
+ description = ""
7
+ +++
@@ -0,0 +1,115 @@
1
+ /*
2
+ import HugoSearch from './classes/HugoSearch';
3
+ $(function() {
4
+ var hugoSearch = new HugoSearch();
5
+ });
6
+ */
7
+
8
+ import $ from 'jquery'
9
+ import lunr from 'lunr'
10
+
11
+ export default class HugoSearch {
12
+ constructor() {
13
+ this.searchOverlay = document.querySelector('.search-form')
14
+ this.searchButton = document.getElementById('search-button')
15
+ this.searchInput = document.getElementById('search-input')
16
+ this.closeSearch = document.getElementById('close-search')
17
+ this.searchInput = document.getElementById('search-input')
18
+
19
+ this.init()
20
+ }
21
+
22
+ init() {
23
+ if(this.closeSearch != null) {
24
+ this.closeSearch.addEventListener('click', (event) => {
25
+ if (this.searchOverlay.classList.contains('open')) {
26
+ this.searchOverlay.classList.remove('open');
27
+ }
28
+ }, true);
29
+ }
30
+
31
+ if(this.searchButton) {
32
+ this.searchButton.addEventListener('click', (event) => {
33
+ this.searchOverlay.classList.toggle('open');
34
+ searchInput.focus();
35
+ }, true);
36
+ }
37
+
38
+ if (this.searchInput) {
39
+ this.searchInput.addEventListener('keyup', (event) => {
40
+ var query = document.querySelector("#search-input").value;
41
+ var searchResults = document.querySelector('#search-results');
42
+ if (query.length === 0) {
43
+ searchResults.innerHTML = '';
44
+ }
45
+ if ((event.keyCode !== 9) && (query.length > 2)) {
46
+ var matches = window.index.search(query);
47
+ this.displayResults(matches);
48
+ }
49
+ }, true);
50
+ }
51
+
52
+ this.initLunr()
53
+ this.initModal()
54
+ }
55
+
56
+ initModal() {
57
+ $('#search').on('shown.bs.modal', function() {
58
+ $('#search-input').trigger('focus')
59
+ })
60
+ $('#search').on('hidden.bs.modal', function() {
61
+ $('#search-input').val('')
62
+ $('#search-results')[0].innerHTML = ''
63
+ })
64
+ }
65
+
66
+ initLunr() {
67
+ var scope = this;
68
+ fetch('/search.json')
69
+ .then((response) => {
70
+ if(response.ok) {
71
+ return response.json()
72
+ } else {
73
+ throw new Error()
74
+ }
75
+ })
76
+ .then((json) => {
77
+ scope.searchData = json
78
+ window.index = lunr(function() {
79
+ this.field('id')
80
+ this.field('url')
81
+ this.field('title', { boost: 50 })
82
+ this.field('tags',{ boost: 30})
83
+ this.field('content', { boost: 10 })
84
+
85
+ scope.searchData.forEach(function (obj, index) {
86
+ obj['id'] = index
87
+ this.add(obj)
88
+ }, this)
89
+ })
90
+ })
91
+ .catch((error) => console.log(error));
92
+ }
93
+
94
+ displayResults(results) {
95
+ var searchResults = document.querySelector('#search-results');
96
+ var inputVal = document.querySelector('#search-input').value;
97
+ if (results.length) {
98
+ searchResults.innerHTML = '';
99
+ results.forEach((result) => {
100
+ var item = this.searchData[result.ref];
101
+ var section = item.section.split('-').map(s => s.charAt(0).toUpperCase() + s.slice(1)).join(' ');
102
+ var appendString = '';
103
+ appendString += '<li class=\"search-result\"><h5><a href=\"' + item.url + '\">' + item.title + '</a></h5><p>' + item.summary + '</p>';
104
+ // appendString += '<div class=\"in-section\">In: ' + section + '</div><ul class=\"tags\">';
105
+ // appendString += '<ul class=\"tags\">';
106
+ // var tags = '';
107
+ // for (var i = 0; i < item.tags.length; i++) {
108
+ // appendString += '<li><a href=\"/tags/' + item.tags[i] + '\" class=\"tag\">' + item.tags[i] + '</a> ';
109
+ // }
110
+ appendString += '</ul></li>';
111
+ searchResults.innerHTML += appendString;
112
+ })
113
+ }
114
+ }
115
+ }