Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,9 @@ RUN hugo --destination /workspace/public

EXPOSE 1313

CMD ["hugo", "server", "--bind", "0.0.0.0", "--baseURL", "https://bazel-docs-68tmf.ondigitalocean.app/", "--disableFastRender"]
# Default base URL can be overridden at build or run time
ARG BASE_URL=https://bazel-docs-68tmf.ondigitalocean.app/
ENV HUGO_BASEURL=${BASE_URL}

# Use shell form so the environment variable is expanded correctly
CMD ["sh","-c", "hugo server --bind 0.0.0.0 --baseURL \"$HUGO_BASEURL\" --disableFastRender"]
276 changes: 242 additions & 34 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Configuration for Devsite to Hugo Converter

# Source repository settings
# Docsy Theme Configuration
source_repo:
owner: "bazelbuild"
name: "bazel"
branch: "master"
path: "site/en"
owner: "alan707"
name: "bazel-docs"
branch: "main"

# Hugo site settings
hugo:
Expand All @@ -15,47 +14,103 @@ hugo:
languageCode: "en-us"
theme: "docsy"

# Content mapping - map Devsite sections to Hugo content types
# Content mapping - organized into 4 main categories
content_mapping:
concepts:
type: "docs"
# TUTORIALS - Step-by-step guides for users
tutorials:
type: "tutorials"
weight: 10
basics:
type: "docs"
category: "Tutorials"
start:
type: "tutorials"
weight: 20
tutorials:
type: "docs"
category: "Tutorials"
basics:
type: "tutorials"
weight: 30
category: "Tutorials"

# HOW-TO GUIDES - Practical instructions for specific tasks
install:
type: "how-to-guides"
weight: 10
category: "How-To Guides"
configure:
type: "how-to-guides"
weight: 20
category: "How-To Guides"
build:
type: "docs"
type: "how-to-guides"
weight: 30
category: "How-To Guides"
run:
type: "how-to-guides"
weight: 40
configure:
type: "docs"
category: "How-To Guides"
remote:
type: "how-to-guides"
weight: 50
extending:
type: "docs"
category: "How-To Guides"
migrate:
type: "how-to-guides"
weight: 60
external:
type: "docs"
category: "How-To Guides"
rules:
type: "how-to-guides"
weight: 70
remote:
type: "docs"
category: "How-To Guides"
docs:
type: "how-to-guides"
weight: 80
query:
type: "docs"
weight: 90
reference:
type: "docs"
weight: 100
category: "How-To Guides"

# EXPLANATIONS - In-depth articles explaining concepts and features
concepts:
type: "explanations"
weight: 10
category: "Explanations"
extending:
type: "explanations"
weight: 20
category: "Explanations"
external:
type: "explanations"
weight: 30
category: "Explanations"
about:
type: "explanations"
weight: 40
category: "Explanations"
community:
type: "community"
weight: 200
type: "explanations"
weight: 50
category: "Explanations"
contribute:
type: "community"
weight: 210
about:
type: "about"
weight: 300
type: "explanations"
weight: 60
category: "Explanations"
release:
type: "explanations"
weight: 70
category: "Explanations"

# REFERENCE - Detailed reference material for advanced users
reference:
type: "reference"
weight: 10
category: "Reference"
query:
type: "reference"
weight: 20
category: "Reference"
versions:
type: "reference"
weight: 30
category: "Reference"
advanced:
type: "reference"
weight: 40
category: "Reference"

# CSS conversion settings
css_conversion:
Expand Down Expand Up @@ -99,3 +154,156 @@ file_patterns:
- "*.bzl"
- ".git/**"
- "node_modules/**"

# Used to automatically detect language for code blocks without explicit language identifiers
code_language_patterns:
starlark:
- "cc_binary("
- "cc_library("
- "java_library("
- "py_binary("
- "py_library("
- "load("
- "BUILD"
- "WORKSPACE"
- "bazel-"
- "name ="
- "srcs ="
- "deps ="
- "cc_toolchain("
- "toolchain("
- "filegroup("
- "exports_files("
bash:
- "bazel "
- "bazel help"
- "bazel build"
- "bazel test"
- "bazel run"
- "bazel query"
- "#!/bin/bash"
- "#!/bin/sh"
- "echo "
- "export "
- "source "
- "$("
- "${"
- "$"
- "npm "
- "yarn "
- "git "
- "cd "
- "mkdir "
- "rm "
- "cp "
python:
- "def "
- "class "
- "import "
- "from "
- "print("
- "__init__"
- "self."
- "@"
- "lambda "
- "return "
- "if __name__"
- "try:"
- "except:"
cpp:
- "#include"
- "int main"
- "std::"
- "namespace "
- "cout <<"
- "void "
- "template<"
- "nullptr"
- ".cc"
- ".cpp"
- ".h"
- "cin >>"
- "using namespace"
- "printf("
- "scanf("
java:
- "public class"
- "private "
- "protected "
- "import java"
- "package "
- "extends "
- "implements "
- "@Override"
- "System.out.println"
- "new "
- "throw new"
- "catch ("
javascript:
- "function "
- "const "
- "let "
- "var "
- "=>"
- "console.log"
- "require("
- "export "
- "import "
- "async "
- "await "
- "document."
- "window."
- "addEventListener"
typescript:
- "interface "
- "type "
- ": string"
- ": number"
- ": boolean"
- "enum "
- "readonly "
- "as "
yaml:
- "name:"
- "type:"
- "- name:"
- "kind:"
- "apiVersion:"
- "metadata:"
- "spec:"
json:
- '{"'
- '":'
- '": '
- '['
- '],'
xml:
- "<?xml"
- "<"
- "/>"
- "xmlns"
html:
- "<!DOCTYPE"
- "<html"
- "<body"
- "<div"
- "<span"
- "<p>"
- "<h1"
css:
- "body {"
- "div {"
- ".class"
- "#id"
- "color:"
- "background:"
- "@media"
sql:
- "SELECT "
- "FROM "
- "WHERE "
- "INSERT INTO"
- "UPDATE "
- "DELETE FROM"
- "CREATE TABLE"
- "DROP TABLE"
Loading