dr-griezel.github.io (Template)
- Jekyll (static site generator): Markdown/HTML pages are compiled with layouts and includes.
- Layouts:
src/_layouts/base.htmlcomposes the page chrome (sidebar, header, footer, main content). - Includes:
src/_includes/nav.html,src/_includes/header.html,src/_includes/footer.htmlare partials injected by layouts. - Static assets:
src/assets/cssandsrc/assets/jshold styling and behavior modules.
- Navigation pipeline
- Jekyll loads pages from
src/html/nav/. src/_includes/nav.htmlfilterssite.pagesto build sidebar links.nav_labelandnav_orderin each page control label and order.
- Jekyll loads pages from
- Layout pipeline
src/_layouts/base.htmlrenders the layout, then injectspage.cssandpage.jslists.src/assets/js/site.jsruns globally for layout behaviors (sidebar toggles, etc.).
- Widget pipeline
src/html/nav/index.htmlcomposes widgets by rendering pages from/widgets/.src/assets/js/widgets/widgets.jsprovides clock/weather helpers.src/assets/js/widgets/pomodoro-core.jshandles timer state and formatting.src/assets/js/widgets/pomodoro.jsbinds UI to the pomodoro core.
- Updates pipeline
src/html/nav/updates.htmlloadssrc/assets/js/updates.jsas a module.updates.jsfetches GitHub commits and renders them into the updates list.
.
βββ assets -> src/assets # Symlink for Jekyll static output
βββ blog/ # Blog post markdown entries
βββ config/
β βββ _config.yml # Jekyll config
β βββ firebase-config.js
β βββ github_config.js
βββ src/
β βββ _includes/ # Jekyll partials (nav/header/footer)
β βββ _layouts/ # Base layout
β βββ assets/
β β βββ css/ # Stylesheets
β β βββ img/ # Icons and illustrations
β β βββ js/ # JS modules (widgets, pomodoro, updates)
β βββ html/
β β βββ nav/ # Pages that appear in the sidebar
β β βββ 404.html
β β βββ 500.html
β βββ widgets/ # Widget partial pages
β βββ test/ # Vitest unit tests
βββ package.json
βββ README.md
Set your Firebase client config in config/firebase-config.js (served as
/config/firebase-config.js in the built site). Keep values in sync with your Firebase Web app:
export const firebaseConfig = {
apiKey: 'FIREBASE_API_KEY',
authDomain: 'FIREBASE_AUTH_DOMAIN',
projectId: 'FIREBASE_PROJECT_ID',
storageBucket: 'FIREBASE_STORAGE_BUCKET',
messagingSenderId: 'FIREBASE_MESSAGING_SENDER_ID',
appId: 'FIREBASE_APP_ID',
measurementId: 'FIREBASE_MEASUREMENT_ID',
};- Create a Firebase project, register a Web app, and paste the config values into
config/firebase-config.js. - If you register a new Google OAuth client, update
googleClientIdinsrc/assets/js/login/login-buttons.jsso Firebase auth uses the correct client ID.
The Updates page pulls commits based on config/github_config.js. Update owner and repo if you
fork the site so the updates page points at the correct GitHub repository.
- Install Ruby and Jekyll.
gem install jekyll
- Build and serve the site locally:
jekyll serve --config config/_config.yml --livereload
- Visit
http://localhost:4000.
- Build the site:
jekyll build --config config/_config.yml
- Upload the
_site/directory to any static host (Nginx, Apache, S3, etc.).
- Build the site:
jekyll build --config config/_config.yml
- Serve the output locally:
python -m http.server 8000 --directory _site
- Visit
http://localhost:8000.
Install the Node dependencies that back the tests and linting:
npm installBefore committing, keep the formatting and linting tools happy:
npm run format
npm run lintRun the unit tests (Vitest is configured to emit coverage):
npm test- Create .html file in
/src/html/nav/ - Add front matter:
---
layout: base
title: 'My Page'
nav_label: 'My Page'
nav_order: 100
permalink: /my-page/
css:
- /assets/css/main.css
module_js: true
---- Optional field:
req_loginhides pages when not logged in.
nav_ordershould not be the same number as any other page inside/src/html/nav.
- Put js file in
src/assets/js/widgets - Create .md file in
/src/widgets - Add front matter:
---
layout: base
title: 'My Widget'
summary: 'A custom widget.'
image: '/assets/img/widgets/my-widget.svg'
css:
- /assets/css/main.css
- /assets/css/dash.css
js:
- /assets/js/widgets/my-widget.js
module_js: true
---- Create new .md file in
blog/(for example:blog/my-new-post.md). - Add front matter:
--- layout: blog title: 'Post title' subtitle: 'Post subtitle' css: - /assets/css/main.css image: '/assets/img/blog/your-image.svg' date: 2024-01-12 ---
- Add post content below front matter.
- Images should be in
src/assets/img/blog. (Temporarily -- see TODO)
-
Widget Ideas:
- unix/dt/iso converter
-
Login:
- Add verification method after auth to access data: automatically assign gmail/github accounts to discord (user_id, username, profile picture, ...) -> via Discord API: 1. in-app (creating manual registration command which generates a one-time code (copy code or generate encrypted URL?) every session)
- [-] User settings page
-
On-site blog creator with login protection
-
[?] integrate like/comment system
-
[?] generate svg based on title/tag (enter title -> generate .svg img -> attach .svg link to frontmatter (requires ChatGPT API)
-
Edit existing articles in editor
-
Create post (title, desc frontmatter fields, choose from preset tags (emoji) ( category/folder, body = textbox)