no-style-please 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2dec719d22b27ee9f9b2c86113bad50935bf622d1e219584d49aa7bb3c550a7f
4
- data.tar.gz: ec4c7d28d0670b0302bc0ce4dfec32871f698fd2e9c19f8375704b8c491011a2
3
+ metadata.gz: 442f43ae145f3cf3f4e0b9f9e8ef851a7b82f08bd339168c0e0b98825e49f732
4
+ data.tar.gz: 30e7d6afaea0f459f9942db138035c045d9eee83d44dcf029eed7250c414af67
5
5
  SHA512:
6
- metadata.gz: efe713095e4c0aa302209c841265a78508576bf9c67db508532f648a2b79585a21eaa6376ea097df15d23b7df68d4619f91adf5078d134004a672f510a6801e2
7
- data.tar.gz: 4a0b2f30b3373d22416cfd356f5c9fe5446ea21a564a2857b01b7499a908135b80c4cbc80775d8f7b6a34ecd97d0ff25904469aaa984f19e6e4d3052baad8c7d
6
+ metadata.gz: f575b2d5608c6cc903f6d9b025130430f2bc643712614ddfd12c86bc94b0eb2d5d2cfbe73cb88dd3ff27ab81fa84a84d18779c358510bcf6d263ac1f320db9c7
7
+ data.tar.gz: 8ab21365b756381780641d1621a1cb56a85058108147d6cc59e132121237187e2cfe7a8ee7d4aff582fd6dee551f6fe8779b44ba409cb04bf0ef929b70c7a19c
data/README.md CHANGED
@@ -9,7 +9,7 @@ Inspired by [elly's site](http://tilde.town/~elly/), expressly created for [my p
9
9
 
10
10
  ## Features
11
11
 
12
- * Fast (**< 1kb of CSS**, currently 955 bytes. 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))
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
13
  * Light, dark and auto modes
14
14
  * Responsive
15
15
  * Content first (typography optimized for maximum readability)
@@ -61,12 +61,39 @@ The `menu.yml` file accepts the following fields:
61
61
 
62
62
  - `entries` define a new unordered list that will contain menu entries
63
63
  - each entry is marked by a `-` at the beginning of the line
64
- - each entry has the following attributes:
65
- - `title`, which defines the text to render for that menu entry
66
- - `url`, which can either be a URL or `false`. If it is `false`, the entry will be rendered as plain text; otherwise the entry will be rendered as a link pointing to the specified URL. Note that the URL can either be relative or absolute.
67
- - `post_list`, which can be `true` or `false`. If it is true, the entry will have all posts in the site as subentries. This is used to render your post list.
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.
68
73
  - `entries`, yes, you can have entries inside entries. In this way you can create nested sublists!
69
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
+
70
97
  ### Pro tips
71
98
 
72
99
  #### Dark mode for images
@@ -1,13 +1,14 @@
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/no-style-please # root address of the site
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
7
  A (nearly) no-CSS, fast, minimalist Jekyll theme.
7
8
 
8
9
  permalink: /:slug.html
9
10
 
10
- favicon: "./logo.png" # relative path to site's favicon
11
+ favicon: "logo.png" # name+extension of favicon (which must be put on the root folder)
11
12
  # goat_counter: "yoursitename" # put your GoatCounter name if you want to use GoatCounter analytics
12
13
 
13
14
  theme: no-style-please # if you are using GitHub Pages, change it to remote_theme: riggraz/no-style-please
@@ -0,0 +1 @@
1
+ <a href="{{ "/" | relative_url }}">{{ site.theme_config.back_home_text }}</a>
@@ -4,16 +4,16 @@
4
4
  <meta name="viewport" content="width=device-width, initial-scale=1" />
5
5
 
6
6
  <title>
7
- {% if page.title %}
7
+ {%- if page.title -%}
8
8
  {{ page.title }}
9
- {% else %}
9
+ {%- else -%}
10
10
  {{ site.title }}
11
- {% endif %}
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="/{{ site.favicon }}" />
18
- <link rel="stylesheet" href="{{ site.url }}/assets/css/main.css" />
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>
@@ -1,18 +1,25 @@
1
1
  <ul>
2
2
  {% for item in include.collection %}
3
3
  <li>
4
- {% if item.url != false %}
4
+ {%- if item.url -%}
5
5
  <a href="{{ item.url }}">{{ item.title }}</a>
