Recent Notes
@@ -14,7 +14,7 @@ function RecentNotes({ notesMeta }: { notesMeta: NoteMeta[] }) {
}
{
notesMeta.length > 10 &&
-
+
More...
diff --git a/components/recent-posts.tsx b/components/recent-posts.tsx
index df192cd..c499b41 100644
--- a/components/recent-posts.tsx
+++ b/components/recent-posts.tsx
@@ -1,9 +1,9 @@
import Link from "next/link";
-import date from "../util/date";
-import { PostMeta } from "../util/slug";
+import date from "../lib/date";
+import { IPostMeta } from "../lib/slug";
import style from '../styles/recent-posts.module.css';
-function RecentPosts({ postsMeta }: { postsMeta: PostMeta[] }) {
+function RecentPosts({ postsMeta }: { postsMeta: IPostMeta[] }) {
if (!postsMeta.length)
return <>>;
return (
@@ -13,12 +13,14 @@ function RecentPosts({ postsMeta }: { postsMeta: PostMeta[] }) {
{postsMeta?.slice(0, 10)
.map((post: any) => {
return
-
-
{post.title}
-
- {date.prettyPrint(new Date(post.created_at))}
+ {date.toRelativeDate(new Date(post.created_at))}
+
+
+ {post.title}
+
+
})}
diff --git a/components/title.tsx b/components/title.tsx
index e63e8e1..8f5a9f2 100644
--- a/components/title.tsx
+++ b/components/title.tsx
@@ -1,6 +1,7 @@
-import style from '../styles/title.module.css';
import Link from 'next/link';
+import style from '../styles/title.module.css';
+
type propsObj = {
name: string,
title?: string,
@@ -32,7 +33,6 @@ function Title({ name, title, ancestors }: propsObj) {
{title || name}
-
{name
? <>
PaulW.XYZ / {pathElements}{name}>
diff --git a/util/date.ts b/lib/date.ts
similarity index 61%
rename from util/date.ts
rename to lib/date.ts
index 523478b..d2b59f9 100644
--- a/util/date.ts
+++ b/lib/date.ts
@@ -15,7 +15,27 @@ const months = [
const ordSfx = ['','st','nd','rd','th'];
-function prettyPrint(date: Date | string): string {
+function toHumanReadableDate(date: Date | string, disable?: {year?: boolean, month?: boolean, day?: boolean}) {
+ const oDate = (typeof date === 'string')? new Date(date): date;
+
+ const year = oDate.getFullYear();
+ const month = months[oDate.getMonth()];
+ const day = oDate.getDate();
+
+ let sfx;
+ if (day >= 1 && day <= 3)
+ sfx = ordSfx[day];
+ else
+ sfx = ordSfx[4];
+
+ let out = !disable?.day ? `${day}${sfx}` : '';
+ out = !disable?.month ? `${out} ${month}` : out;
+ out = !disable?.year ? `${out} ${year}` : out;
+
+ return out;
+}
+
+function toRelativeDate(date: Date | string): string {
const oDate = (typeof date === 'string')? new Date(date): date;
const now = new Date();
@@ -23,6 +43,10 @@ function prettyPrint(date: Date | string): string {
let tdiff = Math.floor(diff/1000);
+ if (tdiff < 0) {
+ return toHumanReadableDate(oDate);
+ }
+
if (tdiff < 60) {
return `${tdiff} seconds ago`;
}
@@ -40,27 +64,17 @@ function prettyPrint(date: Date | string): string {
return `Yesterday`;
}
- const year = oDate.getFullYear();
- const month = months[oDate.getMonth()];
- const day = oDate.getDate();
-
- let sfx;
- if (day >= 1 && day <= 3)
- sfx = ordSfx[day];
- else
- sfx = ordSfx[4];
- if (year != now.getFullYear())
- return `${day}${sfx} ${month} ${year}`;
- return `${day}${sfx} ${month}`;
+ if (oDate.getFullYear() != now.getFullYear())
+ return toHumanReadableDate(oDate);
+ return toHumanReadableDate(oDate, {year: true});
}
function isValid(date: any) {
return (new Date(date)).toString() === 'Invalid Date';
}
-
-const d = {
- prettyPrint,
+const DateTool = {
+ toRelativeDate,
isValid
-};
+};;
-export default d;
\ No newline at end of file
+export default DateTool;
\ No newline at end of file
diff --git a/lib/slug.d.ts b/lib/slug.d.ts
new file mode 100644
index 0000000..b474fda
--- /dev/null
+++ b/lib/slug.d.ts
@@ -0,0 +1,35 @@
+interface IPost {
+ slug: string;
+ rawslug: string;
+ content: string;
+ title: string;
+}
+
+interface INote {
+ slug: string;
+ rawslug: string;
+ content: string;
+ title: string;
+}
+
+interface INoteMeta {
+ title: string;
+ slug: string;
+ last_updated?: string;
+}
+
+interface IPostMeta {
+ title: string;
+ slug: string;
+ created_at: string;
+ last_updated?: string;
+}
+
+export function getAllPosts(filter?: Array
): IPost[];
+export function getAllNotes(filter?: Array): INote[];
+
+export function getPost(rawslug: string, filter?: Array): IPost;
+export function getNote(rawslug: string, filter?: Array): INote;
+
+export function getPostsMeta(): IPostMeta[];
+export function getNotesMeta(): INoteMeta[];
\ No newline at end of file
diff --git a/util/slug.js b/lib/slug.js
similarity index 55%
rename from util/slug.js
rename to lib/slug.js
index 0d51873..3b5867c 100644
--- a/util/slug.js
+++ b/lib/slug.js
@@ -2,11 +2,15 @@ const fs = require('fs');
const matter = require('gray-matter');
const { join } = require('path');
-const notesDir = join(process.cwd(), 'notes');
-const postsDir = join(process.cwd(), 'posts');
const cacheDir = join(process.cwd(), '.cache');
-const postsCacheFile = join(cacheDir, 'posts.meta.json');
-const notesCacheFile = join(cacheDir, 'notes.meta.json');
+
+function getDir(name) {
+ return join(process.cwd(), name);
+}
+
+function getCacheFileName(name) {
+ return join(cacheDir, `${name}.cache.json`)
+}
function get(dir, rawslug, filter = []) {
const slug = rawslug.replace(/\.md$/, '');
@@ -39,13 +43,14 @@ function get(dir, rawslug, filter = []) {
}
function getAllPosts(filter = []) {
- const files = fs.readdirSync(postsDir);
+ const files = fs.readdirSync(getDir('posts'));
return files
.filter(c => (!c.match(/^\.]/) && c.match(/\.md$/)))
.map(file => {
- return get(postsDir, file, filter)
+ return get(getDir('posts'), file, filter)
})
+ .filter(c => (c.title && c.slug && c.created_at && (new Date(c.created_at)).toString() !== 'Invalid Date'))
.sort((a, b) => {
const dA = new Date(a['created_at']);
const dB = new Date(b['created_at']);
@@ -54,13 +59,14 @@ function getAllPosts(filter = []) {
}
function getAllNotes(filter = []) {
- const files = fs.readdirSync(notesDir);
+ const files = fs.readdirSync(getDir('notes'));
return files
.filter(c => (!c.match(/^\.]/) && c.match(/\.md$/)))
.map(file => {
- return get(notesDir, file, filter)
+ return get(getDir('notes'), file, filter)
})
+ .filter(c => (c.title && c.slug && c.last_updated && (new Date(c.last_updated)).toString() !== 'Invalid Date'))
.sort((a, b) => {
const dA = new Date(a['last_updated']);
const dB = new Date(b['last_updated']);
@@ -68,69 +74,59 @@ function getAllNotes(filter = []) {
});
}
-function cachePostsMeta() { // public access cache
- const posts = getAllPosts(['title', 'slug', 'created_at', 'last_updated']);
+const cats = {
+ notes: {
+ name: 'notes',
+ getAll: getAllNotes,
+ filter: ['title', 'slug', 'last_updated'],
+ },
+ posts: {
+ name: 'posts',
+ getAll: getAllPosts,
+ filter: ['title', 'slug', 'created_at', 'last_updated'],
+ }
+};
+
+function cacheMeta({name, getAll, filter}) {
+ const items = getAll(filter);
if (!fs.existsSync(cacheDir)) {
fs.mkdirSync(cacheDir);
}
- fs.writeFile(postsCacheFile, JSON.stringify(posts), (e) => {
+ fs.writeFile(getCacheFileName(name), JSON.stringify(items), (e) => {
if (e)
console.error(e);
});
- return posts;
+ return items;
}
-function cacheNotesMeta() {
- const notes = getAllNotes(['title', 'slug', 'last_updated']);
-
- if (!fs.existsSync(cacheDir)) {
- fs.mkdirSync(cacheDir);
- }
-
- fs.writeFile(notesCacheFile, JSON.stringify(notes), (e) => {
- if (e)
- console.error(e);
- });
- return notes;
-}
-
-function getMetaFromFile(name) {
+function getMeta(cat) {
try {
- const file = fs.readFileSync(name, 'utf-8');
+ const file = fs.readFileSync(getCacheFileName(cat.name), 'utf-8');
return JSON.parse(file);
} catch (e) {
- if (name)
- return cachePostsMeta();
+ if (cat.name)
+ return cacheMeta(cat);
}
}
+function getPostsMeta() {
+ return getMeta(cats.posts);
+};
+
+function getNotesMeta() {
+ return getMeta(cats.notes);
+};
+
function cache() {
- cachePostsMeta();
- cacheNotesMeta();
+ Object.entries(cats).map(([_, v]) => {
+ return cacheMeta(v);
+ });
}
-const getPostsMeta = () => {
- try {
- const file = fs.readFileSync(postsCacheFile, 'utf-8');
- return JSON.parse(file);
- } catch (e) {
- return cachePostsMeta();
- }
-};
-
-const getNotesMeta = () => {
- try {
- const file = fs.readFileSync(notesCacheFile, 'utf-8');
- return JSON.parse(file);
- } catch (e) {
- return cacheNotesMeta();
- }
-};
-
-const getPost = (s, f) => {return get(postsDir, s, f)};
-const getNote = (s, f) => {return get(notesDir, s, f)};
+const getPost = (s, f) => {return get(getDir('posts'), s, f)};
+const getNote = (s, f) => {return get(getDir('notes'), s, f)};
module.exports = {
getAllPosts,
diff --git a/next.config.js b/next.config.js
index 5aac596..5775484 100755
--- a/next.config.js
+++ b/next.config.js
@@ -4,7 +4,7 @@ module.exports = {
defaultLocale: 'en-US'
},
webpack: (config, _options) => {
- const { cache } = require('./util/slug');
+ const { cache } = require('./lib/slug');
config.plugins.push(
{
diff --git a/notes/mos-6502.md b/notes/mos-6502.md
index c856a0d..3ef9337 100644
--- a/notes/mos-6502.md
+++ b/notes/mos-6502.md
@@ -1,17 +1,43 @@
---
title: MOS 6502 Microprocessor
-last_updated: '2022-05-16T14:26:03-04:00'
+last_updated: '2022-09-29T02:41:26.738Z'
---
-Name | 6502
---- | ---
-Introduced | 1975
-Data Width | 8-bit
-Address Width | 16-bit
-Endianness | Little
-Registers | 8-bit A, X, Y, Stack. 16-bit PC
-Package | 40-pin DIP
-Instruction Count | 56
+
+
+ Name
+ 6502
+
+
+ Introduced
+ 1975
+
+
+ Data Width
+ 8-bit
+
+
+ Address Width
+ 16-bit
+
+
+ Endianness
+ Little
+
+
+ Registers
+ 8-bit A, X, Y, Stack. 16-bit PC
+
+
+ Package
+ 40-pin DIP
+
+
+ Instruction Count
+ 56
+
+
+
## Addressing Modes
- Implied
@@ -25,7 +51,7 @@ Instruction Count | 56
- Indirect, Y
## Docs
-- [WDC W65C02S NMOS Variant](https://www.westerndesigncenter.com/wdc/documentation/w65c02s.pdf)
+- [westerndesigncenter.com: WDC W65C02S NMOS Variant](https://www.westerndesigncenter.com/wdc/documentation/w65c02s.pdf)
- [6502.org: collection of 6502 resources](http://6502.org/)
## Notable Usage (includes variants)
diff --git a/notes/nintendo-switch.md b/notes/nintendo-switch.md
new file mode 100644
index 0000000..26dfc29
--- /dev/null
+++ b/notes/nintendo-switch.md
@@ -0,0 +1,20 @@
+---
+title: Nintendo Switch
+last_updated: '2022-10-02T23:01:34.000Z'
+---
+
+Official Website
+Developer Portal
+
+## Third-party Software
+- [Atmosphère](https://github.com/Atmosphere-NX/Atmosphere)
+ - custom firmware
+
+## Third-party Resources
+- [DekuDeals](https://www.dekudeals.com/)
+ - price tracker for games with support for all major US retailers
+
+
+## High-level Emulators
+- [yuzu](https://yuzu-emu.org/)
+- [Ryujinx](https://ryujinx.org/)
\ No newline at end of file
diff --git a/notes/steam-deck.md b/notes/steam-deck.md
new file mode 100644
index 0000000..2c51901
--- /dev/null
+++ b/notes/steam-deck.md
@@ -0,0 +1,49 @@
+---
+title: Steam Deck
+last_updated: '2022-09-29T03:55:40.476Z'
+---
+
+Official Website
+
+## Access Console-like Youtube in Gaming Mode
+- Using Chromium's undocumented command-line options, the user agent can be changed to PlayStation's, Xbox's or Tizen's (Samsung's TV OS) and the application can be launched in full screen by using the `-kiosk` flag. The following XDG Desktop Configuration, for example, can be used and added as a non-Steam game while in Desktop mode for access in gaming mode.
+```ini
+#!/usr/bin/env xdg-open
+[Desktop]
+Version=1.0
+Type=Application
+Name=YouTube TV
+GenericName=Online Video Platform
+Comment=An online video-sharing, social media platform
+Exec=/usr/bin/flatpak run --branch=master --arch=x86_64 --file-forwarding org.chromium.Chrome @@ %F @@ --user-agent='Mozilla/5.0 (X11; Linux x86_64; Xbox; Xbox One; Valve Steam Gamepad)' --kiosk 'https://www.youtube.com/tv'
+Terminal=false
+MimeType=text/plain;
+Icon=com.youtube.tv # $XDG_PATH contains the paths used to fetch icons, extensions for supported formats are optional
+
+```
+- Firefox can also be used however the supported command-line options are limited.
+- The URL is https://www.youtube.com/tv
+- Without the user agent change, the above URL is inaccessible.
+- Adblockers like uBlock Origin, AdBlock Plus (both tested) do not remove ads unlike on the desktop site.
+- Choosing the Xbox user agent is recommended as button prompts match the Steam Deck's `ABXY` button layout.
+- The Electron framework can be used to build a wrapper for the URL. This is the preferrable method as it supports exiting from within the application, while browsers only support manual termination from the Steam menu. E.g. (assuming you can build native linux binaries on a device)
+```javascript
+const { app, BrowserWindow } = require('electron');
+app.whenReady()
+ .then(() => {
+ const win = new BrowserWindow({
+ backgroundColor: '#2e2c29',
+ kiosk: true
+ });
+ win.maximize();
+ win.loadURL('https://youtube.com/tv');
+ const wc = win.webContents;
+ wc.userAgent = 'Mozilla/5.0 (X11; Linux x86_64; Xbox; Xbox One; Valve Steam Gamepad)'
+ })
+ .catch((e) => {
+ console.error(e)
+ });
+```
+
+## Miscellaneous
+- When using a dock or a hub to connect to an external display, ensure the display supports the refresh rate set on the device as some TVs and other displays only support refresh rates that are multiples of 30Hz.
\ No newline at end of file
diff --git a/notes/steam.md b/notes/steam.md
index 346c2ba..6d4105f 100644
--- a/notes/steam.md
+++ b/notes/steam.md
@@ -1,17 +1,20 @@
---
-title: Steam Store Client
-last_updated: '2022-05-16T14:20:20-04:00'
+title: Steam Store
+last_updated: '2022-09-29T03:15:58.777Z'
---
+Steam Store
+SteamCMD
+
## Accessing the Console
-- Use the following URLs to enable the console in the GUI client:
- - [steam://nav/console](steam://nav/console)
- - [steam://open/console](steam://open/console)
+- Use the following URIs on a browser or a file manager to open GUI client with the console:
+ - `steam://nav/console`
+ - `steam://open/console`
- will not work if the Steam client is running in the background
- The `-console` flag can be used with the client executable.
-- Alternatively, [SteamCMD](https://developer.valvesoftware.com/wiki/SteamCMD), a command-line version of the Steam client, can be used.
+- Alternatively, [SteamCMD.zip](https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip), a command-line only version of the Steam client, can be used.
-## Console Commands
+## Downloading Older Depots
Download a single depot (used to download older versions of applications/games):
```
@@ -24,12 +27,20 @@ download_depot [] [] [
+
+ Name
+ Z80
+
+
+ Introduced
+ 1976
+
+
+ Data Width
+ 8-bit
+
+
+ Address Width
+ 16-bit
+
+
+ Binary Comp.
+ 8080A
+
+
+ Endianness
+ Little
+
+
+ Registers
+ 208 bits (18 × 8-bit + 4 × 16-bit) - Static RAM
+
+
+ Package
+ 40-pin DIP
+
+
+ Instruction Count
+ 158
+
+
## Docs
-- [User Manual](http://z80.info/zip/z80cpu_um.pdf)
+- [z80.info: User Manual](http://z80.info/zip/z80cpu_um.pdf)
## Addressing Modes
- Immediate
diff --git a/package-lock.json b/package-lock.json
index 965c68c..4d2632c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14,6 +14,7 @@
"react-dom": "^18.2.0",
"react-markdown": "^8.0.3",
"react-syntax-highlighter": "^15.5.0",
+ "rehype-raw": "^6.1.1",
"remark-gfm": "^3.0.1",
"uri-js": "^4.4.1"
},
@@ -2523,6 +2524,11 @@
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==",
"dev": true
},
+ "node_modules/@types/parse5": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-6.0.3.tgz",
+ "integrity": "sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g=="
+ },
"node_modules/@types/prop-types": {
"version": "15.7.5",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz",
@@ -4489,6 +4495,71 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/hast-to-hyperscript": {
+ "version": "10.0.1",
+ "resolved": "https://registry.npmjs.org/hast-to-hyperscript/-/hast-to-hyperscript-10.0.1.tgz",
+ "integrity": "sha512-dhIVGoKCQVewFi+vz3Vt567E4ejMppS1haBRL6TEmeLeJVB1i/FJIIg/e6s1Bwn0g5qtYojHEKvyGA+OZuyifw==",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "comma-separated-tokens": "^2.0.0",
+ "property-information": "^6.0.0",
+ "space-separated-tokens": "^2.0.0",
+ "style-to-object": "^0.3.0",
+ "unist-util-is": "^5.0.0",
+ "web-namespaces": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-from-parse5": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-7.1.0.tgz",
+ "integrity": "sha512-m8yhANIAccpU4K6+121KpPP55sSl9/samzQSQGpb0mTExcNh2WlvjtMwSWFhg6uqD4Rr6Nfa8N6TMypQM51rzQ==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/parse5": "^6.0.0",
+ "@types/unist": "^2.0.0",
+ "hastscript": "^7.0.0",
+ "property-information": "^6.0.0",
+ "vfile": "^5.0.0",
+ "vfile-location": "^4.0.0",
+ "web-namespaces": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-from-parse5/node_modules/hast-util-parse-selector": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.0.tgz",
+ "integrity": "sha512-AyjlI2pTAZEOeu7GeBPZhROx0RHBnydkQIXlhnFzDi0qfXTmGUWoCYZtomHbrdrheV4VFUlPcfJ6LMF5T6sQzg==",
+ "dependencies": {
+ "@types/hast": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-from-parse5/node_modules/hastscript": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-7.0.2.tgz",
+ "integrity": "sha512-uA8ooUY4ipaBvKcMuPehTAB/YfFLSSzCwFSwT6ltJbocFUKH/GDHLN+tflq7lSRf9H86uOuxOFkh1KgIy3Gg2g==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "comma-separated-tokens": "^2.0.0",
+ "hast-util-parse-selector": "^3.0.0",
+ "property-information": "^6.0.0",
+ "space-separated-tokens": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/hast-util-parse-selector": {
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz",
@@ -4498,6 +4569,45 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/hast-util-raw": {
+ "version": "7.2.2",
+ "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-7.2.2.tgz",
+ "integrity": "sha512-0x3BhhdlBcqRIKyc095lBSDvmQNMY3Eulj2PLsT5XCyKYrxssI5yr3P4Kv/PBo1s/DMkZy2voGkMXECnFCZRLQ==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/parse5": "^6.0.0",
+ "hast-util-from-parse5": "^7.0.0",
+ "hast-util-to-parse5": "^7.0.0",
+ "html-void-elements": "^2.0.0",
+ "parse5": "^6.0.0",
+ "unist-util-position": "^4.0.0",
+ "unist-util-visit": "^4.0.0",
+ "vfile": "^5.0.0",
+ "web-namespaces": "^2.0.0",
+ "zwitch": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-to-parse5": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-7.0.0.tgz",
+ "integrity": "sha512-YHiS6aTaZ3N0Q3nxaY/Tj98D6kM8QX5Q8xqgg8G45zR7PvWnPGPP0vcKCgb/moIydEJ/QWczVrX0JODCVeoV7A==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/parse5": "^6.0.0",
+ "hast-to-hyperscript": "^10.0.0",
+ "property-information": "^6.0.0",
+ "web-namespaces": "^2.0.0",
+ "zwitch": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/hast-util-whitespace": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.0.tgz",
@@ -4561,6 +4671,15 @@
"node": "*"
}
},
+ "node_modules/html-void-elements": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-2.0.1.tgz",
+ "integrity": "sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/ignore": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz",
@@ -6252,6 +6371,11 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/parse5": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz",
+ "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw=="
+ },
"node_modules/path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
@@ -6603,6 +6727,20 @@
"jsesc": "bin/jsesc"
}
},
+ "node_modules/rehype-raw": {
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-6.1.1.tgz",
+ "integrity": "sha512-d6AKtisSRtDRX4aSPsJGTfnzrX2ZkHQLE5kiUuGOeEoLpbEulFF4hj0mLPbsa+7vmguDKOVVEQdHKDSwoaIDsQ==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "hast-util-raw": "^7.2.0",
+ "unified": "^10.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/remark-gfm": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-3.0.1.tgz",
@@ -7389,6 +7527,19 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/vfile-location": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz",
+ "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "vfile": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/vfile-message": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.2.tgz",
@@ -7402,6 +7553,15 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/web-namespaces": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz",
+ "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
@@ -9152,6 +9312,11 @@
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==",
"dev": true
},
+ "@types/parse5": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-6.0.3.tgz",
+ "integrity": "sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g=="
+ },
"@types/prop-types": {
"version": "15.7.5",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz",
@@ -10586,11 +10751,93 @@
"has-symbols": "^1.0.2"
}
},
+ "hast-to-hyperscript": {
+ "version": "10.0.1",
+ "resolved": "https://registry.npmjs.org/hast-to-hyperscript/-/hast-to-hyperscript-10.0.1.tgz",
+ "integrity": "sha512-dhIVGoKCQVewFi+vz3Vt567E4ejMppS1haBRL6TEmeLeJVB1i/FJIIg/e6s1Bwn0g5qtYojHEKvyGA+OZuyifw==",
+ "requires": {
+ "@types/unist": "^2.0.0",
+ "comma-separated-tokens": "^2.0.0",
+ "property-information": "^6.0.0",
+ "space-separated-tokens": "^2.0.0",
+ "style-to-object": "^0.3.0",
+ "unist-util-is": "^5.0.0",
+ "web-namespaces": "^2.0.0"
+ }
+ },
+ "hast-util-from-parse5": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-7.1.0.tgz",
+ "integrity": "sha512-m8yhANIAccpU4K6+121KpPP55sSl9/samzQSQGpb0mTExcNh2WlvjtMwSWFhg6uqD4Rr6Nfa8N6TMypQM51rzQ==",
+ "requires": {
+ "@types/hast": "^2.0.0",
+ "@types/parse5": "^6.0.0",
+ "@types/unist": "^2.0.0",
+ "hastscript": "^7.0.0",
+ "property-information": "^6.0.0",
+ "vfile": "^5.0.0",
+ "vfile-location": "^4.0.0",
+ "web-namespaces": "^2.0.0"
+ },
+ "dependencies": {
+ "hast-util-parse-selector": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.0.tgz",
+ "integrity": "sha512-AyjlI2pTAZEOeu7GeBPZhROx0RHBnydkQIXlhnFzDi0qfXTmGUWoCYZtomHbrdrheV4VFUlPcfJ6LMF5T6sQzg==",
+ "requires": {
+ "@types/hast": "^2.0.0"
+ }
+ },
+ "hastscript": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-7.0.2.tgz",
+ "integrity": "sha512-uA8ooUY4ipaBvKcMuPehTAB/YfFLSSzCwFSwT6ltJbocFUKH/GDHLN+tflq7lSRf9H86uOuxOFkh1KgIy3Gg2g==",
+ "requires": {
+ "@types/hast": "^2.0.0",
+ "comma-separated-tokens": "^2.0.0",
+ "hast-util-parse-selector": "^3.0.0",
+ "property-information": "^6.0.0",
+ "space-separated-tokens": "^2.0.0"
+ }
+ }
+ }
+ },
"hast-util-parse-selector": {
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz",
"integrity": "sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ=="
},
+ "hast-util-raw": {
+ "version": "7.2.2",
+ "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-7.2.2.tgz",
+ "integrity": "sha512-0x3BhhdlBcqRIKyc095lBSDvmQNMY3Eulj2PLsT5XCyKYrxssI5yr3P4Kv/PBo1s/DMkZy2voGkMXECnFCZRLQ==",
+ "requires": {
+ "@types/hast": "^2.0.0",
+ "@types/parse5": "^6.0.0",
+ "hast-util-from-parse5": "^7.0.0",
+ "hast-util-to-parse5": "^7.0.0",
+ "html-void-elements": "^2.0.0",
+ "parse5": "^6.0.0",
+ "unist-util-position": "^4.0.0",
+ "unist-util-visit": "^4.0.0",
+ "vfile": "^5.0.0",
+ "web-namespaces": "^2.0.0",
+ "zwitch": "^2.0.0"
+ }
+ },
+ "hast-util-to-parse5": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-7.0.0.tgz",
+ "integrity": "sha512-YHiS6aTaZ3N0Q3nxaY/Tj98D6kM8QX5Q8xqgg8G45zR7PvWnPGPP0vcKCgb/moIydEJ/QWczVrX0JODCVeoV7A==",
+ "requires": {
+ "@types/hast": "^2.0.0",
+ "@types/parse5": "^6.0.0",
+ "hast-to-hyperscript": "^10.0.0",
+ "property-information": "^6.0.0",
+ "web-namespaces": "^2.0.0",
+ "zwitch": "^2.0.0"
+ }
+ },
"hast-util-whitespace": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.0.tgz",
@@ -10633,6 +10880,11 @@
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz",
"integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A=="
},
+ "html-void-elements": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-2.0.1.tgz",
+ "integrity": "sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A=="
+ },
"ignore": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz",
@@ -11745,6 +11997,11 @@
"lines-and-columns": "^1.1.6"
}
},
+ "parse5": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz",
+ "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw=="
+ },
"path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
@@ -11998,6 +12255,16 @@
}
}
},
+ "rehype-raw": {
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-6.1.1.tgz",
+ "integrity": "sha512-d6AKtisSRtDRX4aSPsJGTfnzrX2ZkHQLE5kiUuGOeEoLpbEulFF4hj0mLPbsa+7vmguDKOVVEQdHKDSwoaIDsQ==",
+ "requires": {
+ "@types/hast": "^2.0.0",
+ "hast-util-raw": "^7.2.0",
+ "unified": "^10.0.0"
+ }
+ },
"remark-gfm": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-3.0.1.tgz",
@@ -12540,6 +12807,15 @@
"vfile-message": "^3.0.0"
}
},
+ "vfile-location": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz",
+ "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==",
+ "requires": {
+ "@types/unist": "^2.0.0",
+ "vfile": "^5.0.0"
+ }
+ },
"vfile-message": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.2.tgz",
@@ -12549,6 +12825,11 @@
"unist-util-stringify-position": "^3.0.0"
}
},
+ "web-namespaces": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz",
+ "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ=="
+ },
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
diff --git a/package.json b/package.json
index 375627f..43a3543 100644
--- a/package.json
+++ b/package.json
@@ -15,6 +15,7 @@
"react-dom": "^18.2.0",
"react-markdown": "^8.0.3",
"react-syntax-highlighter": "^15.5.0",
+ "rehype-raw": "^6.1.1",
"remark-gfm": "^3.0.1",
"uri-js": "^4.4.1"
},
diff --git a/pages/about.tsx b/pages/about.tsx
index e590f04..a6f8143 100644
--- a/pages/about.tsx
+++ b/pages/about.tsx
@@ -17,7 +17,7 @@ function AboutPage({usr}: any) {
Got any questions, concerns, or issues? Contact me via email: lambdapaul [at] pm [dot] me
.
@@ -39,12 +39,15 @@ function AboutPage({usr}: any) {
}
export async function getStaticProps() {
- const res = await fetch('https://api.github.com/users/lambdapaul');
- const usr = await res.json();
-
- return {
- props: { usr }
- };
+ try {
+ const res = await fetch('https://api.github.com/users/lambdapaul');
+ const usr = await res.json();
+ return {
+ props: { usr }
+ };
+ } catch (e) {
+ return {props: {}}
+ }
}
export default AboutPage;
diff --git a/pages/index.tsx b/pages/index.tsx
index 1e56726..0d3460d 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -1,16 +1,33 @@
import React from 'react';
+import Link from 'next/link';
import Layout from '../components/layout';
import QuickLinks from '../components/quick-links';
import RecentNotes from '../components/recent-notes';
import RecentPosts from '../components/recent-posts';
-import { getNotesMeta, getPostsMeta, NoteMeta, PostMeta } from '../util/slug';
+import { getNotesMeta, getPostsMeta, INoteMeta, IPostMeta } from '../lib/slug';
-function HomePage({ postsMeta, notesMeta }: { postsMeta: PostMeta[], notesMeta: NoteMeta[] }) {
+function Nav() {
+ const nav = {'Posts': '/posts', 'Notes': '/notes', 'About': '/about', };
+ return (
+
+ {
+ Object.entries(nav).map(([k, v]) => {
+ return
+
{k}
+
+ })
+ }
+
+ )
+}
+
+function HomePage({ postsMeta, notesMeta }: { postsMeta: IPostMeta[], notesMeta: INoteMeta[] }) {
return (
+
-
+
)
}
diff --git a/pages/notes/[page].tsx b/pages/notes/[note].tsx
similarity index 85%
rename from pages/notes/[page].tsx
rename to pages/notes/[note].tsx
index e878759..0506021 100644
--- a/pages/notes/[page].tsx
+++ b/pages/notes/[note].tsx
@@ -1,9 +1,10 @@
import Layout from '../../components/layout';
-import { getAllNotes, getNote } from '../../util/slug';
+import { getAllNotes, getNote } from '../../lib/slug';
import ReactMarkdown from 'react-markdown';
import SyntaxHighlighter from 'react-syntax-highlighter';
-import { monokaiSublime } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
+import { monokaiSublime as hlTheme } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
import remarkGfm from 'remark-gfm';
+import rehypeRaw from 'rehype-raw';
function Note({ note }: any) {
return (<>
@@ -11,6 +12,7 @@ function Note({ note }: any) {
{
return {
params: {
- page: note.slug
+ note: note.slug
}
}
}),
diff --git a/pages/notes/index.tsx b/pages/notes/index.tsx
index 596b497..cbbe654 100644
--- a/pages/notes/index.tsx
+++ b/pages/notes/index.tsx
@@ -1,19 +1,28 @@
import Link from 'next/link';
import Layout from '../../components/layout';
-import { getNotesMeta, NoteMeta } from '../../util/slug';
+import date from '../../lib/date';
+import { getNotesMeta, INoteMeta } from '../../lib/slug';
-function NotesPage({ notesMeta }: { notesMeta: NoteMeta[] }) {
+function NotesPage({ notesMeta }: { notesMeta: INoteMeta[] }) {
return (
-
- {notesMeta && notesMeta.map((note: NoteMeta, i) => {
- return
-
- {note.title}
-
-
- })}
-
+
+
+ {notesMeta && notesMeta.map((note: INoteMeta, i) => {
+ return (
+
+
+
+ {note.title}
+
+
+
+ {note.last_updated && date.toRelativeDate(new Date(note.last_updated))}
+
+
+ )})}
+
+
)
}
diff --git a/pages/posts/[page].tsx b/pages/posts/[post].tsx
similarity index 50%
rename from pages/posts/[page].tsx
rename to pages/posts/[post].tsx
index dab931b..27bbbd1 100644
--- a/pages/posts/[page].tsx
+++ b/pages/posts/[post].tsx
@@ -1,18 +1,23 @@
import Layout from '../../components/layout';
-import { getAllPosts, getPost } from '../../util/slug';
+import { getAllPosts, getPost } from '../../lib/slug';
import ReactMarkdown from 'react-markdown';
import style from '../../styles/post.module.css';
function Post({ post }: any) { // eh
return (<>
-
- {post.cover
- &&
}
+
+ {
}
- {post.content}
+
+ {post.content}
+
-
>
@@ -20,7 +25,7 @@ function Post({ post }: any) { // eh
}
export async function getStaticProps({ params }: any) {
- const post = getPost(params.page);
+ const post = getPost(params.post);
return {
props: { post }
@@ -33,7 +38,7 @@ export async function getStaticPaths() {
paths: posts.map((post: any) => {
return {
params: {
- page: post.slug
+ post: post.slug
}
}
}),
diff --git a/pages/posts/index.tsx b/pages/posts/index.tsx
index bd1ef3c..4c97b24 100644
--- a/pages/posts/index.tsx
+++ b/pages/posts/index.tsx
@@ -1,39 +1,39 @@
import Link from 'next/link';
import Layout from '../../components/layout';
-import date from '../../util/date';
-import { getPostsMeta, PostMeta } from '../../util/slug';
+import date from '../../lib/date';
+import { getPostsMeta, IPostMeta } from '../../lib/slug';
-function PostsPage({ postsMeta }: { postsMeta: PostMeta[] }) {
+function PostsPage({ postsMeta }: { postsMeta: IPostMeta[] }) {
return (
-
-
-
- Name
- Created on
- Last Updated
-
-
+
- {postsMeta.map((post: PostMeta, i) => {
- return
-
-
- {post.title}
+ {
+ postsMeta.length &&
+ postsMeta.map((post: IPostMeta, i) => {
+ return
+
+ {
+ post.last_updated && `updated ${date.toRelativeDate(new Date(post.last_updated))}`
+ }
+ { date.toRelativeDate(new Date(post.created_at)) }
+
+
+
+ {post.title}
-
- {date.prettyPrint(new Date(post.created_at))}
-
-
- {
- post.last_updated
- ? date.prettyPrint(new Date(post.last_updated))
- : '-'
- }
-
- })}
+ }) ||
+
+
**crickets**
+
No posts found...
+
+
+ }
diff --git a/public/pages.json b/public/pages.json
index 59ebcf7..c5f6d14 100644
--- a/public/pages.json
+++ b/public/pages.json
@@ -1,6 +1,4 @@
{
- "About": "/about",
"GitHub": "https://github.com/lambdapaul",
- "Twitter": "https://twitter.com/lambda_paul",
- "Notes": "/notes"
+ "Twitter": "https://twitter.com/lambda_paul"
}
diff --git a/styles/global.css b/styles/global.css
index 6ef13ef..f9c408d 100644
--- a/styles/global.css
+++ b/styles/global.css
@@ -8,6 +8,8 @@
--primary-blue: #0a82b1;
--secondary-blue: #05455f;
--tertiary-blue: #05232f;
+ --table-odd-color: rgba(255, 255, 255, 0.05);
+ --table-even-color: rgba(255, 255, 255, 0.025);
}
@font-face {
@@ -98,10 +100,6 @@
box-sizing: border-box;
}
-body {
- font-family: 'Cantarell', 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', 'Helvetica Neue', 'Helvetica', Arial, sans-serif;
-}
-
article,
aside,
figcaption,
@@ -116,7 +114,8 @@ section {
}
body {
- margin: 0 0 4rem;
+ font-family: 'Cantarell', 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', 'Helvetica Neue', 'Helvetica', Arial, sans-serif;
+ margin: 0 0 44px;
font-size: 18px;
font-weight: 400;
line-height: 1.5;
@@ -125,7 +124,6 @@ body {
height: 100%;
background-color: var(--main-background-color);
background-size: cover;
- padding-bottom: 2.5rem;
}
[tabindex="-1"]:focus {
@@ -208,6 +206,15 @@ pre {
overflow-x: auto;
}
+code {
+ overflow-x: auto;
+ max-width: 100%;
+ display: inline-block;
+ background-color: rgba(255, 255, 255, 0.1);
+ padding: 0.1rem 0.5rem;
+ vertical-align: bottom;
+}
+
pre,
kbd,
code {
@@ -220,6 +227,11 @@ table {
flex-direction: column;
margin: 1rem 0;
overflow: hidden;
+ border-radius: 0.5rem;
+}
+
+table thead+tbody tr {
+ border-radius: 0;
}
table thead {
@@ -227,13 +239,24 @@ table thead {
z-index: -1;
}
+table tbody,
+table tr:last-of-type
+{
+ border-bottom-left-radius: 0.5rem;
+ border-bottom-right-radius: 0.5rem;
+}
+
table thead tr,
table tbody tr {
display: flex;
}
-table tbody tr+tr {
- border-top: 1px solid #999999;
+table tbody tr:nth-of-type(2n) {
+ background-color: var(--table-even-color);
+}
+
+table tbody tr:nth-of-type(2n+1) {
+ background-color: var(--table-odd-color);
}
table thead tr th,
@@ -243,6 +266,10 @@ table tbody tr td {
padding: .25rem 0.75rem;
}
+li {
+ list-style-type: square;
+}
+
.lambda-logo {
width: 256px;
height: 256px;
@@ -253,28 +280,26 @@ table tbody tr td {
}
.container {
- max-width: 1018px;
- margin: 0 auto;
+ margin: 0 0.5rem;
position: relative;
}
+@media screen and (min-width: 1018px) {
+ .container {
+ max-width: 1018px;
+ margin: 0 auto;
+ position: relative;
+ }
+}
+
.block {
display: block;
- padding: 1.5rem;
+ padding: 0.5rem;
max-width: 100%;
margin: 1rem 0.25rem;
border-radius: 1rem;
}
-code {
- overflow-x: auto;
- max-width: 100%;
- display: inline-block;
- background-color: rgba(255, 255, 255, 0.1);
- padding: 0.1rem 0.5rem;
- vertical-align: bottom;
-}
-
.button {
padding: 0.2rem 1rem;
margin: 0.3rem 0.3rem;
@@ -323,7 +348,7 @@ code {
text-align: center;
}
-.no-display {
+.none.display {
display: none;
}
@@ -363,6 +388,14 @@ code {
display: none;
}
+.sans.serif {
+ font-family: 'Cantarell', 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', 'Helvetica Neue', 'Helvetica', Arial, sans-serif;
+}
+
+.serif {
+ font-family: 'EB Garamond', 'Garamond', 'Times New Roman', Times, serif;
+}
+
.monospace {
font-family: 'Hack', 'Source Code Pro', Consolas, monospace;
}
diff --git a/styles/post.module.css b/styles/post.module.css
index b24c5d0..1a10e57 100644
--- a/styles/post.module.css
+++ b/styles/post.module.css
@@ -5,21 +5,25 @@
left: 0;
top: 0;
bottom: 0;
+ margin: 0;
+ padding: 0;
background-size: cover;
- background-position: top left;
+ background-repeat: no-repeat;
+ background-position: top center;
min-height: 100%;
background-attachment: fixed;
}
.block {
font-family: 'EB Garamond', 'Garamond', 'Times New Roman', Times, serif;
- background-color: rgba(13, 17, 23, 0.95);
+ background-color: rgba(13, 17, 23, 0.99);
margin: 0 auto;
border-radius: 0;
font-size: 1.25rem;
line-height: 2rem;
+ padding: 2rem 1rem;
}
.spacer {
- height: 5rem;
+ height: 25rem;
}
\ No newline at end of file
diff --git a/styles/recent-posts.module.css b/styles/recent-posts.module.css
index e0cd539..d58212f 100644
--- a/styles/recent-posts.module.css
+++ b/styles/recent-posts.module.css
@@ -1,28 +1,63 @@
.container {
- border-bottom-left-radius: 1rem;
+ border-bottom-left-radius: 0.5rem;
border-bottom: 1px dashed var(--main-border-color);
border-left: 1px dashed var(--main-border-color);
- padding-top: 1.5rem;
+ padding-top: 1.25rem;
margin-left: 0.5rem;
}
.block {
- padding: 0.25rem 0.5rem;
- margin: 0 0.5rem 0.25rem 0;
- border-top: 1px dashed var(--main-border-color);
+ margin: 0;
position: relative;
display: flex;
align-items: center;
}
+.block+.block {
+ border-top: 1px dashed var(--main-border-color);
+}
+
+.block:first-of-type {
+ border-top-right-radius: 0.5rem;
+}
+
+.block:nth-of-type(2n) {
+ background-color: var(--table-even-color);
+}
+
+.block:nth-of-type(2n+1) {
+ background-color: var(--table-odd-color);
+}
+
.postTitle {
- flex-grow: 8;
- padding: 0.1rem 0.2rem;
+ font-family: 'EB Garamond', 'Garamond', 'Times New Roman', Times, serif;
+ flex: 1 1 60%;
+ padding: .25rem 0.75rem;
+}
+
+.postTitle a {
+ text-decoration: none;
+ border: 1px dotted transparent;
+ transition: border-width 100ms ease-in-out;
+}
+
+.postTitle a:hover {
+ text-decoration: none;
+ border-bottom: 1px dotted var(--link-color);
+}
+
+.postTitle a:focus {
+ text-decoration: none;
+ border: 1px dotted var(--link-color);
}
.postDate {
+ flex: 1 1;
+ display: inline-block;
+ text-align: right;
font-style: italic;
- font-size: 0.95rem;
+ font-size: 0.9rem;
+ padding: .25rem 0.50rem;
}
.more {
diff --git a/styles/title.module.css b/styles/title.module.css
index 9bc1801..ab4511c 100644
--- a/styles/title.module.css
+++ b/styles/title.module.css
@@ -11,15 +11,20 @@
}
.nav {
- white-space: pre-wrap;
padding: 0.25rem 0.75rem;
font-size: 1.5rem;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4);
position: fixed;
bottom: 0;
z-index: 1000;
- left: 0;
- right: 0;
margin: 0;
+ height: 2.75rem;
+ max-height: 2.75rem;
+ min-height: 2.75rem;
+ min-width: 100%;
+ width: 100%;
background: linear-gradient(to bottom right, #1a3a15, #09351b) no-repeat center center fixed;
+ overflow-y: hidden;
+ overflow-x: auto;
+ white-space: nowrap;
}
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
index bb818e3..0a5a2ff 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -24,7 +24,7 @@
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
- "util/slug.js"
+ "lib/slug.js"
],
"exclude": [
"node_modules"
diff --git a/util/slug.d.ts b/util/slug.d.ts
deleted file mode 100644
index b8425c5..0000000
--- a/util/slug.d.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-interface Post {
- slug?: string;
- rawslug?: string;
- content?: string;
- title?: string;
-}
-
-interface Note {
- slug?: string;
- rawslug?: string;
- content?: string;
- title?: string;
-}
-
-interface NoteMeta {
- title: string;
- slug: string;
- last_updated: string;
-}
-
-interface PostMeta {
- title: string;
- slug: string;
- created_at: string;
- last_updated: string;
-}
-
-export function getAllPosts(filter?: Array): Post[];
-export function getAllNotes(filter?: Array): Note[];
-
-export function getPost(rawslug: string, filter?: Array): Post;
-export function getNote(rawslug: string, filter?: Array): Note;
-
-export function getPostsMeta(): PostMeta[];
-export function getNotesMeta(): NoteMeta[];
\ No newline at end of file