Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Add automatic blog index pages

Add block index pages and archives pages
  • Loading branch information
bcomnes committed Nov 6, 2023
1 parent b88e9f5 commit a0090d2
Show file tree
Hide file tree
Showing 47 changed files with 606 additions and 82 deletions.
8 changes: 4 additions & 4 deletions favicon-config.cjs → favicon-config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
export default {
email: 'bret@hifiwi.fi',
dest: './src',
dest: './src/favicons/',
faviconConfig: {
path: '/', // Path for overriding default icons path. `string`
path: '/favicons/', // Path for overriding default icons path. `string`
appName: 'HifiWi.fi', // Your application's name. `string`
appDescription: 'HifiWi.fi internet products', // Your application's description. `string`
developerName: 'HifiWi.fi LLC', // Your (or your developer's) name. `string`
Expand Down Expand Up @@ -30,7 +30,7 @@ module.exports = {
coast: false, // Create Opera Coast icon. `boolean` or `{ offset, background }`
favicons: true, // Create regular favicons. `boolean`
firefox: false, // Create Firefox OS icons. `boolean` or `{ offset, background }`
windows: true, // Create Windows 8 tile icons. `boolean` or `{ background }`
windows: false, // Create Windows 8 tile icons. `boolean` or `{ background }`
yandex: false // Create Yandex browser icon. `boolean` or `{ background }`
}
}
Expand Down
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@
"url": "https://github.com/hifiwi-fi/hifiwi.fi/issues"
},
"devDependencies": {
"@siteup/cli": "^2.2.4",
"@siteup/cli": "^5.0.0",
"@voxpelli/tsconfig": "^9.0.0",
"auto-changelog": "^2.0.0",
"browser-sync": "^2.26.7",
"classnames": "^2.3.2",
"gh-release": "^7.0.0",
"jsonfeed-to-atom": "^1.2.4",
"npm-run-all2": "^6.0.2",
"p-map": "^6.0.0",
"snazzy": "^9.0.0",
"standard": "^17.0.0",
"uland-isomorphic": "^2.0.0",
"auto-changelog": "^2.0.0",
"gh-release": "^7.0.0",
"generate-feed": "^1.1.13"
"typescript": "~5.2.2",
"uland-isomorphic": "^2.0.0"
},
"dependencies": {
"fragmentions": "^1.1.3",
Expand All @@ -37,12 +41,10 @@
"test:build": "run-s build",
"build": "npm run clean && run-p build:*",
"build:siteup": "siteup",
"build:feed": "generate-feed src/feed --dest public",
"watch": "npm run clean && run-p watch:*",
"watch:serve": "browser-sync start --server 'public' --files 'public'",
"watch:siteup": "npm run build:siteup -- --watch",
"watch:feed": "npm run build:feed",
"generate-icon": "npx gravatar-favicons --config favicon-config.cjs",
"generate-icon": "npx gravatar-favicons --config favicon-config.js",
"clean": "rm -rf public && mkdir -p public",
"start": "npm run watch",
"release": "git push --follow-tags && gh-release -y",
Expand Down
17 changes: 2 additions & 15 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,9 @@ High-fidelity internet products. Welcome.
- 🥖 [breadcrum.net](https://breadcrum.net) — internet newspaper clippings
- 📡 [gumcast](https://gumcast.com) — gumroad subscription courier

## Installations
## [Blog](./blog/)

- 🏘️ [Farmhouse](./installations/2023/09-01-farmhouse/) - 2023-09-01
- 🏡 [Residential](./installations/2023/04-18-residential/) - 2023-04-18

Planning your next residential or commercial network?
Please send us your project proposals, ideas and inquiries.
HifiWifi networking services are currently operating in Arcata, CA and serving wider Humboldt County.

🚧 [Installation Directory](./installations/)

## Press Release

- 👋 [Introducing HifiWi.fi](./blog/2023/introducing-hifiwifi/) - 2023-09-04

📚 [Blog Index](./blog/)
{{{ vars.blogPostsHtml }}}

## Mail room

Expand Down
3 changes: 0 additions & 3 deletions src/blog/2023/README.md

This file was deleted.

14 changes: 5 additions & 9 deletions src/blog/2023/introducing-hifiwifi/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Introducing 🛰️ HifiWi.fi
---
layout: article
title: "Introducing 🛰️ HifiWi.fi"
publishDate: "2023-09-04T16:48:08.000Z"
---

Welcome to HifiWi.fi: *high fidelity internet products*.

Expand Down Expand Up @@ -30,11 +34,3 @@ For project inquiries or questions, please direct all questions to the HifiWifi

- 📧 [hi@hifiwi.fi](mailto:hi@hifiwi.fi)

<p>
Published: <a href="/blog/2023/introducing-hifiwifi/">
<time datetime="2023-09-04T16:48:08.000Z">
Mon Sep 4 09:48:08 2023
</time>
</a>
</p>

19 changes: 19 additions & 0 deletions src/blog/2023/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @template T
* @typedef {import('@siteup/cli').PageFunction<T>} PageFunction
*/

export const vars = {
title: '2023 Blog Posts',
layout: 'blog-auto-index'
}

/**
* @type {PageFunction<{
* title: string
* publishDate: string
* }>}
*/
export default async function blogIndex2023 () {
return ''
}
7 changes: 0 additions & 7 deletions src/blog/README.md

This file was deleted.

71 changes: 71 additions & 0 deletions src/blog/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { html } from 'uland-isomorphic'
import { dirname, basename } from 'node:path'

/**
* @template T
* @typedef {import('@siteup/cli').PageFunction<T>} PageFunction
*/

export const vars = {
title: 'Recent Blog Posts',
layout: 'blog-index'
}

/**
* @type {PageFunction<{
* siteName: string,
* siteDescription: string,
* siteUrl: string,
* authorName: string,
* authorUrl: string,
* authorImgUrl: string
* layout: string,
* publishDate: string
* title: string
* }>}
*/
export default async function blogIndex2023 ({
pages,
page
}) {
const blogPosts = pages
.filter(page => page.vars.layout === 'article')
// @ts-ignore
.sort((a, b) => new Date(b.vars.publishDate) - new Date(a.vars.publishDate))
.slice(0, 50)

const folderPages = pages.filter(folderPage => {
const dir = dirname(folderPage.pageInfo.path)
const path = page.path
return dir === path
})

return html`
<ul class="blog-index-list">
${blogPosts.map(p => {
const publishDate = p.vars.publishDate ? new Date(p.vars.publishDate) : null
return html`
<li class="blog-entry h-entry">
<a class="blog-entry-link u-url u-uid p-name" href="/${p.pageInfo.path}/">${p.vars.title}</a>
${
publishDate
? html`<time class="blog-entry-date dt-published" datetime="${publishDate.toISOString()}">
${publishDate.toISOString().split('T')[0]}
</time>`
: null
}
</li>`
})}
</ul>
<footer class="blog-index-footer">
<h4>Archive</h4>
<ul class="archive-list">
${folderPages.map(p => {
return html`<li>
<a href="/${p.pageInfo.path}/">${basename(p.pageInfo.path)}</a>
</li>`
})}
<ul>
</footer>
`
}
8 changes: 8 additions & 0 deletions src/blog/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.blog-index-footer {
& .archive-list {
display: inline-flex;
gap: 1em;
list-style-type: none;
padding-left: 0px;
}
}
15 changes: 15 additions & 0 deletions src/components/blog-entries/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.blog-index-list {
padding-left: 0px;

& .blog-entry {
width: 100%;
display: inline-flex;
justify-content: space-between;
}
& .blog-entry-link {}
& .blog-entry-date {
color: var(--accent-foreground);
font-family: var(--font-code);
flex-shrink: 0;
}
}
23 changes: 23 additions & 0 deletions src/components/breadcrumb/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.breadcrumb-nav {
margin-top: 1em;

& .list {
list-style-type: none; /* Removes default bullet points */
padding: 0;
margin: 0;
display: flex;
flex-wrap: nowrap; /* Prevents wrapping items to next line */
}

& .item {}

& .item + .item::before {
content: "/"; /* Adds a slash before each item except the first */
margin: 0 8px; /* Adjusts spacing around the slash */
color: var(--accent-midground); /* Adjusts the color of the slash */
}

& .item.active {
font-weight: bold; /* Highlights the active/current page */
}
}
31 changes: 31 additions & 0 deletions src/components/breadcrumb/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { html } from 'uland-isomorphic'
import cn from 'classnames'

export const breadcrumb = ({
pathSegments
}) => {
return html`
<nav class="breadcrumb-nav" aria-label="breadcrumb">
<ol class="list">
${pathSegments.map((segment, i, segments) =>
html`
<li class="${cn({ item: true, active: segments.length - 1 === i })}">
<a href="${generateRelativePathSegment(segment, i, segments.length)}">${segment}</a>
</li>`
)}
</ol>
</nav>
`
}

const relativePathSegment = '../'
function generateRelativePathSegment (segment, index, segmentLength) {
const segmentCount = segmentLength - index
if (index === segmentLength - 1) return './'
const segments = []
for (let i = 0; i < segmentCount; i++) {
segments.push(relativePathSegment)
}
segments.push(segment)
return segments.join('')
}
3 changes: 3 additions & 0 deletions src/favicons/apple-touch-icon-1024x1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/favicons/apple-touch-icon-114x114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/favicons/apple-touch-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/favicons/apple-touch-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/favicons/apple-touch-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/favicons/apple-touch-icon-167x167.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/favicons/apple-touch-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/favicons/apple-touch-icon-57x57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/favicons/apple-touch-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/favicons/apple-touch-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/favicons/apple-touch-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/favicons/apple-touch-icon-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/favicons/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/favicons/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/favicons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/favicons/favicon-48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/favicons/favicon.ico
Binary file not shown.
18 changes: 18 additions & 0 deletions src/favicons/snippets.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<link rel="icon" type="image/x-icon" href="/favicons/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="48x48" href="/favicons/favicon-48x48.png">
<link rel="apple-touch-icon" sizes="57x57" href="/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="167x167" href="/favicons/apple-touch-icon-167x167.png">
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon-180x180.png">
<link rel="apple-touch-icon" sizes="1024x1024" href="/favicons/apple-touch-icon-1024x1024.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="HifiWi.fi">
Loading

0 comments on commit a0090d2

Please sign in to comment.