Skip to content

Commit

Permalink
First checkpoint of basic prototype - homepage changes and tailwind c…
Browse files Browse the repository at this point in the history
…omponents. Move theme assets to themes/le-2025 folder.
  • Loading branch information
scottmakestech committed Jan 15, 2025
0 parents commit 5fb2ff8
Show file tree
Hide file tree
Showing 4,467 changed files with 543,424 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
27 changes: 27 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# editorconfig.org

root = true

[*]
# Unix style files
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{htm,html}]
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 4

[*.{css,scss,sass}]
indent_style = space
indent_size = 2

[*.{md,markdown}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/static/js/*.min.js
/static/js/*-min.js
/static/js/plotly-locale-*.js
16 changes: 16 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
env:
browser: true
es6: true
extends: 'eslint:recommended'
rules:
indent:
- off
linebreak-style:
- error
- unix
quotes:
- error
- double
semi:
- error
- always
29 changes: 29 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 16
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
# same as netlify.toml
hugo-version: '0.128.2'
extended: true
- run: npm install
- run: npm run build
- run: npm test
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
_site/
.sass-cache/
.jekyll-metadata
js/*.tsv
Gemfile.lock
public/
nohup.out
/node_modules
.idea
static/js/main.min.js
static/css/main.min.css
resources/_gen/
.hugo_build.lock
.vscode/
**/.DS_Store
.codegpt
26 changes: 26 additions & 0 deletions .htmlhintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"tagname-lowercase": true,
"attr-lowercase": true,
"attr-value-double-quotes": false,
"attr-value-not-empty": false,
"attr-no-duplication": true,
"tag-pair": true,
"empty-tag-not-self-closed": false,
"spec-char-escape": false,
"id-unique": true,
"src-not-empty": true,
"title-require": true,
"alt-require": true,
"doctype-html5": true,
"id-class-value": false,
"style-disabled": false,
"space-tab-mixed-disabled": false,
"id-class-ad-disabled": true,
"href-abs-or-rel": false,
"attr-unsafe-chars": false,
"head-script-disabled": false,
"doctype-first":false,
"html-lang-require": true,
"inline-style-disabled": false,
"inline-script-disabled": false
}
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
- id: detect-private-key
- id: mixed-line-ending
- repo: local
hooks:
- id: eslint
name: eslint
entry: eslint
language: system
types: [javascript]
exclude: min.js$

6 changes: 6 additions & 0 deletions .sasslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"files": {
"include": "src/css/*.scss",
"ignore": "src/css/_pure.scss"
}
}
1 change: 1 addition & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You can find our [Code of Conduct here](https://community.letsencrypt.org/guidelines)
122 changes: 122 additions & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@

# Pages parameters


The code handling these parameters is in `layouts/_default/single.html`

## `untranslated: 1`

When the website is built, a page with this parameter will:
- Have its content replaced by the English version
- Links pointing to English pages that can be translated will be rewritten to points to the translation instead
- The top of the page will have a message to encourage new translators

## `do_not_translate: 1`

A page with this attribute will still have one version per language.

That attribute has two functions:
- It informs translators that this page should not be translated
- The top of the page will **NOT** have a message to encourage new translators

## `english_is_canonical: 1`

A translation with this attribute will display a warning on the top to indicate that the English version is canonical.

## `do_not_index: 1`

When a page should not appears in search engines.

## `date` and `lastmod`

Most pages displays the `lastmod` (or `date`) on the top. But the most important usage is to help synchronize translations: the `lastmod` of a translation must be equal to the `lastmod` of the translated page. So when a page is updated and need it's translations to be also updated, updating the `lastmod` helps to detect that automatically (on https://letsencrypt.org/i18n)

Also, if the `lastmod` of the translation differs from the `lastmod` of the English version, a message will appear on the top of the translated page, to inform the user that the English version is newer (with a link to see it)

# Translations

## Folder `content/base-l10n`

It contains files that should be copied to add a new language. When a new file is added, a template file can be created there.

## Dates

The `lastmod` is localized using javascript (see `i18n.js`)

## How to inform visitors about the translations

On the top of each English page with translations (pages really translated, not with the `untranslated` attribute), for each language, a message says "See this page in XXX". The javascript (`i18n.js`) only displays the languages relevant to the visitor (see `layouts/_default/single.html`).

# Glossary

`glossary.js` adds titles on links between terms.

`shortcodes/def.html` contains the documentation

# Plotly

`shortcodes/plotly.html` contains the code and an html tag with the necessary translations (There is no other way to access Hugo translation from the javascript).

Translations of plotly functions are in `static/js/plotly-locale-XX.js`, uploaded from https://github.com/plotly/plotly.js/tree/master/dist (some languages have only partial translations)

# Become a sponsor

The shortcode become-a-sponsor uses numberFormat

Ex.: numberFormat = "-|.|,"

and the i18n sentence `amount_per_year`

Ex.: amount_per_year="${{ .nb }}/yr (USD)"

To construct "$10.000/yr (USD)"

The shortcode is called in the `.md` template with the translations for Platin/Gold/Silver as a parameter. They are **not** in `i18n/` because there already are translations for those words for the **list** of sponsors, and sometimes the translation differs (Ex. in `ru`).

# How to add a new page

## If that page must appear in languages other than English

### If that page may be translated

After adding the `.md` file in `content/en`, a file with the same name must be copied in all other folders of `content/`, including `content/base-l10n` with the following content:

```text
---
slug: the-same-than-english
untranslated: 1
---
```

### If that page must not be translated

After adding the `.md` file in `content/en`, a file with the same name must be copied in all other folders of `content/`, including `content/base-l10n` with the following content:

```text
---
slug: repository
untranslated: 1
do_not_translate: 1
---
<!-- Note for translators: do NOT translate this file -->
```

## If that page must appear in the docs index

The file `layouts/_default/shortcodes/docs_index.md` must be updated.

The name of the link will be the `linkTitle` of the target page (if present) or the `title` of the target page.

# How to upgrade Hugo

https://github.com/gohugoio/hugo/releases

1. Generate the website using the current version: `hugo -d /tmp/current`
2. Generate the website using the updated version: `hugo -d /tmp/updated`
3. Check the diff to be sure nothing is broken: `diff -r /tmp/current /tmp/updated` (the diff is **never** empty, you must see at least the version updated in two files per languages)
4. If necessary, updates the code to be compatible with the new Hugo version
5. Update `netlify.toml` and `.travis.yml` to the new Hugo version
6. After opening the PR, check the Netlify preview: in the source, you need to check in the `<head>` the meta tag `<meta name="generator" content="Hugo 0.XX.X">` to be sure that version of Hugo is available on Netlify.
Loading

0 comments on commit 5fb2ff8

Please sign in to comment.