Skip to content

Commit 9eebf07

Browse files
authored
Merge branch 'master' into patch-1
2 parents 93a888f + 056f91a commit 9eebf07

File tree

108 files changed

+6764
-792
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+6764
-792
lines changed

.github/workflows/deploy.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build and Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
with:
24+
persist-credentials: false
25+
- name: Install and Build
26+
run: |
27+
npm install
28+
npx honkit build
29+
- name: Upload artifact
30+
uses: actions/upload-pages-artifact@v1
31+
with:
32+
path: _book
33+
34+
deploy:
35+
needs: build
36+
permissions:
37+
pages: write
38+
id-token: write
39+
environment:
40+
name: github-pages
41+
url: ${{ steps.deployment.outputs.page_url }}
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v2

.github/workflows/test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Build
2+
on:
3+
- pull_request
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
with:
12+
persist-credentials: false
13+
14+
- name: Install and Build
15+
run: |
16+
npm install
17+
npx honkit build

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tutorial-extensions.djangogirls.org

LANGS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
* [🇺🇸 English](en/)
22
* [🇰🇷 Korean](ko/)
33
* [🇪🇸 Spanish](es/)
4+
* [🇯🇵 日本語](ja/)
5+
* [🇮🇷 فارسی](fa/)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
2-
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/
2+
To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/

Makefile

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
LANG := en
2+
LANG_FILE := $(shell test -f .langs && echo .langs || echo LANGS.md)
3+
LANG_DATA := $(shell grep "$(LANG)/" $(LANG_FILE))
4+
LANG_NAME := $(shell echo "$(LANG_DATA)" | sed 's/.*\[\(.*\)\].*/\1/')
5+
6+
define ebook_support
7+
@if which ebook-convert 1> /dev/null; then\
8+
npx honkit $(1) ./ ./djangogirls.$(1);\
9+
else\
10+
echo "Error: ebook-convert is not found";\
11+
echo " * Follow the guide at https://honkit.netlify.app/ebook";\
12+
echo " - For Debian/Ubuntu, Try: sudo apt install calibre";\
13+
echo " - For MacOS, Try: brew install --cask calibre";\
14+
echo " - For Windows and any other OS, Download from https://github.com/kovidgoyal/calibre/releases";\
15+
false;\
16+
fi
17+
endef
18+
19+
help:
20+
@echo
21+
@echo "Usage: make command [LANG=<language_short_code>]"
22+
@echo
23+
@echo " LANG: Language shortcodes are found in LANGS.md. Default is 'en'(English)."
24+
@echo " ( Refer $(LANG_FILE) for shortcodes of Languages available. )"
25+
@echo
26+
@echo "Commands:"
27+
@echo " help - Display make command list."
28+
@echo " dev - Setup the project and start the development server with debugging enabled."
29+
@echo " check - Check for the root directory for various dependencies."
30+
@echo " setup - Setup the temporary language and install node dependencies for the development."
31+
@echo " build - Build the honkit project."
32+
@echo " build-dev - Build the honkit project with debug log."
33+
@echo " serve - Start honkit server locally for development."
34+
@echo " pdf - Generate the PDF version of DjangoGirls tutorial-extensions."
35+
@echo " epub - Generate the EPUB version of DjangoGirls tutorial-extensions."
36+
@echo " mobi - Generate the MOBI version of DjangoGirls tutorial-extensions."
37+
@echo " mode - Shows the development mode status."
38+
@echo " exit - Exit development mode."
39+
@echo
40+
@echo "Example:"
41+
@echo
42+
@echo "$$ make dev LANG=es"
43+
@echo
44+
@echo "The above command will start the development server using the language Español."
45+
@echo "'LANG' argument is only required the first time until the exit command is executed."
46+
@echo
47+
48+
.git/hooks/pre-commit:
49+
@echo "#!/bin/sh\n\
50+
\n\
51+
if test -f \"./.langs\"; then\n\
52+
echo \"Error: You can't commit without exiting development mode.\\\n\\\n\\\\\
53+
\nTry the following command to exit development mode:\\\n\\\n\\\\\
54+
\n$$ make exit\\\n\" 1>&2;\n\
55+
exit 1\n\
56+
fi\n" > ./.git/hooks/pre-commit
57+
@chmod u+x ./.git/hooks/pre-commit
58+
59+
node_modules:
60+
@npm install
61+
62+
check: package.json book.json LANGS.md
63+
@if ! which node 1> /dev/null; then\
64+
echo "Error: Node.js not found";\
65+
echo " * Please install/reinstall NodeJS on your system.";\
66+
echo " * NVM is recommended for installation (https://github.com/nvm-sh/nvm).";\
67+
false;\
68+
fi
69+
70+
setup: node_modules check .git/hooks/pre-commit
71+
@if ! test -f ".langs"; then\
72+
cp LANGS.md .langs && \
73+
echo "$(LANG_DATA)" > LANGS.md && \
74+
echo "You are set to $(LANG_NAME) for development";\
75+
fi
76+
77+
build: setup
78+
@npx honkit build
79+
80+
build-dev: setup
81+
@npx honkit build --log=debug
82+
83+
serve: setup
84+
@npx honkit serve
85+
86+
dev: setup
87+
@npx honkit serve --log=debug
88+
89+
mode:
90+
@if test -f ".langs"; then\
91+
echo "You are in development mode using the language $(LANG_NAME)";\
92+
else\
93+
echo "You are not in development mode";\
94+
fi
95+
96+
exit:
97+
@if test -f ".langs"; then\
98+
mv -f .langs LANGS.md && echo "Language file is restored";\
99+
rm -rf node_modules _book .git/hooks/pre-commit && echo "The project exited development mode.";\
100+
fi
101+
102+
pdf:
103+
$(call ebook_support,pdf)
104+
105+
epub:
106+
$(call ebook_support,epub)
107+
108+
mobi:
109+
$(call ebook_support,mobi)
110+
111+
.PHONY: help check setup build build-dev serve dev pdf epub mobi mode exit

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> **Info** This work is licensed under the Creative Commons Attribution-ShareAlike 4.0
44
International License. To view a copy of this license, visit
5-
http://creativecommons.org/licenses/by-sa/4.0/
5+
https://creativecommons.org/licenses/by-sa/4.0/
66

