Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docsy #244

Merged
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# Update the NODE_VERSION arg in docker-compose.yml to pick a Node version: 10, 12, 14
ARG NODE_VERSION=14
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${NODE_VERSION}
# syntax=docker/dockerfile:1
FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04

# VARIANT can be either 'hugo' for the standard version or 'hugo_extended' for the extended version.
ARG VARIANT=hugo
ARG VARIANT=hugo_extended
# VERSION can be either 'latest' or a specific version number
ARG VERSION=latest

# Download Hugo
RUN apt-get update && apt-get install -y ca-certificates openssl git curl && \
rm -rf /var/lib/apt/lists/* && \
case ${VERSION} in \
RUN case ${VERSION} in \
latest) \
export VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') ;;\
esac && \
Expand All @@ -28,11 +25,3 @@ RUN apt-get update && apt-get install -y ca-certificates openssl git curl && \

# Hugo dev server port
EXPOSE 1313

# [Optional] Uncomment this section to install additional OS packages you may want.
#
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment if you want to install more global node packages
# RUN sudo -u node npm install -g <your-package-list-here>
50 changes: 22 additions & 28 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.217.4/containers/hugo
{
"name": "Hugo (Community)",
"name": "Hugo",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update VARIANT to pick hugo variant.
// Example variants: hugo, hugo_extended
// Rebuild the container if it already exists to update.
"VARIANT": "hugo_extended",
// Update VERSION to pick a specific hugo version.
// Example versions: latest, 0.73.0, 0,71.1
// Rebuild the container if it already exists to update.
"VERSION": "latest",
// Update NODE_VERSION to pick the Node.js version: 12, 14
"NODE_VERSION": "14",
}
"dockerfile": "Dockerfile"
},
// Set *default* container specific settings.json values on container create.
"settings": {
"html.format.templating": true,
"customizations": {
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"html.format.templating": true
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"bungcip.better-toml",
"davidanson.vscode-markdownlint",
"GitHub.vscode-pull-request-github"
]
}
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"bungcip.better-toml",
"davidanson.vscode-markdownlint",
"GitHub.vscode-pull-request-github"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
1313
],
"remoteUser": "vscode",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "git submodule update --init --recursive --depth 1 && npm i",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node",
// "postCreateCommand": ""
"features": {
"git": "os-provided"
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/devcontainers/features/hugo:1": {},
"ghcr.io/devcontainers/features/node:1": {}
}
}
}
4 changes: 1 addition & 3 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.118.2
HUGO_VERSION: 0.133.1
steps:
- name: Install Hugo CLI
run: |
Expand All @@ -41,8 +41,6 @@ jobs:
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regen-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '20'
christianbraeunlich marked this conversation as resolved.
Show resolved Hide resolved

- name: Cache dependencies
uses: actions/cache@v1
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/microsoft/alguidelines

go 1.23.0

require github.com/google/docsy v0.10.0 // indirect
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github.com/FortAwesome/Font-Awesome v0.0.0-20240402185447-c0f460dca7f7/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sample file, has more content: (See https://github.com/google/docsy-example/blob/main/go.sum)

github.com/FortAwesome/Font-Awesome v0.0.0-20240402185447-c0f460dca7f7/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/google/docsy v0.10.0 h1:6tMDacPwAyRWNCfvsn/9qGOZDQ8b0aRzjRZvnZPY5dg=
github.com/google/docsy v0.10.0/go.mod h1:c0nIAqmRTOuJ01F85U/wJPQtc3Zj9N58Kea9bOT2AJc=
github.com/google/docsy v0.10.1-0.20240516225026-36746913371a h1:Fmx4SmmyWZf4q3rq9jhVWr6/h2MKEi4+61irjQO2ylI=
github.com/google/docsy v0.10.1-0.20240516225026-36746913371a/go.mod h1:c0nIAqmRTOuJ01F85U/wJPQtc3Zj9N58Kea9bOT2AJc=
github.com/google/docsy v0.10.1-0.20240528200232-6549143cf323 h1:T4UiGpcrIgiuyQj0tc7BtJwv6u736J8Jnl4QZno0fk4=
github.com/google/docsy v0.10.1-0.20240528200232-6549143cf323/go.mod h1:c0nIAqmRTOuJ01F85U/wJPQtc3Zj9N58Kea9bOT2AJc=
github.com/google/docsy v0.10.1-0.20240529105443-333c2f8d4172 h1:1gAAuOfHRok/hJqfF+wpjOYqlH0d76dwUsskLEnOzxo=
github.com/google/docsy v0.10.1-0.20240529105443-333c2f8d4172/go.mod h1:c0nIAqmRTOuJ01F85U/wJPQtc3Zj9N58Kea9bOT2AJc=
github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=

Copy link
Contributor Author

@christianbraeunlich christianbraeunlich Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've followed the steps in https://www.docsy.dev/docs/updating/convert-site-to-module/#import-the-docsy-theme-module-as-a-dependency-of-your-site, which automatically generated the go.sum and go.mod files.

Based on the commit history of the file, I assume they've added the additional docsy version dependencies to test the new RTL feature.

Would leave the content on it's initial, auto-generated state.

github.com/google/docsy v0.10.0 h1:6tMDacPwAyRWNCfvsn/9qGOZDQ8b0aRzjRZvnZPY5dg=
github.com/google/docsy v0.10.0/go.mod h1:c0nIAqmRTOuJ01F85U/wJPQtc3Zj9N58Kea9bOT2AJc=
github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
11 changes: 6 additions & 5 deletions config.toml → hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ languageCode = 'en-us'
title = 'AL Guidelines'

# Hugo allows theme composition (and inheritance). The precedence is from left to right.
theme = ["docsy"]
theme = ["github.com/google/docsy"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sample does not specify a theme, but has the following content to use Docsy as a module (See https://www.docsy.dev/docs/get-started/docsy-as-module/)

Sample config file:

https://github.com/google/docsy-example/blob/604f8183399ebc25e53dfd08f5607817e21a2871/hugo.yaml#L212:L220

module:
  # Uncomment the next line to build and serve using local docsy clone declared in the named Hugo workspace:
  # workspace: docsy.work
  hugoVersion:
    extended: true
    min: 0.110.0
  imports:
    - path: github.com/google/docsy
      disable: false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the migration guide, it was mentioned that the value can be changed from theme = ["docsy"] to theme = ["github.com/google/docsy"] (https://www.docsy.dev/docs/updating/convert-site-to-module/#update-your-config-file).

Alternatively, we could add the example you've provided. Should I adapt these changes?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do that in a separate PR later. But I do think we should get the update "all the way"

image


# Will give values to .Lastmod etc.
enableGitInfo = true
Expand Down Expand Up @@ -72,11 +72,12 @@ id = ""

[languages]
[languages.en]
description = "Guidelines for when Developing AL for Microsoft Dynamics 365 Business Central"
languageName = "English"
title = "alguidelines.dev - Business Central Design Patterns"
languageName = "English"
# Weight used for sorting.
weight = 1
[languages.en.params]
description = "Guidelines for when Developing AL for Microsoft Dynamics 365 Business Central"

# Everything below this are Site Params

Expand Down Expand Up @@ -149,8 +150,8 @@ url = '/blog/serverless-next.js-example-blog-with-fission/'
[params.ui]
# Set to true to disable breadcrumb navigation.
breadcrumb_disable = false
# Set to true to disable the About link in the site footer
footer_about_disable = false
# Set to true to show an About link in the site footer
footer_about_enable = true
# Set to false if you don't want to display a logo (/assets/icons/logo.svg) in the top navbar
navbar_logo = true
# Set to true if you don't want the top navbar to be translucent when over a `block/cover`, like on the homepage.
Expand Down
Loading
Loading