when: | when: | ||||
event: [ push, tag ] | event: [ push, tag ] | ||||
build_docs: | |||||
build-docs: | |||||
image: webhippie/hugo:latest | image: webhippie/hugo:latest | ||||
pull: true | pull: true | ||||
commands: | commands: | ||||
- make clean | - make clean | ||||
- make build | - make build | ||||
docker_docs: | |||||
image: plugins/docker:17.05 | |||||
publish-docs: | |||||
image: lucap/drone-netlify:latest | |||||
pull: true | pull: true | ||||
secrets: [ docker_username, docker_password ] | |||||
repo: gitea/docs | |||||
context: docs | |||||
dockerfile: docs/Dockerfile | |||||
tags: [ '${DRONE_BRANCH##release/v}' ] | |||||
when: | |||||
event: [ push ] | |||||
branch: [ release/* ] | |||||
docker_docs: | |||||
image: plugins/docker:17.05 | |||||
pull: true | |||||
secrets: [ docker_username, docker_password ] | |||||
repo: gitea/docs | |||||
context: docs | |||||
dockerfile: docs/Dockerfile | |||||
tags: [ 'latest' ] | |||||
secrets: [ netlify_token ] | |||||
site_id: 05515f14-3702-4a84-9ff3-88ba90fe08dd | |||||
path: docs/public/ | |||||
when: | when: | ||||
event: [ push ] | event: [ push ] | ||||
branch: [ master ] | branch: [ master ] |
# build stage | |||||
FROM golang:alpine AS build-env | |||||
RUN apk add --no-cache git | |||||
RUN go get -d -v github.com/mholt/caddy/caddy github.com/pedronasser/caddy-search github.com/simia-tech/caddy-locale | |||||
WORKDIR /go/src/github.com/mholt/caddy/caddy | |||||
RUN sed -i '/This is where other plugins get plugged in (imported)/a _ "github.com/pedronasser/caddy-search"' caddymain/run.go \ | |||||
&& sed -i '/This is where other plugins get plugged in (imported)/a _ "github.com/simia-tech/caddy-locale"' caddymain/run.go \ | |||||
&& go install -v . \ | |||||
&& /go/bin/caddy -version | |||||
FROM alpine:edge | |||||
EXPOSE 80 | |||||
RUN apk add --no-cache wget mailcap ca-certificates | |||||
COPY --from=build-env /go/bin/caddy /usr/sbin/caddy | |||||
COPY docker/caddy.conf /etc/caddy.conf | |||||
COPY public /srv/www | |||||
CMD ["/usr/sbin/caddy", "-conf", "/etc/caddy.conf"] |
post: active | post: active | ||||
- name: API | - name: API | ||||
url: https://try.gitea.io/api/swagger | url: https://try.gitea.io/api/swagger | ||||
weight: 25 | |||||
weight: 45 | |||||
pre: plug | pre: plug | ||||
- name: Blog | - name: Blog | ||||
url: https://blog.gitea.io/ | url: https://blog.gitea.io/ | ||||
post: active | post: active | ||||
- name: API | - name: API | ||||
url: https://try.gitea.io/api/swagger | url: https://try.gitea.io/api/swagger | ||||
weight: 25 | |||||
weight: 45 | |||||
pre: plug | pre: plug | ||||
- name: 博客 | - name: 博客 | ||||
url: https://blog.gitea.io/ | url: https://blog.gitea.io/ | ||||
post: active | post: active | ||||
- name: API | - name: API | ||||
url: https://try.gitea.io/api/swagger | url: https://try.gitea.io/api/swagger | ||||
weight: 25 | |||||
weight: 45 | |||||
pre: plug | pre: plug | ||||
- name: 部落格 | - name: 部落格 | ||||
url: https://blog.gitea.io/ | url: https://blog.gitea.io/ | ||||
post: active | post: active | ||||
- name: API | - name: API | ||||
url: https://try.gitea.io/api/swagger | url: https://try.gitea.io/api/swagger | ||||
weight: 25 | |||||
weight: 45 | |||||
pre: plug | pre: plug | ||||
- name: Blog | - name: Blog | ||||
url: https://blog.gitea.io/ | url: https://blog.gitea.io/ | ||||
post: active | post: active | ||||
- name: API | - name: API | ||||
url: https://try.gitea.io/api/swagger | url: https://try.gitea.io/api/swagger | ||||
weight: 25 | |||||
weight: 45 | |||||
pre: plug | pre: plug | ||||
- name: Blog | - name: Blog | ||||
url: https://blog.gitea.io/ | url: https://blog.gitea.io/ | ||||
menu: | menu: | ||||
page: | page: | ||||
- name: Site | - name: Site | ||||
url: /fr-fr/ | |||||
url: https://gitea.io/en-us/ | |||||
weight: 10 | weight: 10 | ||||
pre: home | pre: home | ||||
post: active | post: active | ||||
- name: Documentation | - name: Documentation | ||||
url: https://docs.gitea.io/fr-fr/ | |||||
url: /fr-fr/ | |||||
weight: 20 | weight: 20 | ||||
pre: question | pre: question | ||||
- name: API | - name: API | ||||
url: https://try.gitea.io/api/swagger | url: https://try.gitea.io/api/swagger | ||||
weight: 25 | |||||
weight: 45 | |||||
pre: plug | pre: plug | ||||
- name: Blog | - name: Blog | ||||
url: https://blog.gitea.io/ | url: https://blog.gitea.io/ |
:80 { | |||||
root /srv/www | |||||
locale en-US zh-CN zh-TW pt-BR nl-NL fr-FR { | |||||
detect header | |||||
} | |||||
redir 301 { | |||||
if {path} match ^/$ | |||||
/ /{>Detected-Locale}/ | |||||
} | |||||
rewrite /en-US/ { | |||||
regexp (.*) | |||||
to /en-us/{1} | |||||
} | |||||
rewrite /zh-CN/ { | |||||
regexp (.*) | |||||
to /zh-cn/{1} | |||||
} | |||||
rewrite /zh-TW/ { | |||||
regexp (.*) | |||||
to /zh-tw/{1} | |||||
} | |||||
rewrite /pt-BR/ { | |||||
regexp (.*) | |||||
to /pt-br/{1} | |||||
} | |||||
rewrite /nl-NL/ { | |||||
regexp (.*) | |||||
to /nl-nl/{1} | |||||
} | |||||
rewrite /fr-FR/ { | |||||
regexp (.*) | |||||
to /fr-fr/{1} | |||||
} | |||||
header / Vary "Accept-Language" | |||||
} |
/* | |||||
Content-Security-Policy: default-src 'self' | |||||
X-Frame-Options: DENY | |||||
X-Xss-Protection: 1; mode=block | |||||
X-Content-Type-Options: nosniff | |||||
Referrer-Policy: strict-origin-when-cross-origin |
https://gitea-docs.netlify.com/* https://docs.gitea.io/:splat 302! | |||||
/ /fr-fr/ 302! Language=fr | |||||
/ /nl-nl/ 302! Language=nl | |||||
/ /pt-br/ 302! Language=pt-br | |||||
/ /zh-cn/ 302! Language=zh-cn | |||||
/ /zh-tw/ 302! Language=zh-tw | |||||
/ /en-us/ 302! |