diff --git a/.gitignore b/.gitignore index 774b687..9d90f02 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ resources/ .DS_Store .hugo_build.lock content/de/calendar.md -content/en/calendar.md \ No newline at end of file +content/en/calendar.md +node_modules diff --git a/README.md b/README.md index 27fb487..5382443 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Staging: https://staging.x-hain.de [![status-badge](https://ci.x-hain.de/api/badges/xHain-hackspace/xhain-website/status.svg?branch=staging)](https://ci.x-hain.de/xHain-hackspace/xhain-website) -Production: https://www.x-hain.de [![status-badge](https://ci.x-hain.de/api/badges/xHain-hackspace/xhain-website/status.svg?branch=main)](https://ci.x-hain.de/xHain-hackspace/xhain-website) +Production: https://www.x-hain.de [![status-badge](https://ci.x-hain.de/api/badges/xHain-hackspace/xhain-website/status.svg?branch=main)](https://ci.x-hain.de/xHain-hackspace/xhain-website) ## Getting started @@ -10,43 +10,49 @@ Production: https://www.x-hain.de [![status-badge](https://ci.x-hain.de/api/bad #### Mac OS -* Install brew (for installing the rest): ``/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`` -* Install go: ``brew install go`` -* Install hugo: ``brew install hugo`` +- Install brew (for installing the rest): `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` +- Install go: `brew install go` +- Install hugo: `brew install hugo` #### For Windows/Linux -* Install hugo: [Hugo Website](https://gohugo.io) +- Install hugo: [Hugo Website](https://gohugo.io) ### Pull Submodules (eg. Theme) -* Initial pull submodule xhain-theme: ``git submodule update --init --recursive`` -* Submodule update: ``git submodule foreach git pull origin master`` +- Initial pull submodule xhain-theme: `git submodule update --init --recursive` +- Submodule update: `git submodule foreach git pull origin master` + +### Install Dependencies + +We use NPM to manage dependencies. Install these by running: + +`npm install` ### Generate Site -* Run hugo to generate HTML: ``hugo`` -* Run hugo for local development: +- Run hugo to generate HTML: `hugo` +- Run hugo for local development: - ``hugo server --config config.toml,home.toml`` + `hugo server --config config.toml,home.toml` - or + or - ``hugo server --config config.toml,home.toml -w --cleanDestinationDir`` + `npm run dev` ## Content Editing ### New Post -* create new post (using archetypes): +- create new post (using archetypes): - ``hugo new de/post/YYYY-MM-DD_title.de.md -k post`` + `hugo new de/post/YYYY-MM-DD_title.de.md -k post` - or + or - ``hugo new en/post/YYYY-MM-DD_title.en.md -k post`` + `hugo new en/post/YYYY-MM-DD_title.en.md -k post` -* just edit new post in the "content"-folder +- just edit new post in the "content"-folder ## Calendar diff --git a/assets/css/_calendar.scss b/assets/css/_calendar.scss index 123b3d6..09aaaac 100644 --- a/assets/css/_calendar.scss +++ b/assets/css/_calendar.scss @@ -145,8 +145,8 @@ padding: 0.8rem 1rem; border-radius: 0.3rem; font-size: 0.9rem; + line-height: 1.5em; margin-top: 0.5em; - word-break: break-word; hyphens: auto; .time { @@ -168,6 +168,11 @@ } } + .title { + display: block; + overflow: hidden; + } + .location { margin: 1em 0; width: max-content; @@ -199,6 +204,10 @@ &:hover { color: $link-color; + + .title { + text-decoration: underline; + } } } } diff --git a/assets/css/main.scss b/assets/css/main.scss index 2139d73..95cbbf2 100644 --- a/assets/css/main.scss +++ b/assets/css/main.scss @@ -80,7 +80,7 @@ body { a { color: $secondary-color; - text-decoration: none; + text-underline-offset: 0.15em; } a:hover { @@ -175,6 +175,11 @@ nav { font-family: $font-family-brand; } +header a, +nav a { + text-decoration: none; +} + main { img, video, diff --git a/assets/js/calendar.js b/assets/js/calendar.js index 1fd76c9..6599c5f 100644 --- a/assets/js/calendar.js +++ b/assets/js/calendar.js @@ -1,3 +1,5 @@ +import { marked } from "marked"; + // global DOM elements and variables const activeEventInterval = 1000 * 60 * 10; // 10 minutes let $calendar = null; @@ -125,7 +127,11 @@ function setupModal() { } function openModal(eventElement) { - const eventData = { ...eventElement.dataset }; + const eventData = { + ...eventElement.dataset, + // parse markdown in the description + description: marked.parse(eventElement.dataset.description), + }; $overlay.innerHTML = renderModal(modalTemplate, eventData); showModal(); } diff --git a/layouts/calendar/list.html b/layouts/calendar/list.html index 9952efd..86e76a9 100644 --- a/layouts/calendar/list.html +++ b/layouts/calendar/list.html @@ -82,4 +82,5 @@

{{ .Title }}

aria-modal="true" > + {{ end }} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..e31d3fb --- /dev/null +++ b/package-lock.json @@ -0,0 +1,28 @@ +{ + "name": "xhain-website", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "xhain-website", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "marked": "^12.0.2" + }, + "devDependencies": {} + }, + "node_modules/marked": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.2.tgz", + "integrity": "sha512-qXUm7e/YKFoqFPYPa3Ukg9xlI5cyAtGmyEIzMfW//m6kXwCy2Ps9DYf5ioijFKQ8qyuscrHoY04iJGctu2Kg0Q==", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 18" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..292cb30 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "xhain-website", + "version": "1.0.0", + "description": "Staging: https://staging.x-hain.de [![status-badge](https://ci.x-hain.de/api/badges/xHain-hackspace/xhain-website/status.svg?branch=staging)](https://ci.x-hain.de/xHain-hackspace/xhain-website)", + "main": "index.js", + "scripts": { + "dev": "hugo server --config config.toml,home.toml", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/xHain-hackspace/xhain-website.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/xHain-hackspace/xhain-website/issues" + }, + "homepage": "https://github.com/xHain-hackspace/xhain-website#readme", + "dependencies": { + "marked": "^12.0.2" + } +}