77
## Introduction
88

@@ -16,8 +16,8 @@ Current tutorials are:
1616
- [Homework: create comment model](/en/homework_create_more_models)
1717
- [Optional: PostgreSQL installation](/en/optional_postgresql_installation)
1818
- [Optional: Domain](/en/domain)
19-
- [Deploy your website on Heroku](/en/heroku)
2019

2120
## Contributing
2221

23-
These tutorials are maintained by [DjangoGirls](http://djangogirls.org/). If you find any mistakes or want to update the tutorial please [follow the contributing guidelines](https://github.com/DjangoGirls/tutorial#how-to-contribute).
22+
These tutorials are maintained by [DjangoGirls](http://djangogirls.org/). If you find any mistakes or want to update the tutorial
23+
please [follow the contributing guidelines](./contributing/README.md).

book.json

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
"github",
77
"codeblock-label",
8-
"sidebar-ad",
8+
"sidebar-ads",
99
"language-picker"
1010
],
1111
"pluginsConfig": {
@@ -15,11 +15,63 @@
1515
"github": {
1616
"url": "https://github.com/DjangoGirls/tutorial-extensions"
1717
},
18-
"sidebar-ad": {
19-
"imageUrl": "https://cdn.shopify.com/s/files/1/0992/7712/products/codelikeagirl---mockup4_large.jpg",
20-
"url": "https://store.djangogirls.org/",
21-
"description": "💖 Support our work and buy a Django Girls t-shirt! ✨",
22-
"btnText": "Get a t-shirt!"
18+
"sidebar-ads": {
19+
"ads": [
20+
{
21+
"imageUrl": "https://djangogirls.org/static/img/global/donate/lagos.jpg",
22+
"url": "https://surveys.jetbrains.com/s3/w-django-girls-survey-2024",
23+
"description": "💖 Celebrate 10 years with us. Fill our survey! ✨",
24+
"btnText": "Fill in now!"
25+
},
26+
{
27+
"imageUrl": "https://static.djangoproject.com/img/logos/django-logo-negative.png",
28+
"url": "https://www.djangoproject.com/",
29+
"description": "💖 The DSF supports the development of Django! ✨",
30+
"btnText": "Learn more!"
31+
},
32+
{
33+
"imageUrl": "https://djangogirls.org/static/img/global/supporters/DO_Logo_Vertical_Blue.png",
34+
"url": "https://www.digitalocean.com/",
35+
"description": "💖 DigitalOcean simplifies cloud computing! ✨",
36+
"btnText": "Learn more!"
37+
},
38+
{
39+
"imageUrl": "https://djangogirls.org/uploads/uploads/posthog.png",
40+
"url": "https://posthog.com/",
41+
"description": "💖 PostHog offers a suite of product analysis tools! ✨",
42+
"btnText": "Learn more!"
43+
},
44+
{
45+
"imageUrl": "https://djangogirls.org/uploads/uploads/lincolnloop.png",
46+
"url": "https://lincolnloop.com/",
47+
"description": "💖 Lincoln Loop provides scalable content platforms! ✨",
48+
"btnText": "Learn more!"
49+
},
50+
{
51+
"imageUrl": "https://djangogirls.org/uploads/uploads/torchbox.png",
52+
"url": "https://torchbox.com/",
53+
"description": "💖 Torchbox, the creators of Wagtail! ✨",
54+
"btnText": "Learn more!"
55+
},
56+
{
57+
"imageUrl": "https://www.pythonanywhere.com/static/anywhere/images/PA-logo.svg",
58+
"url": "https://www.pythonanywhere.com/",
59+
"description": "💖 Host, run, and code Python in the cloud! ✨",
60+
"btnText": "Learn more! "
61+
},
62+
{
63+
"imageUrl": "https://djangogirls.org/static/img/global/donate/lagos.jpg",
64+
"url": "https://www.patreon.com/djangogirls",
65+
"description": "💖 Support our work and donate to our project! ✨",
66+
"btnText": "Donate now!"
67+
},
68+
{
69+
"imageUrl": "https://djangogirls.org/static/img/global/donate/tshirt.jpg",
70+
"url": "https://djangogirls.org/en/contact/",
71+
"description": "💖 Want to support our work? ✨",
72+
"btnText": "Contact Us!"
73+
}
74+
]
2375
},
2476
"language-picker": {
2577
"grid-columns": 3

0 commit comments

Comments
 (0)