huge restructure to give flexibility with blog posts and mobile layouts
This commit is contained in:
10
.eleventy.js
10
.eleventy.js
@ -4,6 +4,16 @@ module.exports = function (eleventyConfig) {
|
||||
eleventyConfig.addPassthroughCopy("./src/_assets/fonts");
|
||||
eleventyConfig.addPassthroughCopy("./src/_assets/js");
|
||||
|
||||
eleventyConfig.addCollection("tagsList", function(collectionApi) {
|
||||
const tagsList = new Set();
|
||||
collectionApi.getAll().map( item => {
|
||||
if (item.data.tags) { // handle pages that don't have tags
|
||||
item.data.tags.map( tag => tagsList.add(tag))
|
||||
}
|
||||
});
|
||||
return tagsList;
|
||||
});
|
||||
|
||||
return {
|
||||
passthroughFileCopy: true,
|
||||
dir: {
|
||||
|
@ -24,6 +24,10 @@
|
||||
/* --text-light: #585858; */
|
||||
--border: #6a826a;
|
||||
--accent: #aa5757;
|
||||
--content-column-width: 750px;
|
||||
/* this width was 200 but i stretched it out to fit the gif */
|
||||
--sidebar-column-width: 287px;
|
||||
--line-padding: 8px;
|
||||
}
|
||||
|
||||
html {
|
||||
@ -36,17 +40,21 @@ html {
|
||||
/* Format headers */
|
||||
|
||||
h1 {
|
||||
font-size: 2.5rem;
|
||||
font-size: 1.8rem;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
color: var(--header-text);
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 2rem;
|
||||
margin-top: 3rem;
|
||||
font-size: 1.5rem;
|
||||
margin-top: var(--line-padding);
|
||||
margin-bottom: var(--line-padding);
|
||||
color: var(--header-text);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.2rem;
|
||||
color: var(--header-text);
|
||||
}
|
||||
|
||||
@ -54,20 +62,26 @@ h3 {
|
||||
a,
|
||||
a:visited {
|
||||
color: var(--accent);
|
||||
display: inline-block;
|
||||
transition: transform .07s ease-out;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
transform: translate(0px,-2px);
|
||||
}
|
||||
|
||||
a:has(img):hover {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: 1px solid var(--border);
|
||||
border-top: 5px solid var(--border);
|
||||
}
|
||||
|
||||
body {
|
||||
color: var(--text);
|
||||
background: var(--bg);
|
||||
/* background-image: url("/img/l_ash02_big.jpg"); */
|
||||
background-size: cover;
|
||||
background-attachment: fixed;
|
||||
line-height: 1.3;
|
||||
@ -75,22 +89,27 @@ body {
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 20px;
|
||||
margin: 20px;
|
||||
height: 100%;
|
||||
/* padding: 0 1em; */
|
||||
/* font-size: 1.15rem; */
|
||||
min-height: 100vh;
|
||||
/* align-items: flex-start; */
|
||||
/* background-image: url("/img/l_ash02_big.jpg"); */
|
||||
/* font-size: 1.15rem; */
|
||||
/* height: 100vh; */
|
||||
/* margin: 20px; */
|
||||
/* padding: 0 1em; */
|
||||
}
|
||||
|
||||
main {
|
||||
/* // margin: 0 auto; */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
background: var(--container);
|
||||
width: 750px;
|
||||
width: var(--content-column-width);
|
||||
padding: 15px;
|
||||
height: min-content;
|
||||
/* border: 2px solid var(--border); */
|
||||
border-radius: 15px;
|
||||
min-height: max-content;
|
||||
box-sizing: border-box;
|
||||
/* // margin: 0 auto; */
|
||||
/* border: 2px solid var(--border); */
|
||||
/* border-radius: 15px; */
|
||||
}
|
||||
|
||||
|
||||
@ -98,7 +117,7 @@ aside {
|
||||
position: sticky;
|
||||
height: min-content;
|
||||
top: 20px;
|
||||
width: 200px;
|
||||
width: var(--sidebar-column-width);
|
||||
margin-top: 30px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -108,12 +127,18 @@ aside {
|
||||
|
||||
.profile-img {
|
||||
width: 100px;
|
||||
border-radius: 50px;
|
||||
border-radius: 60px;
|
||||
border: 5px solid var(--border);
|
||||
/* top: -70px; */
|
||||
z-index: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.sidebar-contents {
|
||||
padding: 65px 15px 15px 15px;
|
||||
border-radius: 15px;
|
||||
@ -129,23 +154,42 @@ aside {
|
||||
body {
|
||||
flex-direction: column-reverse;
|
||||
max-width: 100%;
|
||||
justify-content: start;
|
||||
/* this is a pretty bad solution */
|
||||
margin: -20px 20px 20px;
|
||||
gap: 0;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
main {
|
||||
max-width: 100%;
|
||||
flex-grow: 1;
|
||||
margin-bottom: -20px;
|
||||
}
|
||||
|
||||
aside {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: var(--content-column-width);
|
||||
margin-top: 0;
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
/* nav {
|
||||
display: flex;
|
||||
.sidebar-contents {
|
||||
border-radius: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.sidebar-contents>img{
|
||||
display: none;
|
||||
}
|
||||
|
||||
nav {
|
||||
flex-direction: row;
|
||||
gap: 1rem;
|
||||
} */
|
||||
flex-wrap: wrap;
|
||||
gap: 0rem 1rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.sidebar-contents {
|
||||
/* padding: 15px; */
|
||||
@ -153,6 +197,9 @@ aside {
|
||||
/* width: min-content; */
|
||||
}
|
||||
|
||||
/* a:hover {
|
||||
transform: none;
|
||||
} */
|
||||
}
|
||||
|
||||
article>p {
|
||||
@ -160,6 +207,15 @@ article>p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
article>iframe {
|
||||
padding-top: var(--line-padding);
|
||||
padding-bottom: var(--line-padding);
|
||||
}
|
||||
|
||||
header>h1 {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* body > footer {
|
||||
margin-top: 4rem;
|
||||
padding: 2rem 1rem 1.5rem 1rem;
|
||||
|
BIN
src/_assets/img/143.gif
Normal file
BIN
src/_assets/img/143.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
@ -19,14 +19,18 @@
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div>
|
||||
<header>{% include 'partials/header.njk' %}</header>
|
||||
<hr/>
|
||||
<article>
|
||||
<h1>{{ title }}</h1>
|
||||
{{ content | safe }}
|
||||
</article>
|
||||
</div>
|
||||
<footer>
|
||||
<hr/>
|
||||
<footer>{% include 'partials/footer.njk' %}</footer>
|
||||
{% include 'partials/footer.njk' %}
|
||||
</footer>
|
||||
</main>
|
||||
<aside>{% include 'partials/sidebar.njk' %}</aside>
|
||||
</div>
|
||||
|
@ -1,9 +1,9 @@
|
||||
<nav>
|
||||
<a href="/">/</a><br/>
|
||||
<a href="/pages/">/pages</a><br/>
|
||||
<a href="/about/">/about</a><br/>
|
||||
<a href="/links/">/links</a><br/>
|
||||
<a href="/contact/">/contact</a><br/>
|
||||
<a href="/blog/">/blog</a><br/>
|
||||
<a href="/">/</a>
|
||||
<a href="/pages/">/pages</a>
|
||||
<a href="/about/">/about</a>
|
||||
<a href="/links/">/links</a>
|
||||
<a href="/contact/">/contact</a>
|
||||
<a href="/blog/">/blog</a>
|
||||
</nav>
|
||||
{#INFO: It's important to stucture your links with the slashes / on either side of the href /about/ to ensure the links are always from the root of the site.#}
|
@ -3,4 +3,5 @@
|
||||
</a>
|
||||
<div class="sidebar-contents">
|
||||
{% include 'partials/navigation.njk' %}
|
||||
<img src="/_assets/img/143.gif"/>
|
||||
</div>
|
4
src/anime/anime.json
Normal file
4
src/anime/anime.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"layout": "layout/blog",
|
||||
"tags": "anime"
|
||||
}
|
@ -3,10 +3,3 @@ title: blog
|
||||
layout: layout/base.njk
|
||||
eleventyImport.collections: ["blog"]
|
||||
---
|
||||
|
||||
These are all of my amazing blog posts, enjoy!
|
||||
{% for post in collections.blog | reverse %}
|
||||
- [{{ post.data.title }}]({{ post.data.page.fileSlug }})
|
||||
{% endfor %}
|
||||
|
||||
<!-- post.data contents are at https://github.com/11ty/eleventy/discussions/2284 -->
|
4
src/climbing/climbing.json
Normal file
4
src/climbing/climbing.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"layout": "layout/blog",
|
||||
"tags": "climbing"
|
||||
}
|
4
src/games/games.json
Normal file
4
src/games/games.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"layout": "layout/blog",
|
||||
"tags": "games"
|
||||
}
|
4
src/keyboards/keyboards.json
Normal file
4
src/keyboards/keyboards.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"layout": "layout/blog",
|
||||
"tags": "keyboards"
|
||||
}
|
4
src/misc/misc.json
Normal file
4
src/misc/misc.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"layout": "layout/blog",
|
||||
"tags": "misc"
|
||||
}
|
4
src/movies/movies.json
Normal file
4
src/movies/movies.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"layout": "layout/blog",
|
||||
"tags": "movies"
|
||||
}
|
14
src/pages.md
14
src/pages.md
@ -3,15 +3,9 @@ layout: layout/base.njk
|
||||
title: pages
|
||||
---
|
||||
|
||||
{% if collections.blog.length > 0 %}
|
||||
blog posts
|
||||
{% endif %}
|
||||
{% for post in collections.blog | reverse %}
|
||||
\- [{{ post.data.title }}](/blog/{{ post.data.page.fileSlug }})
|
||||
{% for tag in collections.tagsList %}
|
||||
{{tag}}
|
||||
{% for post in collections[tag] %}
|
||||
\- [{{ post.data.title }}](/{{ tag }}/{{ post.data.page.fileSlug }})
|
||||
{% endfor %}
|
||||
{% if collections.music.length > 0 %}
|
||||
music
|
||||
{% endif %}
|
||||
{% for post in collections.music | reverse %}
|
||||
\- [{{ post.data.title }}]({{ post.data.page.fileSlug }})
|
||||
{% endfor %}
|
Reference in New Issue
Block a user