This document provides technical details for developers working on the AI Safety Norway website.
The AI Safety Norway website is built using Eleventy, a powerful static site generator. The website is designed to be multilingual (Norwegian and English) and focuses on promoting AI safety awareness and research in Norway.
Clone the repository
git clone https://github.com/aisnorway/aisn-website.git
cd aisn-website
Install dependencies
npminstall
Start the development server
npm start
The development server will be available at http://localhost:8080 with live reloading.
The website uses a custom internationalization system:
_data/i18n/
directoryen.json
for English and no.json
for Norwegiani18n
filter in templates/en/about/
, /no/om-oss/
)To update text content on the website, locate the appropriate string in the language files:
_data/i18n/en.json
and/or _data/i18n/no.json
For example, updating homepage content:
"home":{"problem":{"title":"The Challenge We Face","points":[{"title":"The AI Arms Race","description":"Competition between leading AI labs and nation states is driving a race towards increasingly advanced AI systems at the cost of everyone's safety."},// ...]}}
The homepage is constructed from several sections defined in _includes/sections/home-content.njk
. Each section pulls content from the internationalization files.
This section contains highlight cards and feature cards:
Highlight Cards - The top row of cards with icons
i18n/[lang].json
under home.problem.highlights
_includes/sections/home-content.njk
Feature Cards - The main content cards
i18n/[lang].json
under home.problem.points
Create a new Markdown file in the appropriate language directory:
en/newsletter/your-article-slug.md # English article
no/nyhetsbrev/your-article-slug.md # Norwegian article
Add the required front matter:
---layout: post.njk
title:"Your Article Title"date:2024-08-15author:"Author Name"lang: en # or "no" for Norwegianpermalink: /en/newsletter/your-article-slug/ # or /no/nyhetsbrev/your-article-slug/ for Norwegiandescription:"A brief excerpt that summarizes your article."image:"/img/articles/your-featured-image.jpg"# Featured image path--- Article content goes here in Markdown format.
The CSS is organized in a modular architecture:
css/base/
- Core styles and variablescss/components/
- Reusable component styles (cards, buttons, etc.)css/pages/
- Page-specific stylescss/sections/
- Section-specific stylescss/utils/
- Utility styles--variable-name
) for consistent themingThe website is automatically deployed to GitHub Pages when changes are pushed to the main branch:
Commit your changes
gitadd.git commit -m"Description of changes"
Push to main branch to trigger deployment
git push origin main
The GitHub Actions workflow will build and deploy the site to the custom domain.
Internationalization:
Responsive Design:
Performance:
Accessibility:
Git Workflow:
If you encounter issues or have questions about the codebase, please:
docs/
folder