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

Add minimal miyadaiku build and build with Vercel #18

Merged
merged 1 commit into from
Jun 12, 2020
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
6 changes: 6 additions & 0 deletions .miyadaiku/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Miyadaiku config file
site_url: https://djangoproject.jp/
site_title: "- djangoproject.jp"
lang: en-US
charset: utf-8
timezone: Etc/UTC
29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "djangoproject.jp",
"version": "0.0.1",
"description": "Source code of http://djangoproject.jp/",
"scripts": {
"build": "npm run -s install-miyadaiku && npm run -s escape-jinja2 && npm run -s prepare-contents && npm run -s prepare-templates && miyadaiku-build work && npm run -s setup-artifacts",
"escape-jinja2": "sed -i -e '1i {% raw %}' -e '$a {% endraw %}' $(find . -type f -name '*.html*')",
Copy link
Member Author

Choose a reason for hiding this comment

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

HTML中のJinja2フォーマットを解釈してしまうので、rawで囲う。以下の2ファイルだけがJinja2を含む。

cf. https://zeit.co/django-ja/djangoproject-jp/9nmfo5r70

"install-miyadaiku": "pip3 install miyadaiku",
"prepare-contents": "mkdir -p work/contents && cp .miyadaiku/config.yml work/ && mv djangoproject.jp/{about,community,events,howtojoin-transifex,howtotranslate,index.html,translate,translate_old,weblog,whouses} work/contents/",
"prepare-templates": "mkdir -p work/templates && echo '{{ page.html }}' | tee work/templates/page_index.html | tee work/templates/page_article.html > /dev/null",
tnir marked this conversation as resolved.
Show resolved Hide resolved
"setup-artifacts": "mv work/outputs/* djangoproject.jp/"
},
"repository": {
"type": "git",
"url": "https://github.com/django-ja/djangoproject.jp"
},
"keywords": [
"django"
],
"author": "django-ja",
"contributors": [
"Takuya Noguchi <takninnovationresearch@gmail.com> (https://github.com/tnir)"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/django-ja/djangoproject.jp/issues"
},
"homepage": "https://djangoproject.jp"
}