plaintro 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +195 -22
- data/_config.yml +7 -3
- data/_includes/google-analytics.html +9 -0
- data/_includes/head.html +4 -0
- data/_sass/plaintro/_layout.scss +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb923a10cbedb55570f5133f0bb2f839cf05432bb40e7f9de493ecaafc180496
|
4
|
+
data.tar.gz: a27dac68c9fa51acdc4b8ac56ff8e6b1d1ce72ded037f709838c89743e251912
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c32b5a867da50cab5966ef5d502218b1c1fb94a1d8a8cfa80f23d810a3ed0310933407697df5fd6cb2d272064c4b8cbb424a9d2900cbacd1c7dd640d781654c1
|
7
|
+
data.tar.gz: 752c1229bb43cf43b9b253e93d92134068becb42facc65defa419dad47c9efd907f3f0325ef9a71f7a5ca07d67937f5e339e2aa70e5bca0d36d78bfa488f64ca
|
data/README.md
CHANGED
@@ -1,46 +1,221 @@
|
|
1
1
|
# Plaintro
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/plaintro.svg)](https://badge.fury.io/rb/plaintro)
|
3
|
+
|
4
|
+
Plaintro is a responsive Jekyll theme aimed at personal websites.
|
5
|
+
|
6
|
+
[Live Demo](https://xh5a5n6k6.github.io/plaintro/)
|
7
|
+
|
8
|
+
## Table of Contents
|
9
|
+
- [Features](#features)
|
10
|
+
- [Installation](#installation)
|
11
|
+
- [Gem-based theme](#gem-based-theme)
|
12
|
+
- [Github Pages](#github-pages)
|
13
|
+
- [Usage](#usage)
|
14
|
+
- [Configuration](#configuration)
|
15
|
+
- [Top Header Bar](#top-header-bar)
|
16
|
+
- [Default Page](#default-page)
|
17
|
+
- [Blog](#blog)
|
18
|
+
- [Post](#post)
|
19
|
+
- [Archive](#archive)
|
20
|
+
- [Portfolio](#portfolio)
|
21
|
+
- [Resume](#resume)
|
22
|
+
- [Google Analytics](#google-analytics)
|
23
|
+
- [Contributing](#contributing)
|
24
|
+
- [Development](#development)
|
25
|
+
- [License](#license)
|
26
|
+
|
27
|
+
## Features
|
28
|
+
- [Normalize.css](https://github.com/necolas/normalize.css)
|
29
|
+
- [Font Awesome](https://fontawesome.com)
|
30
|
+
- [Google Analytics](https://analytics.google.com/analytics/web/)
|
31
|
+
- [Jekyll Feed](https://github.com/jekyll/jekyll-feed)
|
32
|
+
- [Jekyll Paginate](https://github.com/jekyll/jekyll-paginate)
|
33
|
+
- [Jekyll SEO Tag](https://github.com/jekyll/jekyll-seo-tag)
|
34
|
+
- Responsive web design
|
35
|
+
- Multiple layouts for different pages (see [Usage](#usage) for more details)
|
36
|
+
- Easy-to-use templates for adding a new project to the portfolio page
|
2
37
|
|
3
|
-
|
38
|
+
## Installation
|
39
|
+
There are two ways to use plaintro: Gem-based theme and Github Pages.
|
40
|
+
|
41
|
+
### Gem-based theme
|
42
|
+
1. Add this line to your Jekyll site's `Gemfile`:
|
43
|
+
```ruby
|
44
|
+
gem "plaintro"
|
45
|
+
```
|
46
|
+
2. And add this line to your Jekyll site's `_config.yml`:
|
47
|
+
```yaml
|
48
|
+
theme: plaintro
|
49
|
+
```
|
50
|
+
3. And then execute:
|
51
|
+
```
|
52
|
+
$ bundle
|
53
|
+
```
|
54
|
+
4. Or install it yourself as:
|
55
|
+
```
|
56
|
+
$ gem install plaintro
|
57
|
+
```
|
4
58
|
|
5
|
-
|
59
|
+
### Github Pages
|
60
|
+
Github Pages uses the [--safe flag](https://jekyllrb.com/docs/configuration/options/) to build jekyll websites, which disable custom plugins, caching to disk, and ignore symbolic links. Because of that constraint, you can either fork/clone the repo and customize the theme, or use [jekyll-remote-theme](https://github.com/benbalter/jekyll-remote-theme) instead.
|
6
61
|
|
7
|
-
|
62
|
+
To build Github Pages via [jekyll-remote-theme](https://github.com/benbalter/jekyll-remote-theme), follow the steps below:
|
63
|
+
1. Add these lines to your Jekyll site's `Gemfile`:
|
64
|
+
```ruby
|
65
|
+
gem "github-pages", group: :jekyll_plugins
|
66
|
+
gem "jekyll-remote-theme"
|
67
|
+
```
|
68
|
+
2. And add these lines to your Jekyll site's `_config.yml`:
|
69
|
+
```yaml
|
70
|
+
plugins:
|
71
|
+
- jekyll-remote-theme
|
8
72
|
|
73
|
+
remote-theme: xh5a5n6k6/plaintro
|
74
|
+
```
|
9
75
|
|
10
|
-
##
|
76
|
+
## Usage
|
77
|
+
### Configuration
|
78
|
+
All site configurations are set in the [\_config.yml](./_config.yml). The simplest way to use it is to copy the [\_config.yml](./_config.yml) to your Jekyll site, and then customize it.
|
79
|
+
|
80
|
+
### Top Header Bar
|
81
|
+
There are two main information sections shown in the header bar: navigation and social links.
|
82
|
+
|
83
|
+
- #### Navigation
|
84
|
+
Top navigation are built from the menu list in the `_config.yml`. You can easily arrange the order and modify the contents.
|
85
|
+
|
86
|
+
```yaml
|
87
|
+
menu:
|
88
|
+
- {name: 'Home', url: '/'}
|
89
|
+
- {name: 'Blog', url: '/blog/'}
|
90
|
+
- {name: 'Portfolio', url: '/portfolio/'}
|
91
|
+
- {name: 'Resume', url: '/resume.html'}
|
92
|
+
```
|
93
|
+
|
94
|
+
**Note**: if you enable the blog page, be sure its url matches the `paginate_path` set in the `_config.yml`. (See [Blog](#blog) for more details)
|
11
95
|
|
12
|
-
|
96
|
+
- #### Social Links
|
97
|
+
Social networks are built from the social list in the `_config.yml`. You can easily modify the contents and change icons, which can be found on [Font Awesome](https://fontawesome.com).
|
13
98
|
|
14
|
-
```
|
15
|
-
|
99
|
+
```yaml
|
100
|
+
social:
|
101
|
+
- {icon: 'github-square', link: 'URL/TO/YOUR/GITHUB/ACCOUNT'}
|
102
|
+
- {icon: 'vimeo-square', link: 'URL/TO/YOUR/VIMEO/ACCOUNT'}
|
103
|
+
- {icon: 'twitter-square', link: 'URL/TO/YOUR/TWITTER/ACCOUNT'}
|
104
|
+
- {icon: 'linkedin', link: 'URL/TO/YOUR/LINKEDIN/ACCOUNT'}
|
105
|
+
```
|
106
|
+
|
107
|
+
### Default Page
|
108
|
+
Default is the most common layout used in plaintro. Every layout is based on it.
|
109
|
+
|
110
|
+
To use this layout, add these data in your file:
|
111
|
+
```yaml
|
112
|
+
---
|
113
|
+
layout: default
|
114
|
+
title: YOUR PAGE TITLE
|
115
|
+
---
|
16
116
|
```
|
117
|
+
And then write contents with Markdown.
|
17
118
|
|
18
|
-
|
119
|
+
### Blog
|
120
|
+
When using [jekyll-paginate](https://github.com/jekyll/jekyll-paginate), if you specify the `paginate_path` in the `_config.yml`, it will read in `/PATH/TO/YOUR/BLOG/index.html` and write the output to `/PATH/TO/YOUR/BLOG/page:num/`. Please refer to the [Jekyll docs for pagination](https://jekyllrb.com/docs/pagination/).
|
19
121
|
|
122
|
+
To use the blog layout, create a file named with `index.html` and add these data inside:
|
20
123
|
```yaml
|
21
|
-
|
124
|
+
---
|
125
|
+
layout: blog
|
126
|
+
title: Blog
|
127
|
+
---
|
22
128
|
```
|
23
129
|
|
24
|
-
|
130
|
+
### Post
|
131
|
+
Before using this layout, be sure the conventions in Jekyll when writing a post:
|
132
|
+
- Put it in the `./_posts` folder
|
133
|
+
- Name it with the date first like `2021-08-05-My-blog-post.md`
|
25
134
|
|
26
|
-
|
135
|
+
You can refer to the [Jekyll docs for writing posts](https://jekyllrb.com/docs/posts/).
|
27
136
|
|
28
|
-
|
137
|
+
Now to use the post layout, add these data in your post:
|
138
|
+
```yaml
|
139
|
+
---
|
140
|
+
layout: post
|
141
|
+
title: YOUR POST TITLE
|
142
|
+
author: POST AUTHOR
|
143
|
+
tags: [TAG-A, TAG-B, TAG-C]
|
144
|
+
---
|
145
|
+
```
|
146
|
+
And then write down your post contents.
|
29
147
|
|
30
|
-
|
148
|
+
### Archive
|
149
|
+
Plaintro provides the archive page implemented in pure [Liquid](https://shopify.github.io/liquid/). It now only supports yead-based archive.
|
31
150
|
|
32
|
-
|
151
|
+
To use this, simply create a file and add these data in it:
|
152
|
+
```yaml
|
153
|
+
---
|
154
|
+
layout: blog-archive
|
155
|
+
title: Archive
|
156
|
+
---
|
157
|
+
```
|
33
158
|
|
34
|
-
|
159
|
+
### Portfolio
|
160
|
+
Porfolio is a feature page with portfolio layout, it contains all include template contents user provided.
|
161
|
+
|
162
|
+
To use it in your file like `porfolio.html`, first add these data inside:
|
163
|
+
```yaml
|
164
|
+
---
|
165
|
+
layout: portfolio
|
166
|
+
title: Portfolio
|
167
|
+
---
|
168
|
+
```
|
35
169
|
|
36
|
-
|
170
|
+
Next, add contents to your portfolio page, plaintro provides two include templates to help you achieve it:
|
171
|
+
- Template for each category, you just need to edit the **title** blank with the category name.
|
172
|
+
For example, replace "CATEGORY NAME" with "Projects".
|
173
|
+
|
174
|
+
```yaml
|
175
|
+
{% include /portfolio-category.html title="CATEGORY NAME" %}
|
176
|
+
```
|
177
|
+
- Template for each section (project), there are three blanks you need to edit:
|
178
|
+
- **description**: path to the short description of your section shown in the portfolio page.<br>
|
179
|
+
For example, `/portfolio/section-a.md`. It should be noted that this path MUST be under the `./_includes/` folder, i.e., the actual path of the above example is `./_includes/portfolio/section-a.md`, but you can skip the leading `./includes` as the desciption path.
|
180
|
+
- **image**: path to the cover image of your section.<br>
|
181
|
+
For example, `/assets/images/section-a.jpg`.
|
182
|
+
- **url**: path to your section page.<br>
|
183
|
+
For example, `/portfolio/section-a.html`.<br><br>
|
184
|
+
|
185
|
+
```yaml
|
186
|
+
{% include /portfolio-section.html
|
187
|
+
description="/PATH/TO/SECTION/DESCRIPTION"
|
188
|
+
image="/PATH/TO/SECTION/IMAGE"
|
189
|
+
url="/PATH/TO/SECTION/PAGE"
|
190
|
+
%}
|
191
|
+
```
|
192
|
+
|
193
|
+
To correctly use these templates, you can take [./portfolio/index.html](./portfolio/index.html) as a reference.
|
194
|
+
|
195
|
+
### Resume
|
196
|
+
To use resume layout in your file, simply add these data inside:
|
197
|
+
```yaml
|
198
|
+
---
|
199
|
+
layout: resume
|
200
|
+
title: Resume
|
201
|
+
---
|
202
|
+
```
|
203
|
+
Then you can take [resume.md](./resume.md) as a reference and write down the contents.
|
37
204
|
|
38
|
-
|
205
|
+
### Google Analytics
|
206
|
+
To track your website through [Google Analytics](https://analytics.google.com/analytics/web/), simply set the [Track ID](https://support.google.com/analytics/answer/7372977?hl=en) in your Jekyll site's `_config.yml`:
|
207
|
+
```yaml
|
208
|
+
google_analytics_id: UA-XXXXXXX-X
|
209
|
+
```
|
210
|
+
Or if you are using [Google Analytics 4](https://support.google.com/analytics/answer/10089681?hl=en), replace the [Track ID](https://support.google.com/analytics/answer/7372977?hl=en) with the [Measurement ID](https://support.google.com/analytics/answer/7372977?hl=en) in your Jekyll site's `_config.yml`:
|
211
|
+
```yaml
|
212
|
+
google_analytics_id: G-XXXXXXXX
|
213
|
+
```
|
39
214
|
|
40
|
-
|
215
|
+
## Contributing
|
216
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/xh5a5n6k6/plaintro. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
41
217
|
|
42
218
|
## Development
|
43
|
-
|
44
219
|
To set up your environment to develop this theme, run `bundle install`.
|
45
220
|
|
46
221
|
Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
|
@@ -49,6 +224,4 @@ When your theme is released, only the files in `_layouts`, `_includes`, `_sass`
|
|
49
224
|
To add a custom directory to your theme-gem, please edit the regexp in `plaintro.gemspec` accordingly.
|
50
225
|
|
51
226
|
## License
|
52
|
-
|
53
|
-
The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
54
|
-
|
227
|
+
The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/_config.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Site configuration
|
2
2
|
|
3
|
-
title: '
|
4
|
-
author: 'Author Name
|
3
|
+
title: 'Plaintro'
|
4
|
+
author: 'Author Name'
|
5
5
|
|
6
6
|
# Starting year shown in the footer
|
7
7
|
# i.e. Copyright [start_year]-[this_year]
|
@@ -28,13 +28,17 @@ url: https://xh5a5n6k6.github.io
|
|
28
28
|
# Page title will link to defualt_url
|
29
29
|
default_url: '/'
|
30
30
|
|
31
|
+
# google analytics Track/Measurement ID setup
|
32
|
+
google_analytics_id:
|
33
|
+
|
34
|
+
|
31
35
|
# Menu pages shown in the top-navigation
|
32
36
|
#
|
33
37
|
# it's recommended to use up to five pages.
|
34
38
|
menu:
|
35
39
|
- {name: 'Home', url: '/'}
|
36
40
|
|
37
|
-
# If using blog page, url MUST match paginate_path
|
41
|
+
# If using blog page, its url MUST match [paginate_path]
|
38
42
|
# set above
|
39
43
|
- {name: 'Blog', url: '/blog/'}
|
40
44
|
- {name: 'Portfolio', url: '/portfolio/'}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<!-- Global site tag (gtag.js) - Google Analytics -->
|
2
|
+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_id }}"></script>
|
3
|
+
<script>
|
4
|
+
window.dataLayer = window.dataLayer || [];
|
5
|
+
function gtag(){dataLayer.push(arguments);}
|
6
|
+
gtag('js', new Date());
|
7
|
+
|
8
|
+
gtag('config', '{{ site.google_analytics_id }}');
|
9
|
+
</script>
|
data/_includes/head.html
CHANGED
@@ -14,6 +14,10 @@
|
|
14
14
|
{% seo %}
|
15
15
|
{% feed_meta %}
|
16
16
|
|
17
|
+
{% if site.google_analytics_id and jekyll.environment == 'production' %}
|
18
|
+
{% include google-analytics.html %}
|
19
|
+
{% endif %}
|
20
|
+
|
17
21
|
<!-------------------------------------
|
18
22
|
Link icons powered by Font Awesome
|
19
23
|
-------------------------------------->
|
data/_sass/plaintro/_layout.scss
CHANGED
@@ -252,6 +252,7 @@ a:hover {
|
|
252
252
|
}
|
253
253
|
|
254
254
|
.site-portfolio-thumbnail img {
|
255
|
+
margin-bottom: 0.9em;
|
255
256
|
margin-top: 1.0em;
|
256
257
|
}
|
257
258
|
|
@@ -372,6 +373,10 @@ div.site-resume h1::after {
|
|
372
373
|
width: 100%;
|
373
374
|
}
|
374
375
|
|
376
|
+
.site-portfolio-thumbnail img {
|
377
|
+
margin-bottom: 0;
|
378
|
+
}
|
379
|
+
|
375
380
|
.site-portfolio-section .site-portfolio-content {
|
376
381
|
margin-top: 0;
|
377
382
|
width: 100%;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plaintro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chia-Yu Chou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- README.md
|
92
92
|
- _config.yml
|
93
93
|
- _includes/footer.html
|
94
|
+
- _includes/google-analytics.html
|
94
95
|
- _includes/head.html
|
95
96
|
- _includes/header.html
|
96
97
|
- _includes/portfolio-category.html
|