-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Pagination and Add *Some* CSS.
- Loading branch information
1 parent
f9f0c4b
commit df1f820
Showing
21 changed files
with
498 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# The Modified MIT License | ||
|
||
Copyright 2024-present by Reboot/Fitz, and Contributors. | ||
|
||
Tl;dr (this is non-legally binding, and is only here as an abridged explanation of the following **binding** legal disclaimer under "License"): All source code is open to free reproduction and modification; we actually encourage you to use RCGI as a base/inspiration to build your own websites! All non-original content has its creator/author/license listed under "Acknowledgements". Have fun! `:]` | ||
|
||
## License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software") with exception of dialogue (Text associated with actions (including but not limited to speaking, movement, physical interactions, etc) performed within the story (also known as the Software)), images, audio, and video; to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so. All dialogue, images, audio, and video which do not have a separate license and/or author listed at the bottom of this document under "Acknowledgements" are under an all rights reserved license and require the express permission of Reboot/Fitz to be redistributed/modified. Redistribution/usage of the Software is subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
## Acknowledgements | ||
|
||
it's quite empty here... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,32 @@ | ||
# Reboot/Fitz's Site | ||
|
||
![Last Commit](https://img.shields.io/github/last-commit/Reboot-Codes/new-rcgi) ![Repo Size](https://img.shields.io/github/languages/code-size/Reboot-Codes/new-rcgi?color=brightgreen) ![GitHub Actions Build Workflow Status](https://img.shields.io/github/actions/workflow/status/Reboot-Codes/new-rcgi/build.yml) | ||
|
||
This is a remake of RCGI because it's kinda... jank. So, instead, we're using 11ty this go around. | ||
|
||
## Build | ||
|
||
Install dependencies with yarn and use `yarn build`. Simple as that! Eleventy will take care of building the site. | ||
|
||
## Make Content | ||
|
||
### Posts | ||
|
||
To make a new post, just create it in `src/posts`. Give it a `title` in the front-matter, and everything else should be handled for you. | ||
|
||
Tags automatically have pages generated. | ||
|
||
### Projects | ||
|
||
To make a project, decide on a project ID (referenced here as `$PROJECT_ID`), then on related posts, tag them with `project:$PROJECT_ID`. | ||
|
||
In `src/projects`, make a page where the front-matter looks like the following: | ||
|
||
```yaml | ||
title: $PROJECT_TITLE | ||
projectId: $PROJECT_ID | ||
pagination: | ||
data: collections.project:$PROJECT_ID | ||
``` | ||
Where `$PROJECT_TITLE` is the pretty name for the project. The content of that page will be like a blurb displayed above the posts for that project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
{ | ||
"name": "rebootfitz-newsite", | ||
"scripts": { | ||
"build": "eleventy" | ||
"build": "eleventy", | ||
"dev": "eleventy --serve" | ||
}, | ||
"dependencies": { | ||
"@11ty/eleventy": ">=3.0.0-alpha.15", | ||
"@11ty/eleventy-plugin-rss": "^2.0.2", | ||
"eleventy-plugin-time-to-read": "^1.3.0", | ||
"markdown-it": "^14.1.0", | ||
"markdown-it-anchor": "^9.0.1", | ||
"sass": "^1.77.8" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<nav> | ||
<nav id="navbar" class="nav-bar"> | ||
<a id="section-title" class="nav-title" href="/">{% include "copywriting/sectionTitle.njk" %}</a> | ||
{% for navLink in nav %} | ||
<a href="{{ navLink.href }}">{{ navLink.title }}</a> | ||
<a id="nav-item-{{ loop.index }}" class="nav-item" href="{{ navLink.href }}">{{ navLink.title }}</a> | ||
{% endfor %} | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,52 @@ | ||
{% if ((pagination.hrefs | length) > 1) %} | ||
<ul> | ||
<li><a href="{{ pagination.hrefs[0] }}"{% if page.url == pagination.hrefs[0] %} aria-current="page"{% endif %}>First</a></li> | ||
<li>{% if pagination.href.previous %}<a href="{{ pagination.href.previous }}">Previous</a>{% else %}Previous{% endif %}</li> | ||
{%- for pageEntry in pagination.pages %} | ||
<li><a href="{{ pagination.hrefs[ loop.index0 ] }}"{% if page.url == pagination.hrefs[ loop.index0 ] %} aria-current="page"{% endif %}>Page {{ loop.index }}</a></li> | ||
{%- endfor %} | ||
<li>{% if pagination.href.next %}<a href="{{ pagination.href.next }}">Next</a>{% else %}Next{% endif %}</li> | ||
<li><a href="{{ pagination.hrefs[(pagination.hrefs | length) - 1] }}"{% if page.url == pagination.hrefs[-1] %} aria-current="page"{% endif %}>Last</a></li> | ||
<ul {% if paginationId %}id="{{ paginationId }}"{% endif %} class="pagination{% if paginationClasses %}{{ paginationClasses }}{% endif %}"> | ||
<li {% if paginationId %}id="{{ paginationId }}-first"{% endif %} class="pagination-first pagination-control"{% if page.url == pagination.hrefs[0] %} aria-current="page">First{% else %}><a href="{{ pagination.hrefs[0] }}">First</a>{% endif %}</li> | ||
<li {% if paginationId %}id="{{ paginationId }}-previous"{% endif %} class="pagination-previous pagination-control"{% if pagination.href.previous %}><a href="{{ pagination.href.previous }}">Previous</a>{% else %} aria-current="page">Previous{% endif %}</li> | ||
|
||
|
||
{% if ((pagination.pages | length) > 5) %} | ||
{% if pagination.pageNumber == 0 %} | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 1 }}" {% endif %} class="pagination-item pagination-control" aria-current="page">Page {{ pagination.pageNumber + 1 }}</li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 2 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber + 1] }}">Page {{ pagination.pageNumber + 2 }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 3 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber + 2] }}">Page {{ pagination.pageNumber + 3 }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 4 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber + 3] }}">Page {{ pagination.pageNumber + 4 }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 5 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber + 4] }}">Page {{ pagination.pageNumber + 5 }}</a></li> | ||
|
||
{% elif pagination.pageNumber == 1 %} | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber - 1] }}">Page {{ pagination.pageNumber }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 1 }}" {% endif %} class="pagination-item pagination-control" aria-current="page">Page {{ pagination.pageNumber + 1 }}</li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 2 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber + 1] }}">Page {{ pagination.pageNumber + 2 }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 3 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber + 2] }}">Page {{ pagination.pageNumber + 3 }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 4 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber + 3] }}">Page {{ pagination.pageNumber + 4 }}</a></li> | ||
|
||
{% elif pagination.pageNumber == ((pagination.pages | length) - 2) %} | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber - 2 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber - 3] }}">Page {{ pagination.pageNumber - 2 }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber - 1 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber - 2] }}">Page {{ pagination.pageNumber - 1 }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber - 1] }}">Page {{ pagination.pageNumber }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 1 }}" {% endif %} class="pagination-item pagination-control" aria-current="page">Page {{ pagination.pageNumber + 1 }}</li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 2 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber + 1] }}">Page {{ pagination.pageNumber + 2 }}</a></li> | ||
|
||
{% elif pagination.pageNumber == ((pagination.pages | length) - 1) %} | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber - 3 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber - 4] }}">Page {{ pagination.pageNumber - 3 }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber - 2 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber - 3] }}">Page {{ pagination.pageNumber - 2 }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber - 1 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber - 2] }}">Page {{ pagination.pageNumber - 1 }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber - 1] }}">Page {{ pagination.pageNumber }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 1 }}" {% endif %} class="pagination-item pagination-control" aria-current="page">Page {{ pagination.pageNumber + 1 }}</li> | ||
|
||
{% else %} | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber - 1 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber - 2] }}">Page {{ pagination.pageNumber - 1 }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber - 1] }}">Page {{ pagination.pageNumber }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 1 }}" {% endif %} class="pagination-item pagination-control" aria-current="page">Page {{ pagination.pageNumber + 1 }}</li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 2 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber + 1] }}">Page {{ pagination.pageNumber + 2 }}</a></li> | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ pagination.pageNumber + 3 }}" {% endif %} class="pagination-item pagination-control"><a href="{{ pagination.hrefs[pagination.pageNumber + 2] }}">Page {{ pagination.pageNumber + 3 }}</a></li> | ||
{% endif %} | ||
{% else %} | ||
{% for pageEntry in pagination.pages %} | ||
<li{% if paginationId %}id="{{ paginationId }}-item-{{ loop.index }}" {% endif %} class="pagination-item pagination-control" {% if page.url == pagination.hrefs[loop.index - 1] %} aria-current="page">Page {{ loop.index }}{% else %}><a href="{{ pagination.hrefs[ loop.index0 ] }}">Page {{ loop.index }}</a>{% endif %}</li> | ||
{% endfor %} | ||
{% endif %} | ||
|
||
<li{% if paginationId %}id="{{ paginationId }}-next" {% endif %} class="pagination-next pagination-control"{% if pagination.href.next %}><a href="{{ pagination.href.next }}">Next</a>{% else %} aria-current="page">Next{% endif %}</li> | ||
<li{% if paginationId %}id="{{ paginationId }}-last" {% endif %} class="pagination-last pagination-control"{% if page.url == pagination.hrefs[(pagination.hrefs | length) - 1] %} aria-current="page">Last{% else %}><a href="{{ pagination.hrefs[(pagination.hrefs | length) - 1] }}">Last</a>{% endif %}</li> | ||
</ul> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% if isBlog %}{{ generalData.blog.title }}{% elif isProject %}{{ generalData.workshop.title }}{% else %}{{ generalData.site.title }}{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% include "copywriting/sectionTitle.njk" %}{% if title %} - {{ title }}{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
--- | ||
layout: base.njk | ||
isBlog: true | ||
useContainer: true | ||
--- | ||
|
||
<h1>{{ title }}</h1> | ||
|
||
<p>on {{ page.date | formatDate }}, takes {{ content | timeToRead }} to read.</p> | ||
|
||
<h2>Tags</h2> | ||
{% if ((tags | length) > 1) %} | ||
<h2>Tags</h2> | ||
<ul> | ||
{% for tag in tags %} | ||
{% if tag != "post" %} | ||
{% if (tag | startsWith("project:")) %} | ||
<li><a href="/projects/{{ tag | strSlice(8) }}">Project: {% for project in collections.allProjects %}{% if (project.data.projectId == (tag | strSlice(8))) %}{{ project.data.title }}{% endif %}{% endfor %}</a></li> | ||
{% else %} | ||
<li><a>{{ tag }}</a></li> | ||
{% endif %} | ||
<ul> | ||
{% for tag in tags %} | ||
{% if tag != "post" %} | ||
{% if (tag | startsWith("project:")) %} | ||
<li><a href="/projects/{{ tag | strSlice(8) }}">Project: {% for project in collections.allProjects %}{% if (project.data.projectId == (tag | strSlice(8))) %}{{ project.data.title }}{% endif %}{% endfor %}</a></li> | ||
{% else %} | ||
<li><a href="/tags/{{ tag }}">{{ tag }}</a></li> | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
{% else %} | ||
<p>No tags</p> | ||
{% endif %} | ||
|
||
<div id="post-content" class="content"> | ||
{{ content | safe }} | ||
|
||
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ layout: base.njk | |
isProject: true | ||
pagination: | ||
size: 2 | ||
useContainer: true | ||
--- | ||
|
||
<h1>{{ title }}</h1> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Post 3 | ||
--- | ||
|
||
ahgsd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Post 4 | ||
--- | ||
|
||
ahgsd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Post 5 | ||
--- | ||
|
||
ahgsd |
Oops, something went wrong.