Skip to content

Commit d33efc6

Browse files
Tags and Responsiveness
1 parent 8cebb69 commit d33efc6

File tree

12 files changed

+228
-30
lines changed

12 files changed

+228
-30
lines changed

_characters/example.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ theme: # Leave empty to use "default.css"
66
style: 1 # 0 - Wiki | 1 - Full body
77
tags:
88
- example
9+
- one
910

1011
# Basic
1112
name: Character Name
@@ -103,7 +104,7 @@ gallery:
103104
permissions:
104105
Fan Works: Allowed
105106
Commissions: Ask First
106-
Shipping: No
107+
Shipping: Not Allowed
107108
OC Interaction: Allowed
108109
Franchise Interaction: Allowed
109110

_characters/example2.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ theme: # Leave empty to use "default.css"
66
style: 0 # 0 - Wiki | 1 - Full body
77
tags:
88
- example
9+
- two
910

1011
# Basic
1112
name: Character Name
@@ -102,7 +103,7 @@ gallery:
102103
permissions:
103104
Fan Works: Allowed
104105
Commissions: Ask First
105-
Shipping: No
106+
Shipping: Not Allowed
106107
OC Interaction: Allowed
107108
Franchise Interaction: Allowed
108109

_includes/footer.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<footer>
2-
<p>This is your footer.</p>
2+
<a target="_blank" href="https://github.com/RodFireProductions/Lil-Ref">
3+
<img class="b_88x31" src="{{ 'assets/img/buttons/lil_ref.png' | relative_url }}" alt="">
4+
</a>
35
</footer>

_layouts/character.html

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@
55
<meta charset=utf-8>
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
{% if page.theme %}
8-
<link rel=stylesheet href={{ "assets/css/" | append: page.theme | relative_url }}>
8+
<link rel=stylesheet href="{{ 'assets/css/' | append: page.theme | relative_url }}">
99
{% else %}
10-
<link rel=stylesheet href={{ "assets/css/default.css" | relative_url }}>
10+
<link rel=stylesheet href="{{ 'assets/css/default.css' | relative_url }}">
1111
{% endif %}
12-
<link rel=stylesheet href={{ "assets/css/universal.css" | relative_url }}>
12+
<link rel=stylesheet href="{{ 'assets/css/universal.css' | relative_url }}">
1313
{% case page.style %}
1414
{% when 0 %}
15-
<link rel=stylesheet href={{ "assets/css/wiki.css" | relative_url }}>
15+
<link rel=stylesheet href="{{ 'assets/css/wiki.css' | relative_url }}">
1616
{% when 1 %}
17-
<link rel=stylesheet href={{ "assets/css/full_body.css" | relative_url }}>
17+
<link rel=stylesheet href="{{ 'assets/css/full_body.css' | relative_url }}">
1818
{% endcase %}
19-
<link rel="shortcut icon" href={{ "assets/img/" | append: page.image.icon | relative_url }}>
19+
<link rel="shortcut icon" href="{{ 'assets/img/' | append: page.image.icon | relative_url }}">
2020
</head>
2121
<body>
2222
{% include navigation.html %}
2323

2424
{% if page.style == 1 %}
2525
<aside id="body-image">
26-
<img src={{ "assets/img/" | append: page.image.body | relative_url }} alt="Full body image of {{ page.name }}">
26+
<img src="{{ 'assets/img/' | append: page.image.body | relative_url }}" alt="Full body image of {{ page.name }}">
2727
</aside>
2828
{% endif %}
2929

