Skip to content

docs: #3882 support localization style documentation #3883

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
131 changes: 131 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ site_dir: site
docs_dir: site-src
extra:
trademark: https://www.linuxfoundation.org/legal/trademark-usage
alternate:
- name: English
link: /
lang: en
- name: 한국어 (Korean)
link: /ko/
lang: ko
extra_css:
- stylesheets/extra.css
extra_javascript:
- https://unpkg.com/[email protected]/dist/tablesort.min.js
- js/implementations.js
- js/language-switch.js
hooks:
- hack/mkdocs-copy-geps.py
- hack/mkdocs-generate-conformance.py
Expand All @@ -28,6 +36,7 @@ theme:
- navigation.expand
palette:
primary: custom
language: en
custom_dir: site-src/overrides
edit_uri: edit/main/site-src/
plugins:
Expand Down Expand Up @@ -188,6 +197,128 @@ nav:
- Enhancement Requests: contributing/enhancement-requests.md
- Release Cycle: contributing/release-cycle.md
- Contributor Ladder: contributing/contributor-ladder.md
- 개요:
- 소개: ko/index.md
- 개념:
- API 개요: ko/concepts/api-overview.md
- 호환성: ko/concepts/conformance.md
- 역할과 페르소나: ko/concepts/roles-and-personas.md
- 보안 모델: ko/concepts/security-model.md
- 도구: ko/concepts/tooling.md
- 사용 사례: ko/concepts/use-cases.md
- 버전 관리: ko/concepts/versioning.md
- 서비스 메시:
- 개요: ko/mesh/index.md
- GAMMA 이니셔티브: ko/mesh/gamma.md
- 서비스 측면: ko/mesh/service-facets.md
- 구현:
- 목록: ko/implementations.md
- 비교:
- v1.3: ko/implementations/v1.3.md
- v1.2: ko/implementations/v1.2.md
- v1.1: ko/implementations/v1.1.md
- v1.0: ko/implementations/v1.0.md
- FAQ: ko/faq.md
- 용어집: ko/concepts/glossary.md
- 가이드:
- 사용자 가이드:
- 시작하기: ko/guides/index.md
- 간단한 게이트웨이: ko/guides/simple-gateway.md
- HTTP 라우팅: ko/guides/http-routing.md
- HTTP 리디렉션 및 재작성: ko/guides/http-redirect-rewrite.md
- HTTP 헤더 수정자: ko/guides/http-header-modifier.md
- HTTP 트래픽 분할: ko/guides/traffic-splitting.md
- HTTP 요청 미러링: ko/guides/http-request-mirroring.md
- 네임스페이스 간 라우팅: ko/guides/multiple-ns.md
- TLS: ko/guides/tls.md
- TCP 라우팅: ko/guides/tcp.md
- gRPC 라우팅: ko/guides/grpc-routing.md
- Ingress에서 마이그레이션: ko/guides/migrating-from-ingress.md
- 백엔드 프로토콜 선택: ko/guides/backend-protocol.md
- 인프라 속성: ko/guides/infrastructure.md
- API 설계: ko/guides/api-design.md
- CRD 관리: ko/guides/crd-management.md
- 구현자 가이드: ko/guides/implementers.md
- 참조:
- API 타입:
- Gateway: ko/api-types/gateway.md
- GatewayClass: ko/api-types/gatewayclass.md
- GRPCRoute: ko/api-types/grpcroute.md
- HTTPRoute: ko/api-types/httproute.md
- 정책:
- BackendTLSPolicy: ko/api-types/backendtlspolicy.md
- BackendTrafficPolicy: ko/api-types/backendtrafficpolicy.md
- ReferenceGrant: ko/api-types/referencegrant.md
- API 명세:
- 표준: ko/reference/spec.md
- 실험적: ko/reference/specx.md
- 정책 연결: ko/reference/policy-attachment.md
- 개선 사항:
- 개요: ko/geps/overview.md
- 임시:
- ko/geps/gep-1494/index.md
- ko/geps/gep-1651/index.md
- ko/geps/gep-2648/index.md
- ko/geps/gep-3379/index.md
- ko/geps/gep-3792/index.md
- ko/geps/gep-3793/index.md
- 구현 가능:
- ko/geps/gep-91/index.md
- ko/geps/gep-3567/index.md
- 실험적:
- ko/geps/gep-995/index.md
- ko/geps/gep-1619/index.md
- ko/geps/gep-1713/index.md
- ko/geps/gep-1731/index.md
- ko/geps/gep-1748/index.md
- ko/geps/gep-1767/index.md
- ko/geps/gep-1897/index.md
- ko/geps/gep-2162/index.md
- ko/geps/gep-2649/index.md
- ko/geps/gep-3155/index.md
- ko/geps/gep-3388/index.md
- ko/geps/gep-3567/index.md
- 표준:
- ko/geps/gep-709/index.md
- ko/geps/gep-718/index.md
- ko/geps/gep-724/index.md
- ko/geps/gep-726/index.md
- ko/geps/gep-746/index.md
- ko/geps/gep-820/index.md
- ko/geps/gep-851/index.md
- ko/geps/gep-957/index.md
- ko/geps/gep-1016/index.md
- ko/geps/gep-1294/index.md
- ko/geps/gep-1323/index.md
- ko/geps/gep-1364/index.md
- ko/geps/gep-1686/index.md
- ko/geps/gep-1709/index.md
- ko/geps/gep-1742/index.md
- ko/geps/gep-1762/index.md
- ko/geps/gep-1867/index.md
- ko/geps/gep-1911/index.md
- ko/geps/gep-2257/index.md
- ko/geps/gep-3171/index.md
- 메모:
- ko/geps/gep-713/index.md
- ko/geps/gep-917/index.md
- ko/geps/gep-922/index.md
- ko/geps/gep-1324/index.md
- ko/geps/gep-2659/index.md
- ko/geps/gep-2722/index.md
- ko/geps/gep-2907/index.md
- 거부됨:
- ko/geps/gep-735/index.md
- ko/geps/gep-1282/index.md
- 기여:
- 참여 방법: ko/contributing/index.md
- 개발자 가이드: ko/contributing/devguide.md
- 문서 스타일 가이드: ko/contributing/style-guide.md
- 개선 요청: ko/contributing/enhancement-requests.md
- 릴리스 주기: ko/contributing/release-cycle.md
- 기여자 사다리: ko/contributing/contributor-ladder.md
not_in_nav: |
/blog/*
/geps/gep-696/*
/ko/blog/*
/ko/geps/gep-696/*
142 changes: 142 additions & 0 deletions site-src/js/language-switch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
(function() {
'use strict';

let cachedElements = {};

function getCachedElement(selector, parent = document) {
if (!cachedElements[selector]) {
cachedElements[selector] = parent.querySelector(selector);
}
return cachedElements[selector];
}

// Check current language
const isKorean = window.location.pathname.startsWith('/ko/');

// Language switching function
function switchLanguage(lang) {
const currentPath = window.location.pathname;
let newPath;

if (lang === 'ko') {
if (currentPath.startsWith('/ko/')) return;
newPath = '/ko' + currentPath;
} else {
if (currentPath.startsWith('/ko/')) {
newPath = currentPath.substring(3);
} else return;
}

// Set cookie and navigate to new page
document.cookie = `preferred_language=${lang}; path=/; max-age=31536000`;
window.location.href = newPath;
}

// Update language selector
function updateLanguageSelector() {
const langButton = getCachedElement('.md-header__button[aria-label="Select language"]');
if (!langButton) return;

const currentLangText = isKorean ? '한국어 (Korean)' : 'English';

// Use CSS classes for style control
document.body.className = document.body.className.replace(/(^|\s)(is-korean|is-english)(\s|$)/g, ' ').trim() +
(isKorean ? ' is-korean' : ' is-english');

// Update existing text or create new one
let langText = langButton.querySelector('.lang-text');
if (!langText) {
const icon = langButton.querySelector('svg');
if (icon) {
icon.style.display = 'none';
langText = document.createElement('span');
langText.className = 'lang-text';
langButton.appendChild(langText);
}
}

if (langText) {
langText.textContent = currentLangText;
}

langButton.classList.add('current-language');
updateDropdownMenu();
}

// Update dropdown menu
function updateDropdownMenu() {
const dropdown = getCachedElement('.md-select__inner');
if (!dropdown) return;

const links = dropdown.querySelectorAll('.md-select__link');

links.forEach(link => {
const href = link.getAttribute('href');

if (href === '/' || href === './') {
link.textContent = 'English';
link.classList.toggle('current', !isKorean);
} else if (href === '/ko/' || href.startsWith('/ko/')) {
link.textContent = '한국어 (Korean)';
link.classList.toggle('current', isKorean);
}

// Add event listener
if (!link.hasAttribute('data-lang-listener')) {
link.setAttribute('data-lang-listener', 'true');
link.addEventListener('click', function(e) {
const targetIsKorean = href.startsWith('/ko/');

if (isKorean === targetIsKorean) {
e.preventDefault();
return;
}

const targetLang = targetIsKorean ? 'ko' : 'en';
document.cookie = `preferred_language=${targetLang}; path=/; max-age=31536000`;
});
}
});
}

// Initialization function
function init() {
updateLanguageSelector();

// Detect dynamic content with MutationObserver
const observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
// Update only when new language links are added
for (let node of mutation.addedNodes) {
if (node.nodeType === 1 && node.matches && node.matches('.md-select__link')) {
updateDropdownMenu();
break;
}
}
}
});
});

// Observe language selector container
const selectContainer = getCachedElement('.md-select');
if (selectContainer) {
observer.observe(selectContainer, {
childList: true,
subtree: true
});
}
}

// Execute immediately when DOM is ready
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
// Execute immediately if already loaded
init();
}

// Expose global function
window.switchLanguage = switchLanguage;

})();
6 changes: 6 additions & 0 deletions site-src/ko/.mkdocs-exclude
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.mkdocs-exclude
.nojekyll
.placeholder
search/search_index.json
sitemap.xml.gz
sitemap.xml
10 changes: 10 additions & 0 deletions site-src/ko/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See the OWNERS docs at https://go.k8s.io/owners
# See the OWNERS_ALIASES file at https://github.com/kubernetes-sigs/gateway-api/blob/main/OWNERS_ALIASES for a list of members for each alias.

approvers:
- sig-network-leads
- gateway-api-maintainers

reviewers:
- gateway-api-maintainers
- gateway-api-mesh-leads
Loading