From fd41d9d4edc44a12d484b673a6f96b88c9a6593a Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Tue, 8 Nov 2022 17:29:10 +0000 Subject: [PATCH] Update docsy (hugo theme) git submodule (#1295) --- .github/workflows/main.yml | 4 ---- README.md | 10 +++++----- assets/scss/_variables_project.scss | 18 +++++++++++++----- assets/scss/custom.scss | 19 ++++++++++++------- .../internal/newsfragments/1295.feature | 1 + package.json | 3 +++ themes/docsy | 2 +- 7 files changed, 35 insertions(+), 22 deletions(-) create mode 100644 changelogs/internal/newsfragments/1295.feature diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e83a3e7..0c8301f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -115,8 +115,6 @@ jobs: extended: true - name: "📥 Source checkout" uses: actions/checkout@v2 - with: - submodules: 'recursive' - name: "⚙️ npm" run: | npm i @@ -161,8 +159,6 @@ jobs: extended: true - name: "📥 Source checkout" uses: actions/checkout@v2 - with: - submodules: 'recursive' - name: "⚙️ npm" run: | npm i diff --git a/README.md b/README.md index 29028e01..e8e7a793 100644 --- a/README.md +++ b/README.md @@ -65,15 +65,15 @@ place after an MSC has been accepted, not as part of a proposal itself. Alternatively, use the Docker image at https://hub.docker.com/r/klakegg/hugo/. (The "extended edition" is required to process the SCSS.) -2. Run `git submodule update --init --recursive` for good measure. -3. Run `npm i` to install the dependencies. Note that this will require NodeJS to be installed. -4. Run `npm run get-proposals` to seed proposal data. This is merely for populating the content of the "Spec Change Proposals" +2. Run `npm i` to install the dependencies and fetch the docsy git submodule. + Note that this will require NodeJS to be installed. +3. Run `npm run get-proposals` to seed proposal data. This is merely for populating the content of the "Spec Change Proposals" page and is not required. -5. Run `hugo serve` (or `docker run --rm -it -v $(pwd):/src -p 1313:1313 +4. Run `hugo serve` (or `docker run --rm -it -v $(pwd):/src -p 1313:1313 klakegg/hugo:ext serve`) to run a local webserver which builds whenever a file change is detected. If watching doesn't appear to be working for you, try adding `--disableFastRender` to the commandline. -6. Edit the specification 🙂 +5. Edit the specification 🙂 We use a highly customized [Docsy](https://www.docsy.dev/) theme for our generated site, which uses Bootstrap and Font Awesome. If you're looking at making design-related changes to the spec site, please coordinate with us in diff --git a/assets/scss/_variables_project.scss b/assets/scss/_variables_project.scss index 637c0575..9b4a0b15 100644 --- a/assets/scss/_variables_project.scss +++ b/assets/scss/_variables_project.scss @@ -36,9 +36,17 @@ $table-border-color: rgba(black, .125); $table-row-alternate: $secondary-lightest-background; $table-row-default: $secondary-lighter-background; +/* Configure docsy to use the default system fonts instead of Google Fonts. + * See https://www.docsy.dev/docs/adding-content/lookandfeel/#fonts */ +$td-enable-google-fonts: false; + /* - Opt to serve fonts locally by overriding web-font-path to be a non-google fonts URL. - This is only possible with our modified docsy theme: https://github.com/matrix-org/docsy - */ -$web-font-path: "../css/fonts/Inter.css"; -$google_font_name: "Inter"; + * Replace the default font with Inter - we load it from a local copy, which is downloaded from + * Google Fonts manually via a script: + * https://github.com/matrix-org/matrix-spec/tree/main/static/css/fonts + * + * The $font-family-sans-serif definition here overrides the default value set by docsy: + * https://github.com/matrix-org/docsy/blob/66a4e61d2d34edc7196b9df83a7d09cd4af14b47/assets/scss/_variables.scss#L68 + * and adds "Inter" to the front. */ +@import url("../css/fonts/Inter.css"); +$font-family-sans-serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; \ No newline at end of file diff --git a/assets/scss/custom.scss b/assets/scss/custom.scss index 36566d9a..528af5a0 100644 --- a/assets/scss/custom.scss +++ b/assets/scss/custom.scss @@ -340,6 +340,17 @@ footer { } table { + /* Docsy makes all tables "responsive tables", which causes Bootstrap 4 to create + * tables with a "display" property of "block". + * + * However, for "table-layout: fixed" to be effective, an element must have a + * "display" property of "table". + * + * Thus, we override the "display" property here. This may no longer be necessary once + * Docsy updates to Bootstrap v5+: https://github.com/google/docsy/issues/470. + * For more details, see + * https://github.com/matrix-org/matrix-spec/pull/1295/files#r1010759688 */ + display: table; table-layout: fixed; width: 100%; @@ -462,10 +473,4 @@ Make padding symmetrical (this selector is used in the default styles to apply p background-position: left 1rem center; background-repeat: no-repeat; padding-left: 100px; -} - -/* Full-width tables */ -.td-content > table { - width: 100%; - display: table; -} +} \ No newline at end of file diff --git a/changelogs/internal/newsfragments/1295.feature b/changelogs/internal/newsfragments/1295.feature new file mode 100644 index 00000000..59ea7939 --- /dev/null +++ b/changelogs/internal/newsfragments/1295.feature @@ -0,0 +1 @@ +Update docsy theme to v0.5.0 + matrix.org modifications (https://github.com/matrix-org/docsy/commit/a0032f8db919a6c67ba6cdef2c455f105b6272a2). \ No newline at end of file diff --git a/package.json b/package.json index 4e277d28..f023a750 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,9 @@ "main": "none.js", "scripts": { "get-proposals": "node ./scripts/proposals.js", + "get:submodule": "git submodule update --init --depth 1", + "_prepare:docsy": "cd themes/docsy && npm install", + "prepare": "npm run get:submodule && npm run _prepare:docsy", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { diff --git a/themes/docsy b/themes/docsy index 5023a291..a0032f8d 160000 --- a/themes/docsy +++ b/themes/docsy @@ -1 +1 @@ -Subproject commit 5023a2914528e012ecf3ec85a56028c00ee97dd2 +Subproject commit a0032f8db919a6c67ba6cdef2c455f105b6272a2