@@ -38,7 +38,7 @@ <h1>{{ page.name }}</h1>
3838
<section id="attributes">
3939
{% if page.style == 0 %}
4040
<p class="wiki-name"><b>{{ page.name }}</b></p>
41-
<img src={{ "assets/img/" | append: page.image.block | relative_url }} alt="Image of {{ page.name }}">
41+
<img src="{{ 'assets/img/' | append: page.image.block | relative_url }}" alt="Image of {{ page.name }}">
4242
{% endif %}
4343
<table>
4444
<thead>
@@ -145,7 +145,7 @@ <h1>{{ page.name }}</h1>
145145
{% endcase %}
146146
{% for color in page.colors %}
147147
<button class="{{ clip | default: '' }}" style="background: #{{ color }}" onclick="clipboard('#{{ color }}')">
148-
<img src={{ "assets/img/ui/ICON_clipboard.png" | relative_url }} alt="Clipboard icon">
148+
<img src="{{ 'assets/img/ui/ICON_clipboard.png' | relative_url }}" alt="Clipboard icon">
149149
</button>
150150
{% endfor %}
151151
</aside>
@@ -197,7 +197,7 @@ <h2>Gallery</h2>
197197
<div>
198198
{% for image in page.gallery %}
199199
<a href="#image_{{ forloop.index }}">
200-
<img id="image{{ forloop.index }}" src={{ "assets/img/" | append: image[1].file | relative_url }} alt={{ image[0] }}>
200+
<img id="image{{ forloop.index }}" src="{{ 'assets/img/' | append: image[1].file | relative_url }}" alt={{ image[0] }}>
201201
</a>
202202
{% endfor %}
203203
</div>
@@ -238,11 +238,33 @@ <h2>Gallery</h2>
238238
{% endif %}
239239
</section>
240240
{% endif %}
241+
242+
{% if page.tags.size != 0 %}
243+
<section id="tags">
244+
{% unless page.permissions or page.ownership %}
245+
<hr>
246+
{% endunless %}
247+
<details>
248+
<summary>Tags</summary>
249+
<ul>
250+
{% assign tags = page.tags | uniq %}
251+
{% for tag in tags %}
252+
<li>
253+
{% capture url %}tag/{{ tag }}.html{% endcapture %}
254+
<a href="{{ url | relative_url }}">{{ tag }}</a>
255+
</li>
256+
{% endfor %}
257+
</ul>
258+
</details>
259+
260+
</section>
261+
{% endif %}
241262
</main>
263+
242264
{% for image in page.gallery %}
243265
<aside id="image_{{ forloop.index }}" class="full-image">
244266
<div class="image-view">
245-
<img src={{ "assets/img/" | append: image[1].file | relative_url }} alt="{{ image[1].alt | default: image[0] }}">
267+
<img src="{{ 'assets/img/' | append: image[1].file | relative_url }}" alt="{{ image[1].alt | default: image[0] }}">
246268

247269
<div class="image-nav">
248270
{% unless forloop.first %}
@@ -295,6 +317,6 @@ <h1>{{ image[0] }}</h1>
295317
{% include footer.html %}
296318
</body>
297319
{% if page.colors.size > 0 %}
298-
<script src={{ "assets/js/clipboard.js" | relative_url }} charset="utf-8"></script>
320+
<script src="{{ 'assets/js/clipboard.js' | relative_url }}" charset="utf-8"></script>
299321
{% endif %}
300322
</html>

_layouts/tag.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html lang={{ site.language }}>
3+
<head>
4+
<title>{{ page.title }}</title>
5+
<meta charset=utf-8>
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<link rel=stylesheet href={{ 'assets/css/default.css' | relative_url }}>
8+
<link rel=stylesheet href={{ 'assets/css/universal.css' | relative_url }}>
9+
<link rel="shortcut icon" href={{ 'favicon.ico' | relative_url }}>
10+
</head>
11+
<body>
12+
<header>
13+
<h1>{{ page.title }}</h1>
14+
{% include navigation.html %}
15+
</header>
16+
<main>
17+
18+
{% include character_widget_group.html characters=page.characters %}
19+
20+
</main>
21+
{% include footer.html %}
22+
</body>
23+
</html>

_pages/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ group:
88
- c:example
99
---
1010

11-
## Displaying and individual widget.
11+
## Displaying an individual widget.
1212
{% include character_widget.html character="c:example" %}
1313

1414
## Displaying a group of widgets.

_plugins/Tags.rb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
module Jekyll
2+
class TagPageGenerator < Generator
3+
safe true
4+
5+
def generate(site)
6+
tags = Hash.new
7+
for char in site.documents
8+
for tag in char["tags"]
9+
if tags.has_key? tag.downcase
10+
unless tags[tag.downcase].include? char.char_id
11+
tags[tag.downcase] << char.char_id
12+
end
13+
else
14+
tags[tag.downcase] = [char.char_id]
15+
end
16+
end
17+
end
18+
19+
tags.each do | tag, characters|
20+
site.pages << TagPage.new(site, tag, characters)
21+
end
22+
23+
end
24+
end
25+
26+
class TagPage < Page
27+
def initialize(site, tag, characters)
28+
@site = site
29+
@base = site.source
30+
@dir = "tag"
31+
32+
@basename = tag
33+
@ext = '.html'
34+
@name = "#{tag}.html"
35+
36+
@data = {
37+
'characters' => characters,
38+
'tag' => tag,
39+
'title' => "Tagged #{tag}",
40+
'layout' => "tag"
41+
}
42+
end
43+
end
44+
end

assets/css/full_body.css

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,33 @@ section h2 {
5656
#attributes td:nth-child(2) {
5757
border-right: 1px var(--accent-color) dotted;
5858
}
59+
60+
/* Footer */
61+
62+
footer {
63+
display: block;
64+
width: 80%;
65+
margin: auto;
66+
margin-right: 0;
67+
}
68+
69+
/* Media Queries */
70+
71+
@media only screen and (max-width: 600px) {
72+
main {
73+
width: auto;
74+
}
75+
76+
#body-image {
77+
float: left;
78+
width: 25%;
79+
}
80+
81+
#attributes table {
82+
width: 75%;
83+
}
84+
85+
footer {
86+
margin: auto;
87+
}
88+
}

0 commit comments

Comments
 (0)