6
- {% else %}
6
+ {%- else -%}
7
7
  {{ item.title }}
8
- {% endif %}
8
+ {%- endif -%}
9
9
  </li>
10
10
 
11
- {% if item.post_list == true %}
12
- {% include post_list.html %}
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 != blank %}
22
+ {% if item.entries %}
16
23
  {% include menu_item.html collection=item.entries %}
17
24
  {% endif %}
18
25
  {% endfor %}
@@ -1,9 +1,25 @@
1
- {% if site.posts.size > 0 %}
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
- {% for post in site.posts %}
4
- <li>
5
- {{ post.date | date: site.theme_config.date_format }} <a href="{{ post.url | relative_url }}">{{ post.title | downcase }}</a>
6
- </li>
7
- {% endfor %}
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
- {% endif %}
25
+ {%- endif -%}
@@ -0,0 +1,9 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ {% include back_link.html %}
6
+
7
+ <h1>{{ page.title }}</h1>
8
+
9
+ {% include post_list.html category=page.which_category %}
@@ -1,15 +1,15 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="{{ page.lang | default: "en" }}">
3
- {%- include head.html -%}
4
- <body a="{{ site.theme_config.appearance | default: "auto" }}">
3
+ {%- include head.html -%}
4
+ <body a="{{ site.theme_config.appearance | default: "auto" }}">
5
5
  <main class="page-content" aria-label="Content">
6
- <div class="w">
7
- {{ content }}
8
- </div>
6
+ <div class="w">
7
+ {{ content }}
8
+ </div>
9
9
  </main>
10
10
 
11
11
  {% if site.goat_counter and jekyll.environment == "production" %}
12
- {% include goat_counter.html %}
12
+ {% include goat_counter.html %}
13
13
  {% endif %}
14
- </body>
14
+ </body>
15
15
  </html>
@@ -3,9 +3,11 @@ layout: default
3
3
  ---
4
4
  <header>
5
5
  <h1>{{ site.title }}</h1>
6
- {% if site.theme_config.show_description == true %}
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 }}
@@ -0,0 +1,9 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ {% include back_link.html %}
6
+
7
+ <h1>{{ page.title }}</h1>
8
+
9
+ {{ content }}
@@ -2,6 +2,14 @@
2
2
  layout: default
3
3
  ---
4
4
 
5
- <a href="{{ site.url }}">{{ site.theme_config.back_home_text }}</a>
6
- <h1>{{ page.title }}</h1>
7
- {{ content }}
5
+ {% include back_link.html %}
6
+
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>
@@ -19,7 +19,7 @@ body[a="dark"] { @include dark-appearance; }
19
19
  // bg color is also needed in html in order to
20
20
  // block body's background propagation
21
21
  // see: https://stackoverflow.com/a/61265706
22
- html, body { background-color: white; }
22
+ html, body { background: white; }
23
23
 
24
24
  html { height: 100%; }
25
25
 
@@ -32,7 +32,9 @@ body {
32
32
  min-height: 100%;
33
33
  }
34
34
 
35
- h2, h3, h4, h5 { margin-top: 3rem; }
35
+ .post-meta { text-align: right; }
36
+
37
+ h2, h3, h4, h5, h6 { margin-top: 3rem; }
36
38
 
37
39
  hr { margin: 2rem 0; }
38
40
 
@@ -40,9 +42,10 @@ p { margin: 1rem 0; }
40
42
 
41
43
  li { margin: 0.4rem 0; }
42
44
 
43
- *:target { background-color: yellow; }
45
+ *:target { background: yellow; }
44
46
 
45
47
  .w {
48
+ width: fit-content;
46
49
  max-width: 640px;
47
50
  margin: 0 auto;
48
51
  padding: 4rem 2rem;
@@ -65,7 +68,7 @@ table, th, td {
65
68
 
66
69
  code {
67
70
  color: white;
68
- background-color: black;
71
+ background: black;
69
72
  }
70
73
 
71
74
  div.highlighter-rouge code {
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.3.1
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-09-26 00:00:00.000000000 Z
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
@@ -90,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
93
  - !ruby/object:Gem::Version
91
94
  version: '0'
92
95
  requirements: []
93
- rubygems_version: 3.1.2
96
+ rubygems_version: 3.0.3
94
97
  signing_key:
95
98
  specification_version: 4
96
99
  summary: A (nearly) no-CSS, fast, minimalist Jekyll theme.