no-style-please 0.1.6 → 0.4.0
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 +4 -4
- data/README.md +57 -9
- data/_config.yml +7 -3
- data/_includes/back_link.html +1 -0
- data/_includes/head.html +5 -5
- data/_includes/menu_item.html +13 -6
- data/_includes/post_list.html +23 -7
- data/_layouts/archive.html +9 -0
- data/_layouts/default.html +7 -7
- data/_layouts/home.html +4 -2
- data/_layouts/page.html +9 -0
- data/_layouts/post.html +10 -11
- data/_sass/no-style-please.scss +44 -8
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 442f43ae145f3cf3f4e0b9f9e8ef851a7b82f08bd339168c0e0b98825e49f732
|
4
|
+
data.tar.gz: 30e7d6afaea0f459f9942db138035c045d9eee83d44dcf029eed7250c414af67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f575b2d5608c6cc903f6d9b025130430f2bc643712614ddfd12c86bc94b0eb2d5d2cfbe73cb88dd3ff27ab81fa84a84d18779c358510bcf6d263ac1f320db9c7
|
7
|
+
data.tar.gz: 8ab21365b756381780641d1621a1cb56a85058108147d6cc59e132121237187e2cfe7a8ee7d4aff582fd6dee551f6fe8779b44ba409cb04bf0ef929b70c7a19c
|
data/README.md
CHANGED
@@ -1,10 +1,21 @@
|
|
1
1
|
# no style, please!
|
2
2
|
|
3
|
-
<img src="
|
3
|
+
<img src="https://raw.githubusercontent.com/riggraz/no-style-please/master/logo.png" width="64" align="left" />A (nearly) no-CSS, fast, minimalist [Jekyll](https://jekyllrb.com/) theme.
|
4
|
+
Inspired by [elly's site](http://tilde.town/~elly/), expressly created for [my personal blog](https://riggraz.dev/).
|
4
5
|
|
5
|
-
|
6
|
+
<h3 align="center"><a href="https://riggraz.dev/no-style-please/">Try the demo out!</a></h3>
|
6
7
|
|
7
|
-
<img src="
|
8
|
+
<img src="https://raw.githubusercontent.com/riggraz/no-style-please/master/_screenshots/featured-image.png" />
|
9
|
+
|
10
|
+
## Features
|
11
|
+
|
12
|
+
* Fast (**1kb of CSS!** For more information on performance and more, see [Page Speed Insights report](https://raw.githubusercontent.com/riggraz/no-style-please/master/_screenshots/page-speed-insights-report.png) and [Lighthouse report](https://raw.githubusercontent.com/riggraz/no-style-please/master/_screenshots/lighthouse-report.png))
|
13
|
+
* Light, dark and auto modes
|
14
|
+
* Responsive
|
15
|
+
* Content first (typography optimized for maximum readability)
|
16
|
+
* SEO optimized (uses [Jekyll SEO Tag](https://github.com/jekyll/jekyll-seo-tag))
|
17
|
+
* RSS feed (uses [Jekyll Feed](https://github.com/jekyll/jekyll-feed))
|
18
|
+
* Fully compatible with [GitHub Pages](https://pages.github.com/) (see [GitHub Pages installation](#github-pages-installation))
|
8
19
|
|
9
20
|
## Installation
|
10
21
|
|
@@ -38,7 +49,7 @@ If you want to use this theme for your Jekyll's site deployed on [GitHub Pages](
|
|
38
49
|
|
39
50
|
## Usage
|
40
51
|
|
41
|
-
You can edit `_config.yml` file to customize your blog. You can change things such as the name of the blog, the author, how dates are formatted, etc. Customizable fields should be straightforward to understand,
|
52
|
+
You can edit `_config.yml` file to customize your blog. You can change things such as the name of the blog, the author, the appearance of the theme (light, dark or auto), how dates are formatted, etc. Customizable fields should be straightforward to understand. Still, `_config.yml` contains some comments to help you understand what each field does.
|
42
53
|
|
43
54
|
For further customization (e.g. layout, CSS) see the [official Jekyll's documentation](https://jekyllrb.com/docs/themes/#overriding-theme-defaults) on customizing gem-based themes.
|
44
55
|
|
@@ -50,15 +61,52 @@ The `menu.yml` file accepts the following fields:
|
|
50
61
|
|
51
62
|
- `entries` define a new unordered list that will contain menu entries
|
52
63
|
- each entry is marked by a `-` at the beginning of the line
|
53
|
-
- each entry
|
54
|
-
- `title`, which defines the text to render for
|
55
|
-
- `url`, which can
|
56
|
-
- `post_list`, which can be `true` or
|
64
|
+
- each entry can have the following attributes:
|
65
|
+
- `title`, which defines the text to render for this menu entry (**NB: you can also specify HTML!**)
|
66
|
+
- `url`, which can be used to specify an URL for this entry. If not specified, `title` will be rendered as-is; otherwise `title` will be sorrounded by a link tag pointing to the specified URL. Note that the URL can either be relative or absolute. Also note that you can get the same result by placing an ```<a>``` tag in the `title` field.
|
67
|
+
- `post_list`, which can be set either to `true` or to an object. If it is true, the entry will have a list of all posts as subentries. This is used to render your post list. If you want to customize which posts to render (e.g. by category), you can add one or more of the following attributes under `post_list`:
|
68
|
+
- `category`, which can be set to a string. It is used to render a list of posts of the specified category only. If you don't set it, then posts of all categories will be rendered.
|
69
|
+
- `limit`, which can be set to a number. It specifies the number of posts to show. If not set, all posts will be rendered.
|
70
|
+
- `show_more`, which can be true. If it is true and if the number of posts to show is greater than the specified `limit`, render a link to another page. To specify the URL and the text of the link, you can set `show_more_url` and `show_more_text` attributes, which are documented below.
|
71
|
+
- `show_more_url`, which can be a string. It specifies the URL for the show more link. Use only if `show_more` is true. This will usually redirect to a page containing all posts, which you can easily create using an archive page (see [create archive pages](#create-archive-pages) section)
|
72
|
+
- `show_more_text`, which can be a string. It specifies the text for the show more link. Use only if `show_more` is true.
|
57
73
|
- `entries`, yes, you can have entries inside entries. In this way you can create nested sublists!
|
58
74
|
|
75
|
+
### Create archive pages
|
76
|
+
|
77
|
+
A so-called archive page is a page that shows a list of posts (see [this](https://riggraz.dev/no-style-please/all-posts) for an example). You can create an archive page by creating a page and putting the following frontmatter:
|
78
|
+
|
79
|
+
```
|
80
|
+
---
|
81
|
+
layout: archive
|
82
|
+
title: The title of the page here
|
83
|
+
which_category: name-of-category
|
84
|
+
---
|
85
|
+
```
|
86
|
+
|
87
|
+
`which_category` is optional: if you don't put it, then all posts of the blog will be listed; on the other hand, if you specify a category, only posts of that category will be shown.
|
88
|
+
|
89
|
+
This feature is particularly useful if used together with the `show_more` attribute in the menu. For example, if you want to limit the number of posts shown in the home page to 5 but add a link to view them all, then you can create an archive page using the method showed above and link to it using the `show_more_url` attribute in `menu.yml`. See [this example](https://github.com/riggraz/no-style-please/blob/master/_data/menu.yml) if you're in doubt.
|
90
|
+
|
91
|
+
### Customize the index page
|
92
|
+
|
93
|
+
The `index.md` page should use layout `home`, which is the layout that displays the menu. If you want to have some content after the menu, you can just add that content in the `index.md` file, and it will automatically show under the menu.
|
94
|
+
|
95
|
+
Another thing you can do to customize the index page is show the description of your blog between the title and the menu. To do this, just edit `_config.yml` and change `theme_config.show_description` to `true`.
|
96
|
+
|
97
|
+
### Pro tips
|
98
|
+
|
99
|
+
#### Dark mode for images
|
100
|
+
|
101
|
+
This theme provides dark mode by inverting all colors of light mode throught the CSS `invert()` function. This approach would also invert the color of all images, but, since this is not the behaviour one would expect, images are not inverted by default.
|
102
|
+
|
103
|
+
However, if you would like to force the color inversion on a specific image you can do so by applying `class="ioda"` to that image ("ioda" stands for "invert on dark appearance"). See the image in the [overview post](https://github.com/riggraz/no-style-please/blob/master/_posts/2020-07-07-overview-post.md) for an example of this approach. Note that color inversion will take place only when the theme has dark appearance!
|
104
|
+
|
105
|
+
For example, if you have a black and white image it could make sense to invert it in dark mode. On the other hand, a colorful image will probably look bad if inverted.
|
106
|
+
|
59
107
|
## Contributing
|
60
108
|
|
61
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
109
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/riggraz/no-style-please. 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.
|
62
110
|
|
63
111
|
## Development
|
64
112
|
|
data/_config.yml
CHANGED
@@ -1,16 +1,20 @@
|
|
1
1
|
title: no style, please! # name of the site
|
2
2
|
author: Riccardo Graziosi # name of site's author
|
3
3
|
email: riccardo.graziosi97@gmail.com # email of site's author
|
4
|
-
url: https://riggraz.dev
|
4
|
+
url: https://riggraz.dev # root address of the site
|
5
|
+
baseurl: "/no-style-please" # subpath of the site, e.g. "/blog" (leave it blank "" if you're site shouldn't use a subpath)
|
5
6
|
description: > # description of the site (multiple lines allowed)
|
6
|
-
A (nearly) no-
|
7
|
+
A (nearly) no-CSS, fast, minimalist Jekyll theme.
|
7
8
|
|
8
|
-
|
9
|
+
permalink: /:slug.html
|
10
|
+
|
11
|
+
favicon: "logo.png" # name+extension of favicon (which must be put on the root folder)
|
9
12
|
# goat_counter: "yoursitename" # put your GoatCounter name if you want to use GoatCounter analytics
|
10
13
|
|
11
14
|
theme: no-style-please # if you are using GitHub Pages, change it to remote_theme: riggraz/no-style-please
|
12
15
|
|
13
16
|
theme_config:
|
17
|
+
appearance: "auto" # can be "light", "dark" or "auto"
|
14
18
|
back_home_text: ".." # customize text for homepage link in post layout
|
15
19
|
date_format: "%Y-%m-%d" # customize how date is formatted
|
16
20
|
show_description: false # show blog description in home page
|
@@ -0,0 +1 @@
|
|
1
|
+
<a href="{{ "/" | relative_url }}">{{ site.theme_config.back_home_text }}</a>
|
data/_includes/head.html
CHANGED
@@ -4,16 +4,16 @@
|
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
5
5
|
|
6
6
|
<title>
|
7
|
-
{
|
7
|
+
{%- if page.title -%}
|
8
8
|
{{ page.title }}
|
9
|
-
{
|
9
|
+
{%- else -%}
|
10
10
|
{{ site.title }}
|
11
|
-
{
|
11
|
+
{%- endif -%}
|
12
12
|
</title>
|
13
13
|
|
14
14
|
{% seo title=false %}
|
15
15
|
{% feed_meta %}
|
16
16
|
|
17
|
-
<link rel="shortcut icon" type="image/x-icon" href="
|
18
|
-
<link rel="stylesheet" href="{{
|
17
|
+
<link rel="shortcut icon" type="image/x-icon" href="{{ site.favicon | relative_url }}" />
|
18
|
+
<link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}" />
|
19
19
|
</head>
|
data/_includes/menu_item.html
CHANGED
@@ -1,18 +1,25 @@
|
|
1
1
|
<ul>
|
2
2
|
{% for item in include.collection %}
|
3
3
|
<li>
|
4
|
-
{
|
4
|
+
{%- if item.url -%}
|
5
5
|
<a href="{{ item.url }}">{{ item.title }}</a>
|
6
|
-
{
|
6
|
+
{%- else -%}
|
7
7
|
{{ item.title }}
|
8
|
-
{
|
8
|
+
{%- endif -%}
|
9
9
|
</li>
|
10
10
|
|
11
|
-
{% if item.post_list
|
12
|
-
{%
|
11
|
+
{% if item.post_list %}
|
12
|
+
{%
|
13
|
+
include post_list.html
|
14
|
+
category=item.post_list.category
|
15
|
+
limit=item.post_list.limit
|
16
|
+
show_more=item.post_list.show_more
|
17
|
+
show_more_text=item.post_list.show_more_text
|
18
|
+
show_more_url=item.post_list.show_more_url
|
19
|
+
%}
|
13
20
|
{% endif %}
|
14
21
|
|
15
|
-
{% if item.entries
|
22
|
+
{% if item.entries %}
|
16
23
|
{% include menu_item.html collection=item.entries %}
|
17
24
|
{% endif %}
|
18
25
|
{% endfor %}
|
data/_includes/post_list.html
CHANGED
@@ -1,9 +1,25 @@
|
|
1
|
-
{% if
|
1
|
+
{% if include.category %}
|
2
|
+
{% assign posts = site.categories[include.category] %}
|
3
|
+
{% else %}
|
4
|
+
{% assign posts = site.posts %}
|
5
|
+
{% endif %}
|
6
|
+
|
7
|
+
{% if include.limit and posts.size > include.limit %}
|
8
|
+
{% assign limit_exceeded = true %}
|
9
|
+
{% else %}
|
10
|
+
{% assign limit_exceeded = false %}
|
11
|
+
{% endif %}
|
12
|
+
|
13
|
+
{%- if posts.size > 0 -%}
|
2
14
|
<ul>
|
3
|
-
{
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
15
|
+
{%- for post in posts limit: include.limit -%}
|
16
|
+
<li>
|
17
|
+
<span>{{- post.date | date: site.theme_config.date_format -}}</span>
|
18
|
+
<a href="{{ post.url | relative_url }}">{{ post.title | downcase }}</a>
|
19
|
+
</li>
|
20
|
+
{%- endfor -%}
|
21
|
+
{%- if include.show_more and limit_exceeded -%}
|
22
|
+
<li><a href="{{ include.show_more_url }}">{{ include.show_more_text | default: "Show more..." }}</a></li>
|
23
|
+
{%- endif -%}
|
8
24
|
</ul>
|
9
|
-
{
|
25
|
+
{%- endif -%}
|
data/_layouts/default.html
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html lang="{{ page.lang | default: "en" }}">
|
3
|
-
|
4
|
-
|
3
|
+
{%- include head.html -%}
|
4
|
+
<body a="{{ site.theme_config.appearance | default: "auto" }}">
|
5
5
|
<main class="page-content" aria-label="Content">
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
<div class="w">
|
7
|
+
{{ content }}
|
8
|
+
</div>
|
9
9
|
</main>
|
10
10
|
|
11
11
|
{% if site.goat_counter and jekyll.environment == "production" %}
|
12
|
-
|
12
|
+
{% include goat_counter.html %}
|
13
13
|
{% endif %}
|
14
|
-
|
14
|
+
</body>
|
15
15
|
</html>
|
data/_layouts/home.html
CHANGED
@@ -3,9 +3,11 @@ layout: default
|
|
3
3
|
---
|
4
4
|
<header>
|
5
5
|
<h1>{{ site.title }}</h1>
|
6
|
-
{% if site.theme_config.show_description
|
6
|
+
{% if site.theme_config.show_description %}
|
7
7
|
<p>{{ site.description }}</p>
|
8
8
|
{% endif %}
|
9
9
|
</header>
|
10
10
|
|
11
|
-
{% include menu_item.html collection=site.data.menu.entries %}
|
11
|
+
{% include menu_item.html collection=site.data.menu.entries %}
|
12
|
+
|
13
|
+
{{ content }}
|
data/_layouts/page.html
ADDED
data/_layouts/post.html
CHANGED
@@ -2,15 +2,14 @@
|
|
2
2
|
layout: default
|
3
3
|
---
|
4
4
|
|
5
|
-
|
6
|
-
<h1>{{ page.title }}</h1>
|
7
|
-
{{ content }}
|
5
|
+
{% include back_link.html %}
|
8
6
|
|
9
|
-
<
|
10
|
-
<
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<
|
15
|
-
|
16
|
-
|
7
|
+
<article>
|
8
|
+
<p class="post-meta">
|
9
|
+
<time datetime="{{ page.date }}">{{ page.date | date: site.theme_config.date_format }}</time>
|
10
|
+
</p>
|
11
|
+
|
12
|
+
<h1>{{ page.title }}</h1>
|
13
|
+
|
14
|
+
{{ content }}
|
15
|
+
</article>
|
data/_sass/no-style-please.scss
CHANGED
@@ -1,12 +1,39 @@
|
|
1
|
-
|
1
|
+
// -------------- THEME SWITCHER -------------- //
|
2
|
+
@mixin dark-appearance {
|
3
|
+
filter: invert(1);
|
4
|
+
img {
|
5
|
+
filter: invert(1);
|
6
|
+
|
7
|
+
&.ioda { filter: invert(0); }
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
body[a="dark"] { @include dark-appearance; }
|
12
|
+
|
13
|
+
|
14
|
+
@media (prefers-color-scheme: dark) {
|
15
|
+
body[a="auto"] { @include dark-appearance; }
|
16
|
+
}
|
17
|
+
// -------------------------------------------- //
|
18
|
+
|
19
|
+
// bg color is also needed in html in order to
|
20
|
+
// block body's background propagation
|
21
|
+
// see: https://stackoverflow.com/a/61265706
|
22
|
+
html, body { background: white; }
|
23
|
+
|
24
|
+
html { height: 100%; }
|
25
|
+
|
26
|
+
body {
|
2
27
|
color: black;
|
3
|
-
background-color: white;
|
4
28
|
font-family: monospace;
|
5
29
|
font-size: 1.3rem;
|
6
30
|
line-height: 1.3;
|
7
|
-
|
31
|
+
margin: 0;
|
32
|
+
min-height: 100%;
|
8
33
|
}
|
9
34
|
|
35
|
+
.post-meta { text-align: right; }
|
36
|
+
|
10
37
|
h2, h3, h4, h5, h6 { margin-top: 3rem; }
|
11
38
|
|
12
39
|
hr { margin: 2rem 0; }
|
@@ -15,10 +42,13 @@ p { margin: 1rem 0; }
|
|
15
42
|
|
16
43
|
li { margin: 0.4rem 0; }
|
17
44
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
45
|
+
*:target { background: yellow; }
|
46
|
+
|
47
|
+
.w {
|
48
|
+
width: fit-content;
|
49
|
+
max-width: 640px;
|
50
|
+
margin: 0 auto;
|
51
|
+
padding: 4rem 2rem;
|
22
52
|
}
|
23
53
|
|
24
54
|
hr {
|
@@ -38,7 +68,7 @@ table, th, td {
|
|
38
68
|
|
39
69
|
code {
|
40
70
|
color: white;
|
41
|
-
background
|
71
|
+
background: black;
|
42
72
|
}
|
43
73
|
|
44
74
|
div.highlighter-rouge code {
|
@@ -53,4 +83,10 @@ blockquote {
|
|
53
83
|
padding: 1rem;
|
54
84
|
|
55
85
|
p { margin: 0; }
|
86
|
+
}
|
87
|
+
|
88
|
+
img {
|
89
|
+
max-width: 100%;
|
90
|
+
display: block;
|
91
|
+
margin: 0 auto;
|
56
92
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: no-style-please
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Riccardo Graziosi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -62,12 +62,15 @@ files:
|
|
62
62
|
- LICENSE.txt
|
63
63
|
- README.md
|
64
64
|
- _config.yml
|
65
|
+
- _includes/back_link.html
|
65
66
|
- _includes/goat_counter.html
|
66
67
|
- _includes/head.html
|
67
68
|
- _includes/menu_item.html
|
68
69
|
- _includes/post_list.html
|
70
|
+
- _layouts/archive.html
|
69
71
|
- _layouts/default.html
|
70
72
|
- _layouts/home.html
|
73
|
+
- _layouts/page.html
|
71
74
|
- _layouts/post.html
|
72
75
|
- _sass/no-style-please.scss
|
73
76
|
- assets/css/main.scss
|
@@ -93,5 +96,5 @@ requirements: []
|
|
93
96
|
rubygems_version: 3.0.3
|
94
97
|
signing_key:
|
95
98
|
specification_version: 4
|
96
|
-
summary: A (nearly) no-
|
99
|
+
summary: A (nearly) no-CSS, fast, minimalist Jekyll theme.
|
97
100
|
test_files: []
|