jekyll-theme-linky 0.1.1 → 0.1.3
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 +47 -8
- data/_config.yml +5 -0
- data/_includes/analytics.html +2 -9
- data/_includes/custom-head.html +8 -2
- data/_includes/head.html +0 -1
- data/assets/preview.js +31 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 391ab2564daad6a0550ee053d459e31440517f1df1b2b053bc7a76449583d001
|
4
|
+
data.tar.gz: 529b2f07d6dad47ae3aa2877240dff09396056bbd3f58462578e897382d0f0cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7627cd4d20acd9f9a5acd9563a51188c5d7fa91015bc0441edae0456841794fa5328cea07254be4fcb984b4ea4696155e76c8ddb3484137872f5ae3c5c0ff0d7
|
7
|
+
data.tar.gz: f4a0d4b499fc8c34fe23151bc106cd1655e7998480e94d3b424be1ef64c9b8c62a9456772e9cfb7a6cdd329798f6f949089cf84271d0fa342b10445d91351f9a
|
data/README.md
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
# linky
|
2
2
|
|
3
|
-
|
3
|
+
A linktree-esque theme, built for static hosting and easy maintenance with [Decap CMS][decap].
|
4
|
+
|
5
|
+
<picture>
|
6
|
+
<source srcset="images/linky-home.webp" type="image/webp">
|
7
|
+
<img src="images/linky-home.png" alt="Linky Home Page">
|
8
|
+
</picture>
|
4
9
|
|
5
10
|
## Installation
|
6
11
|
|
7
|
-
Add this line to your Jekyll site's `Gemfile`:
|
12
|
+
Add this line to your [Jekyll][jekyll] site's `Gemfile`:
|
8
13
|
|
9
14
|
```ruby
|
10
15
|
gem "linky"
|
@@ -26,11 +31,9 @@ Or install it yourself as:
|
|
26
31
|
|
27
32
|
## Usage
|
28
33
|
|
29
|
-
Use the [links layout][ll] on any page (including the home page) to display a list of all items in the `links` collection. Any additional content
|
30
|
-
within your page will be displayed after the list.
|
34
|
+
Use the [links layout][ll] on any page (including the home page) to display a list of all items in the `links` collection. Any additional content within your page will be displayed after the list.
|
31
35
|
|
32
|
-
The `links` collection is defined by individual files in the `_links` folder. Only the YAML frontmatter of these files will be used; content
|
33
|
-
is unnecessary and will be ignored.
|
36
|
+
The `links` collection is defined by individual files in the `_links` folder. Only the YAML frontmatter of these files will be used; content is unnecessary and will be ignored.
|
34
37
|
|
35
38
|
You will need to add a `links` collection to your Jekyll config, which is as simple as adding
|
36
39
|
|
@@ -58,8 +61,7 @@ subheads:
|
|
58
61
|
|
59
62
|
### Colors
|
60
63
|
|
61
|
-
You can override the color scheme of a Links page by adding a `linky` section to your `_config.yml` (see [the example in this repo][config]) and
|
62
|
-
setting one or more of these values:
|
64
|
+
You can override the color scheme of a Links page by adding a `linky` section to your `_config.yml` (see [the example in this repo][config]) and setting one or more of these values:
|
63
65
|
|
64
66
|
```yml
|
65
67
|
linky:
|
@@ -111,6 +113,34 @@ expires: 2024-11-11
|
|
111
113
|
Note that this will only take effect on a rebuild; there's no runtime JavaScript, etc. to disable a link that's already been deployed.
|
112
114
|
|
113
115
|
|
116
|
+
## Update Links with Decap CMS
|
117
|
+
|
118
|
+
The whole point of this exercise (as opposed to adding links by hand or using a database-backed site) was to add/update links via a CMS, but still serve static HTML for the usual speed and safety reasons.
|
119
|
+
|
120
|
+
In my case, I'm using [Decap CMS][decap] and [Netlify][netlify]. The Decap view for [linky.roub.net][linky-home] looks like this:
|
121
|
+
|
122
|
+
<picture>
|
123
|
+
<source srcset="images/decap-home.webp" type="image/webp">
|
124
|
+
<img src="images/decap-home.png" alt="Decap CMS Home Page">
|
125
|
+
</picture>
|
126
|
+
|
127
|
+
Clicking on one of those links takes me to the detail page:
|
128
|
+
|
129
|
+
<picture>
|
130
|
+
<source srcset="images/decap-detail.webp" type="image/webp">
|
131
|
+
<img src="images/decap-detail.png" alt="Decap CMS Detail Page">
|
132
|
+
</picture>
|
133
|
+
|
134
|
+
See the [admin folder][admin] for the relevant configuration, as well as the JS that allows for a custom preview styles (which just uses the site's CSS).
|
135
|
+
|
136
|
+
Most of the admin's [config.yml][admin-config] will be the same regardless of your Decap setup, but some of the integration details (authorization, etc.) will differ if you're not using the same setup that I am. See the [Decap docs][decap-netlify] for information on the drop-in setup I'm using.
|
137
|
+
|
138
|
+
Copy the admin/index.html file from this repo into your Decap admin directory if you're using the matching Netlify setup. If not, make sure you add the script tag to enable our custom preview (it will work without the tag, but it will be ugly):
|
139
|
+
|
140
|
+
```html
|
141
|
+
<script src="/assets/preview.js"></script>
|
142
|
+
```
|
143
|
+
|
114
144
|
## Contributing
|
115
145
|
|
116
146
|
Bug reports and pull requests are welcome on GitHub at https://github.com/paulroub/linky. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](https://www.contributor-covenant.org/) code of conduct.
|
@@ -122,3 +152,12 @@ The theme is available as open source under the terms of the [MIT License](https
|
|
122
152
|
|
123
153
|
[ll]: https://github.com/paulroub/linky/blob/main/_layouts/links.html
|
124
154
|
[config]: https://github.com/paulroub/linky/blob/main/_config.yml
|
155
|
+
[linky-home]: https://linky.roub.net/
|
156
|
+
[decap-home-image]: images/decap-home.png
|
157
|
+
[decap-detail-image]: images/decap-detail.png
|
158
|
+
[netlify]: https://netlify.com/
|
159
|
+
[decap]: https://decapcms.org/
|
160
|
+
[decap-netlify]: https://decapcms.org/docs/choosing-a-backend/#setup-on-netlify
|
161
|
+
[admin]: https://github.com/paulroub/linky/blob/main/admin/
|
162
|
+
[admin-config]: https://github.com/paulroub/linky/blob/main/admin/config.yml
|
163
|
+
[jekyll]: https://jekyllrb.com/
|
data/_config.yml
CHANGED
@@ -28,12 +28,17 @@ description: >- # this means to ignore newlines until "baseurl:"
|
|
28
28
|
baseurl: "" # the subpath of your site, e.g. /blog
|
29
29
|
url: "" # the base hostname & protocol for your site, e.g. http://example.com
|
30
30
|
github_username: paulroub
|
31
|
+
plausible_io: linky.roub.net
|
31
32
|
|
32
33
|
# Build settings
|
33
34
|
theme: jekyll-theme-linky
|
34
35
|
plugins:
|
35
36
|
- jekyll-feed
|
36
37
|
|
38
|
+
exclude:
|
39
|
+
- VERSION
|
40
|
+
- bin
|
41
|
+
|
37
42
|
linky:
|
38
43
|
body_background: "#030303"
|
39
44
|
body_foreground: "#F0F0F0"
|
data/_includes/analytics.html
CHANGED
@@ -1,8 +1,5 @@
|
|
1
|
-
<!-- what's our env? {{ jekyll.environment }}, {{ site.plausible_io }} -->
|
2
1
|
{%- if jekyll.environment == 'production' -%}
|
3
|
-
|
4
|
-
|
5
|
-
{%- if site.google_analytics -%}
|
2
|
+
{%- if site.google_analytics -%}
|
6
3
|
<script
|
7
4
|
async
|
8
5
|
src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"
|
@@ -23,14 +20,10 @@
|
|
23
20
|
</script>
|
24
21
|
{%- endif -%}
|
25
22
|
{%- if site.plausible_io -%}
|
26
|
-
<!-- BEGIN PLAUSIBLE -->
|
27
23
|
<script
|
28
24
|
defer
|
29
25
|
data-domain="{{ site.plausible_io }}"
|
30
26
|
src="https://plausible.io/js/script.outbound-links.js"
|
31
27
|
></script>
|
32
|
-
<!-- END PLAUSIBLE -->
|
33
|
-
{%- endif -%}
|
34
|
-
<!-- END ANALYTICS -->
|
35
|
-
|
36
28
|
{%- endif -%}
|
29
|
+
{%- endif -%}
|
data/_includes/custom-head.html
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
{% comment %}
|
2
|
-
|
2
|
+
Add any extra head information here, e.g. your own favicons. None of the content below is required for your own site.
|
3
3
|
|
4
4
|
1. Head over to https://realfavicongenerator.net/ to add your own favicons.
|
5
|
-
2.
|
5
|
+
2. Add _includes/custom-head.html in your source directory and insert the given code snippet.
|
6
6
|
{% endcomment %}
|
7
|
+
|
8
|
+
<link rel="icon" href="/favicon.ico" sizes="any">
|
9
|
+
<link rel="icon" href="/linky.svg" type="image/svg+xml">
|
10
|
+
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
11
|
+
|
12
|
+
<meta property="og:image" content="https://linky.roub.net/images/linky-home.png" />
|
data/_includes/head.html
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
5
5
|
{%- seo -%} {%- feed_meta -%}
|
6
|
-
<link rel="icon" href="/favicon.ico" sizes="any" />
|
7
6
|
|
8
7
|
<link rel="stylesheet" href="/assets/styles.css" />
|
9
8
|
|
data/assets/preview.js
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
var LinkPreview = createClass({
|
2
|
+
render: function () {
|
3
|
+
const entry = this.props.entry;
|
4
|
+
const imageStr = entry.getIn(["data", "image"]);
|
5
|
+
const image = this.props.getAsset(imageStr);
|
6
|
+
const title = entry.getIn(["data", "title"]);
|
7
|
+
const link = entry.getIn(["data", "link"]);
|
8
|
+
|
9
|
+
return h(
|
10
|
+
"ul",
|
11
|
+
{ class: "links" },
|
12
|
+
h(
|
13
|
+
"li",
|
14
|
+
{ class: "link" },
|
15
|
+
h(
|
16
|
+
"a",
|
17
|
+
{ href: link },
|
18
|
+
h("img", {
|
19
|
+
src: image.toString(),
|
20
|
+
class: "link-logo",
|
21
|
+
alt: title,
|
22
|
+
})
|
23
|
+
),
|
24
|
+
h("a", { class: "link-desc", href: link }, title)
|
25
|
+
)
|
26
|
+
);
|
27
|
+
},
|
28
|
+
});
|
29
|
+
|
30
|
+
CMS.registerPreviewTemplate("links", LinkPreview);
|
31
|
+
CMS.registerPreviewStyle("/assets/styles.css");
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-theme-linky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Roub
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -64,11 +64,13 @@ files:
|
|
64
64
|
- assets/images/threads-logo.svg
|
65
65
|
- assets/images/tiktok-logo.svg
|
66
66
|
- assets/images/venmo-logo.svg
|
67
|
+
- assets/preview.js
|
67
68
|
- assets/styles.scss
|
68
69
|
homepage: http://github.com/paulroub/linky
|
69
70
|
licenses:
|
70
71
|
- MIT
|
71
|
-
metadata:
|
72
|
+
metadata:
|
73
|
+
source_code_uri: https://github.com/paulroub/linky/
|
72
74
|
post_install_message:
|
73
75
|
rdoc_options: []
|
74
76
|
require_paths:
|